Exemplo n.º 1
0
 public function create(Request $request)
 {
     $this->validate($request, ['ftep' => 'required']);
     $ftep = Ftep::find($request->input('ftep'), ['id', 'ft_id', 'title']);
     $ft = Ft::find($ftep->ft_id, ['title']);
     return view('ftepfav.create', ['ftep' => $ftep, 'ft' => $ft]);
 }
Exemplo n.º 2
0
 public function create(Request $request)
 {
     if ($request->has('ftep')) {
         return view('ftrev.create', ['ft' => Ft::find($request->input('ft'), ['id', 'title']), 'ftep' => Ftep::find($request->input('ftep'), ['id', 'title'])]);
     } else {
         return view('ftrev.create', ['ft' => Ft::find($request->input('ft'), ['id', 'title'])]);
     }
 }
Exemplo n.º 3
0
 public function favorites($id)
 {
     $ft = Ft::find($id, ['id', 'title']);
     $favorites = Ftfav::with(['user' => function ($query) {
         $query->select('id', 'name');
     }])->select('user_id', 'created_at')->where('ft_id', $id)->orderBy('created_at')->paginate(20);
     return view('ft.favorites', ['ft' => $ft, 'favorites' => $favorites]);
 }