user

Eslam Zedan

21 Feb 2022

How to pass valiables to 404 error page in laravel?

Laravel

In my laravel project, I have created a 404 view file at resources/views/errors/404.blade.php

Put I want to pass some variables to use it at the view.

Any help with that.

 

Thanks in advance.

Comments

Yasen Sayed

21 Feb 2022

You can use a view composer :

 

\View::composer('errors/404', function($view)
{
 $view->with('myVariable', $data);
});

Replies

Eslam Zedan

21 Feb 2022

Use it in where exactly ??

© 2024 Copyrights reserved for web-brackets.com