Answer the question
In order to leave comments, you need to log in
How to add code blocks in Laravel?
Hello!
I'm learning Laravel recently, I used to write just in PHP.
The question is the following.
I use "Blocks" on the site. I create these blocks using PHP. (weather, anecdote of the hour, holiday)
I understand that it is not good to use such a block with php code inside the main template (layout.blade.php).
Enter such a block in the controller, but the blocks are the same, and there are several controllers.
Where in Laravel is it correct to place this php code and how to pass it to the blade.php template?
I hope I was able to describe the question correctly.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question