public function update($id, VideoRequest $request)
 {
     $video = $this->videorepository->findOrFail($id);
     if ($request->file('thumbnail')) {
         $file = $request->file('thumbnail');
         $destinationPath = 'images/cursus/videos/' . $video->id;
         $filename = $file->getClientOriginalName();
         $encoded = urldecode($filename);
         $upload_success = $file->move($destinationPath, $encoded);
         $image = str_replace('\\', '/', $upload_success);
     } else {
         $image = $video->thumbnail;
     }
     $video->update(['titel' => $request->get('titel'), 'link' => $request->get('link'), 'plan_id' => $request->get('plan_id'), 'hoofdstuk_id' => $request->get('hoofdstuk_id'), 'thumbnail' => $image, 'tool1_tekst' => $request->get('tool1_tekst'), 'tool1_link' => $request->get('tool1_link'), 'tool2_tekst' => $request->get('tool2_tekst'), 'tool2_link' => $request->get('tool2_link'), 'tool3_tekst' => $request->get('tool3_tekst'), 'tool3_link' => $request->get('tool3_link'), 'tool4_tekst' => $request->get('tool4_tekst'), 'tool4_link' => $request->get('tool4_link')]);
     return redirect('jandje/videos');
 }
 public function video(VideoRequest $request)
 {
     $file = $request->file('video');
     $data['name'] = $file->getClientOriginalName();
     $data['path'] = base_path() . '\\public\\videos';
     $data['slug'] = Str::slug($file->getClientOriginalName(), '_');
     $data['type'] = "video";
     Upload::create($data);
     $file->move($data['path'], $data['name']);
     //
     return back()->with('message', 'file saved!');
 }