/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $format = Carbon::now()->subMonth(); $videos = $this->video->where('user_id', Auth::user()->id); $categories = Category::all(); $latest = $this->video->whereDateFormat('created_at', '>=', $format); return view('pages.profile', compact('videos', 'latest'))->with('categories', $categories); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $video = $this->video->find($id); $categories = Category::all(); return view('pages.editvideo')->with('video', $video)->with('categories', $categories); }