/** * Show the form for editing the specified resource. * * @param Shops $shops * @return Response * @internal param int $id */ public function edit(Shops $shops) { if (Auth::check()) { if ($shops->user_id != Auth::user()->id) { return redirect('/'); } } $shop = Shops::with('profile', 'attachment')->where('id', $shops->id)->first(); return view('shops::edit', compact('shop')); }
/** * @GET("/upload_vk_items") * @return \Illuminate\View\View */ public function index() { $user_shops = Shops::with('profile')->where('user_id', \Auth::user()->id)->get()->toArray(); return view('upload_vk_items.index', compact('user_shops')); }
/** * Display the specified resource. * * @param int $id * @return Response * @Middleware("auth") */ public function show($id) { $shops = Shops::with('items')->find($id); return view('shops::shopitems.index', compact('shops')); }