Birmingham mumbai


Download 1.3 Mb.
Pdf ko'rish
bet57/68
Sana05.01.2022
Hajmi1.3 Mb.
#227543
1   ...   53   54   55   56   57   58   59   60   ...   68
Bog'liq
Laravel 5 Essentials

Handling HTTP exceptions

When an error occurs in your application, Laravel raises an exception. This is also 

true for HTTP errors, as Laravel will raise an appropriate HTTP exception. Usually 

when an HTTP error occurs, you will want to display a response informing the user 

what went wrong. This is easy in Laravel 5, as all you need to do is create a view 

named after the HTTP status code you want it to display for in the 

resources/

views/errors

 directory.

For example, if you wanted to display a view for 404 Not Found errors, then all you 

need to do is create a view at 

resources/views/errors/404.blade.php

.

You can use this approach to handle other HTTP errors as well, such as 403 Forbidden 



errors; simply create a view at 

resources/views/errors/403.blade.php

.

We'll cover views later on in this chapter. In the meantime, you can find a list of HTTP 



status codes at 

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

.


Download 1.3 Mb.

Do'stlaringiz bilan baham:
1   ...   53   54   55   56   57   58   59   60   ...   68




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling