当前位置: 首页>>代码示例>>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;未经允许,请勿转载。