How to assign a variable value for all view file?
Answer / Sunny Verma
To assign a variable value that will be available across all your views, you can use the global $data array in Laravel. Here is an example: $data['myVar'] = 'someValue'; return view('yourView', $data);
| Is This Answer Correct ? | 0 Yes | 0 No |
How many types of middleware are there in laravel?
What are the software’s included in laravel homestead?
What do you mean by boot & register method used in laravel 5?
What are all the different Route Parameters ?
What is the difference between {{ $username }} and {!! $Username !!} In laravel?
What is redis?
What is meant by Laravel - Hashing ?
What is meant by Laravel - Ajax ?
Who are Manually Authenticating Users in Laravel ?
What is with() in laravel?
What is Laravel - Middleware ?
How to serve sites with tls on valet?