'A lot of data that need to be continuously passed to the view
I'm currently building a community with Laravel.
In my project, All view files extends layouts.master.
By default, 8 pieces of data are received from layouts.master.
It's really hard to copy-paste the same operation in the model every time i write new logic and create a method on the controller.
It's getting harder to focus on the essentials.
Is there any way to solve it?
Solution 1:[1]
When you copy and paste the same code over and over again, you are totally go in the wrong direction.
If you always use the same code over and over again just create a method for that one, or maybe a library where you can get call the same code over and over again in a lot of different location
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Fendy Harianto |
