當前位置: 首頁>>代碼示例>>PHP>>正文


PHP App::abort方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\App::abort方法的典型用法代碼示例。如果您正苦於以下問題:PHP App::abort方法的具體用法?PHP App::abort怎麽用?PHP App::abort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\App的用法示例。


在下文中一共展示了App::abort方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getReset

 /**
  * Display the password reset view for the given token.
  *
  * @param  string  $token
  * @return \Response
  */
 public function getReset($token = null)
 {
     if (is_null($token)) {
         App::abort(404);
     }
     $this->view('password.reset', ['token' => $token]);
 }
開發者ID:jacobDaeHyung,項目名稱:laravel-tricks,代碼行數:13,代碼來源:RemindersController.php

示例2: getIndex

 /**
  * Index action.
  *
  * @return mixed
  */
 public function getIndex($type = null)
 {
     $container = Input::get('c');
     $files = Input::get('files', '');
     if (empty($type) || !in_array($type, array('style', 'script'))) {
         App::abort(404);
     }
     if (empty($container)) {
         App::abort(404);
     }
     $files = json_decode(base64_decode($files), true);
     if (empty($files) || !is_array($files)) {
         App::abort(404);
     }
     foreach ($files as $file) {
         Casset::container($container)->add(array_get($file, 'source'), array(), array_get($file, 'dependencies', array()));
     }
     $response = Response::make(Casset::container($container)->content($type));
     if ('style' == $type) {
         $response->headers->set('Content-Type', 'text/css');
     } else {
         $response->headers->set('Content-Type', 'application/json');
     }
     return $response;
 }
開發者ID:jooorooo,項目名稱:laravel-casset,代碼行數:30,代碼來源:CassetController.php

示例3: getReset

 /**
  * Display the password reset view for the given token.
  *
  * @param  string $token
  *
  * @return Response
  */
 public function getReset($token = null)
 {
     if (is_null($token)) {
         App::abort(404);
     }
     return View::make('password.reset')->with('token', $token);
 }
開發者ID:virtualvendors,項目名稱:altwallets,代碼行數:14,代碼來源:RemindersController.php

示例4: getImage

 public function getImage($id, $type, $extension)
 {
     $coverType = Image::getImageTypeFromName($type);
     if ($coverType == null) {
         App::abort(404);
     }
     $image = Image::find($id);
     if (!$image) {
         App::abort(404);
     }
     $response = Response::make('', 200);
     $filename = $image->getFile($coverType['id']);
     if (!is_file($filename)) {
         $redirect = url('/images/icons/profile_' . Image::$ImageTypes[$coverType['id']]['name'] . '.png');
         return Redirect::to($redirect);
     }
     if (Config::get('app.sendfile')) {
         $response->header('X-Sendfile', $filename);
     } else {
         $response->header('X-Accel-Redirect', $filename);
     }
     $response->header('Content-Disposition', "filename=\"ponyfm-i{$id}-{$type}.{$image->extension}\"");
     $response->header('Content-Type', $image->mime);
     $lastModified = filemtime($filename);
     $response->header('Last-Modified', $lastModified);
     $response->header('Cache-Control', 'max-age=' . 60 * 60 * 24 * 7);
     return $response;
 }
開發者ID:nsystem1,項目名稱:Pony.fm,代碼行數:28,代碼來源:ImagesController.php

示例5: handle

 /**
  * Handle an incoming request.
  *
  * Check to see if ANY accounts have been setup. If they have, return a 404. This
  * should be used for requests that are only active when no accounts are available.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->accountService->totalNumberOfAccounts()) {
         App::abort(404);
     }
     return $next($request);
 }
開發者ID:kamaroly,項目名稱:shift,代碼行數:17,代碼來源:InstallationMiddleware.php

示例6: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  *
  * @throws App
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $is_auth = $this->authorizer->validateScopeOfMe($request);
     if ($is_auth['status'] != 'success') {
         App::abort(404);
     }
     return $next($request);
 }
開發者ID:erickmo,項目名稱:CapcusAPI,代碼行數:18,代碼來源:OAuthScopeMeMiddleware.php

示例7: salas

 public function salas()
 {
     $salas = Sala::all();
     if (is_null($salas)) {
         App::abort(404);
     }
     return view('docente.versalas', compact('salas', 'campus'));
 }
開發者ID:CarHiVe,項目名稱:project,代碼行數:8,代碼來源:DocenteController.php

示例8: asignar

 public function asignar($id)
 {
     $campus = Campus::find($id);
     if (is_null($campus)) {
         App::abort(404);
     }
     return view('administrador.asignar', compact('campus'));
 }
開發者ID:CarHiVe,項目名稱:project,代碼行數:8,代碼來源:AdministradorController.php

示例9: editar

 public function editar($id)
 {
     $salas = Sala::find($id);
     if (is_null($salas)) {
         App::abort(404);
     }
     return view('encargado.edit', compact('salas'));
 }
開發者ID:CarHiVe,項目名稱:project,代碼行數:8,代碼來源:EncargadoController.php

示例10: handle

 public function handle($request, Closure $next)
 {
     $route_helper = App::make('route_perm_helper');
     if (!$route_helper->hasPermForRoute(Route::currentRouteName())) {
         App::abort('401');
     }
     return $next($request);
 }
開發者ID:donotgowiththeflow,項目名稱:laravel-acl-seeinfront,代碼行數:8,代碼來源:CanSee.php

示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  *
  * @throws App
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $is_auth = json_decode($this->authorizer->inspectRequest($request), true);
     if ($is_auth['status'] != 'success') {
         App::abort(404);
     }
     return $next($request);
 }
開發者ID:erickmo,項目名稱:CapcusAPI,代碼行數:18,代碼來源:OAuthMiddleware.php

示例12: handle

 public function handle($request, Closure $next, $permissions)
 {
     $admin = Auth::admin()->get();
     if (!$admin->can(explode(',', $permissions))) {
         App::abort('404');
     }
     return $next($request);
 }
開發者ID:loopeer,項目名稱:quickcms,代碼行數:8,代碼來源:PermissionMiddleware.php

示例13: getPublicProfile

 public function getPublicProfile($username)
 {
     $lender = LenderQuery::create()->useUserQuery()->filterByUsername($username)->endUse()->findOne();
     if (!$lender) {
         \Illuminate\Support\Facades\App::abort(404);
     }
     return View::make('lender.public-profile', compact('lender'));
 }
開發者ID:Junyue,項目名稱:zidisha2,代碼行數:8,代碼來源:LenderController.php

示例14: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  *
  * @throws App
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $is_allowed = json_decode($this->authorizer->validateSuperUser($request), true);
     if ($is_allowed['status'] != 'success') {
         App::abort(404);
     }
     return $next($request);
 }
開發者ID:erickmo,項目名稱:CapcusAPI,代碼行數:18,代碼來源:OAuthSuperUserMiddleware.php

示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle($request, \Closure $next)
 {
     $locale = $this->request->segment(1) ?: App::getLocale();
     $item = $this->menuItem->findByUriInLanguage($this->request->segment(2), $locale);
     if ($this->isOffline($item)) {
         App::abort(404);
     }
     return $next($request);
 }
開發者ID:Houbsi,項目名稱:Core,代碼行數:16,代碼來源:PublicMiddleware.php


注:本文中的Illuminate\Support\Facades\App::abort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。