本文整理汇总了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]);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例7: salas
public function salas()
{
$salas = Sala::all();
if (is_null($salas)) {
App::abort(404);
}
return view('docente.versalas', compact('salas', 'campus'));
}
示例8: asignar
public function asignar($id)
{
$campus = Campus::find($id);
if (is_null($campus)) {
App::abort(404);
}
return view('administrador.asignar', compact('campus'));
}
示例9: editar
public function editar($id)
{
$salas = Sala::find($id);
if (is_null($salas)) {
App::abort(404);
}
return view('encargado.edit', compact('salas'));
}
示例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);
}
示例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);
}
示例12: handle
public function handle($request, Closure $next, $permissions)
{
$admin = Auth::admin()->get();
if (!$admin->can(explode(',', $permissions))) {
App::abort('404');
}
return $next($request);
}
示例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'));
}
示例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);
}
示例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);
}