Level 88
Well, Laravel makes it really easy to handle uploads. Check out the documentation for this: https://laravel.com/docs/7.x/filesystem#file-uploads
The rest of your code looks ok, so not sure why this isn't working for you.
When I upload video then that video stay on a temp file. So, don't play video in a front.
if ($request->hasFile('video')) { $image_tmp = $request->file('video'); if ($image_tmp->isValid()) { $extension = $image_tmp->getClientOriginalExtension(); $file_name = time().'.'.$extension; $location = public_path('uploads/videos/'. $file_name); $image_tmp->move($location);
$video->video = $file_name;
}
}
Please or to participate in this conversation.