neomusic / laravel-section-error-views
Multi section error handle views
Installs: 42
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/neomusic/laravel-section-error-views
Requires
- laravel/framework: 5.*
This package is not auto-updated.
Last update: 2021-02-10 02:05:50 UTC
README
This package is usefull if your project have multi sections with different views
for example: In your project you have two sections backend and `frontend, each section have different views for handle error
backend -> resources/views/backend/errors
frontend -> resources/views/frontend/errors
However, if an exception is thrown but not the view exists for that section? Don't worry
The generic view will continue to exist, as well as the response in json in case of an API is called
##install
-
composer require neomusic/laravel-section-error-views -
go to
app/Exceptions/Handlerand extends this class withNeoMusic\LaravelSectionErrorViews\Exceptions\SectionHandler -
implement function
sectionRenderwith your criteria for example:public function sectionRender($request,Exception $e) { if($request->is('admin/*')) { $this->renderBackoffice($request, $e); } else { $this->renderFrontend($request, $e); } }