jeudi 17 mars 2016

Using a dynamic variable as the name of a model

How would I go about calling a model using a dynamic variable? I thought $nameOfModel::all() would work. How do I go about doing this? I have 4 different tables that need to make use of the same function.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire