404 page in laravel
//step 1 ) create the errors/404.blade.php in view.
// step 2 ) go to Handler.php and replace the render function to belwo function.
public function render($request, Throwable $exception)
{
if ($exception instanceof AccessDeniedHttpException) {
return response(view('errors.404'), 404);
}
return parent::render($request, $exception);
}/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
if ($this->isHttpException($exception)) {
if ($exception->getStatusCode() == 404) {
return response()->view('errors.' . '404', [], 404);
}
}
return parent::render($request, $exception);
}
Also in PHP:
- array_key_exists(
- errors register
- Class 'App\Widgets\BaseDimmer' not found \vendor\tcg\voyager\resources\views\dimmers.blade.php)
- Installation request for pokemon-tcg/pokemon-tcg-sdk-php ^1.2 -> satisfiable by pokemon-tcg/pokemon-tcg-sdk-php[1.2.0]
- echo header location php
- clear laravel cash
- base64 decode php function
- check if string contain word
- Twig\Error\SyntaxError: Unknown "file_uri" function. Did you mean "file_url"?
- carbon random future date
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:
- find string into string
- create new projec in laravel
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767
- Builder::unique() laravel
- display human readable date php
- catch custom exception php
- config clear cache laravel
- date php D
- [WAR] 70 (lib\peer.php:164) file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
- cache:clear artisan laravel
- composer php version
- catch new exception php
- PHP make an image from a random alphanumerric string