You can do that with static methods, can't you?
$projectModel = 'App\Project';
$project = $projectModel::find($id);
If not, you can probably do something like this:
$projectModel = 'App\Project';
$project = (new $projectModel)->find(1);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community