I have a project where i have a decent amount of Eloquent Models, on most of the pages I need to use multiple models and their functions to build the page correctly.
I am used to this syntax:
use App\CustomFolder\CustomModel;
CustomModel::all(); // or whatever function / data I need
Though as said I have about 27 Models now and I need multiple ones on every page. So I created a blade layout (master page) where I link all these models, but now it seems these Models can't be called from the view itself.
So how can I either:
- Make these Models globally available (preferred)
- Make it so the models that I call (
use Model;
) in the layout are also available from my view.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire