How to pass multiple variables by controller to blade file?



How to pass multiple variables by controller to blade file?..

Answer / sachin-laradev

return view('view-file', compact('var1', 'var2', 'var3'));

NOTE :- variables in compact will be used without $ sign

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

Explain auth.

0 Answers  


What developed the laravel?

0 Answers  


State the difference between get and post method.

0 Answers  


What is eloquent?

0 Answers  


What is routing and how, and what are the different ways to write it?

0 Answers  


What is the difference between laravel and symfony?

0 Answers  


What do you know about facades in laravel? Explain.

0 Answers  


How to set cookies in laravel?

0 Answers  


What is an observer in laravel?

0 Answers  


List the steps to configure laravel application.

0 Answers  


How do I use sub-domain routing?

0 Answers  


Can I use react with laravel?

0 Answers  


Categories