Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function add_filling_detail(Request $request)
- {
- $this->validate($request, [
- 'image_path' => 'required|mimes:doc,docx,pdf,jpeg,jpg,png|max:2048'
- ]);
- $image_path = $request->file('image_path');
- $new_name = rand() . '.' . $image_path->getClientOriginalExtension();
- Oil_Filling::create([
- 'image_path' => $image_path->move('filling_images', $new_name),
- ]);
- return redirect('admin/filing_list');
- }
- <form method="post" action="{{ url('oil_filling/add_filling_detail') }}" enctype="multipart/form-data">
- <div class="form-group">
- <label class="control-label">image Upload</label>
- <input type="file" name="image_path" class="form-control" required>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement