nhattay / laravel-404page
Laravel custom 404 page
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nhattay/laravel-404page
Requires
- php: >=7.2
- illuminate/database: ^7.0|^8.0|^9.0|^10.0
- illuminate/http: ^7.0|^8.0|^9.0|^10.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0
This package is auto-updated.
Last update: 2025-12-17 14:20:23 UTC
README
#Introduction To give you an ability to custom 404 page. Custom 404 page according the Model.
Requirements
PHP 7.0 and later.
Installation
Composer
composer require nhattay/laravel-404page
Configuration
php artisan vendor:publish --tag=404page
you can see a new file config/404page.php
Getting Started
- Custom view
'models' => [ App\Models\User::class => [ 'view' => 'user-404', /* It refers to file resources/views/user-404.blade.php */ ] ]
- Passing variables to the view
'models' => [ App\Models\User::class => [ 'view' => 'user-404', /* It refers to file resources/views/user-404.blade.php */ 'variables' => [ /* You are able to pass variables to the view */ 'customMessage' => 'User not found', ], ] ]
Then there's a variable $customMessage available in the view