can you list the ways to use variables from a form globally in laravel 8?

Check out the View::share documentation. If that is not what you are looking for, then I would suggest, inside your controller, set a session variable like this.

 Session::put('foo', 'bar')

Above foo is the name of the variable and bar is the value. Now, when I need to change the value of foo, for example in a blade file, I can do so like this.

{{Session::put('foo','Another Bar')}}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top