I want to upload multiple videos to their site and want to list them there. Please give me a solution to how can manage this.
I want to save it in the database so that could list on the site.
This is my code but not working proper consuming more time to upload and the page is expired
$this->validate($request, [
'filename' => 'required',
'file' => 'mimes:mp4,ts|max:100040|required'
]);
dd($request->all());
if ($request->hasFile('file')) {
//upload file
$file = $request->file('file');
if(!empty($file) && $file != null)
{
$video_file = new VideoPost();
$fileExentsion = $file->extension();
$fileName = $file->getClientOriginalName();
$fileFullName = time()."_".$fileName;
$path = Str::slug($fileFullName).".".$fileExentsion;
$file->move(public_path('files/'), $path);
$fullpath = 'files/'.$path;
$video_file->file = $fullpath;
$video_file->file_name = $request->file_name;
$video_file->save();
}
}