Hi everybody, I want to instantiate a laravel model given a string as reference, that is I have a string variable $model with value "User", I want to do something like:
$userInstance = new $model();
Or similar, how can I do this?
Please sign in or create an account to participate in this conversation.
There's no shortage of content at Laracasts. In fact, you could watch nonstop
for days upon days, and still not see everything!