public function create(Request $request) { $this->validate($request, ['live' => 'required']); $live = Live::find($request->input('live'), ['id', 'title']); return view('livefav.create', ['live' => $live]); }
public function create(Request $request) { $live = Live::find($request->input('live'), ['id', 'title']); return view('liverev.create', ['live' => $live]); }
public function favorites($id) { $live = Live::find($id, ['id', 'title']); $favorites = Livefav::with(['user' => function ($query) { $query->select('id', 'name'); }])->select('user_id', 'created_at')->where('live_id', $id)->orderBy('created_at')->paginate(20); return view('live.favorites', ['live' => $live, 'favorites' => $favorites]); }