I have to many relations in my API where the user can pass on the URL like this &relation&relation2&relation3
, in my controller I test if this relation is been called in the URL and call a method like withRelation
, withRelation2
, etc..
How can I create a main method called with($relation)
and if I call withRelation
it transforms into with('relation')
?
Actual Examples:
withProducts
should transform into with('products')
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire