/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $idAlbum = $this->route->getParameter('album'); $album = ImgAlbum::find($idAlbum); if ($album->onlymembers) { if ($this->auth->guest()) { return redirect()->guest('auth/login'); } else { $user = $this->auth->user(); if (!$user->HasAccessAlbum($idAlbum)) { //AGREGAR MENSAJE no ir // return redirect()->to('albumregister/' . $idAlbum); Session::flash('message', 'No tienes acceso.'); return redirect()->back(); } } } return $next($request); }
public function listImg($id) { $Album = ImgAlbum::find($id); return view('pics.listImg')->with('Album', $Album); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $album = ImgAlbum::find($id); $categories = ImgCategory::lists('desc', 'id'); return view('admin.album.edit', ['album' => $album, 'categories' => $categories]); }