Beispiel #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (!Auth::user()->can('view-video')) {
         return view('errors.denied');
     }
     $files = $this->video->getPaginated();
     return view('video.index')->with('files', $files);
 }
 /**
  * Remove the specified video from storage.
  *
  * @param $id
  *
  * @return mixed
  */
 public function destroy($id)
 {
     $video = $this->video->findOrFail($id);
     $nameFile = str_replace('storage/', '', $video->path);
     Storage::disk('public')->delete([$nameFile . '.mp4', $nameFile . '.webm']);
     $this->video->delete($id);
 }