Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel custom 404 blade

// Create a file in resources/views/errors/404.blade.php and add this code.
@extends('errors::minimal')

@section('title', __('Not Found'))
@section('code', '404')

@if($exception)
    @section('message', $exception->getMessage())
@else
    @section('message', __('Not Found'))
@endif
  
 abort(404, 'Whatever you were looking for, look somewhere else');
Comment

laravel 404

//Some exceptions describe HTTP error codes from the server. For example, this may be a "page not found" error (404),
//In order to generate such a response from anywhere in your application, you may use the abort helper:

return abort(404);
// OR
return abort(404, "page not found");
Comment

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);
    }
Comment

custom 404 page in laravel

A very simple one
  
  php artisan vendor:publish --tag=laravel-errors
Comment

error laravel 404 in server

$ sudo a2enmod rewrite
$ sudo service apache2 restart
Comment

PREVIOUS NEXT
Code Example
Php :: artisan 
Php :: get 2 days before date in php 
Php :: Fibonacci Series Program. in php 
Php :: php erase element from array 
Php :: php get max key in associative array 
Php :: php unset reference 
Php :: how to remove duplicate values from an array in php 
Php :: php var in string 
Php :: search by date using carbon laravel 
Php :: artisan make command 
Php :: print only some characters of a string in php 
Php :: how to remove Website field from comments 
Php :: how to get last id in database 
Php :: move post to draft php wordpress 
Php :: composer update php mbstring.so missing 
Php :: php if else 
Php :: brew install php 5.6 
Php :: migrate specific file in laravel 
Php :: laravel collection put 
Php :: how to inherit a class php 
Php :: next year php string 
Php :: laravel tree 
Php :: Merge Two Array ( Laravel ) 
Php :: laravel default string length migration 
Php :: how convert the date and time to integer in laravel 
Php :: join table laravel count 
Php :: Laravel: Validation unique on update 
Php :: laravel get latest 
Php :: check if the link is image or url php 
Php :: delete previous uploaded image when update laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =