use model from variable laravel

Solutions on MaxInterview for use model from variable laravel by the best coders in the world

showing results for - "use model from variable laravel"
Emi
19 May 2019
1$model_name = 'App\Model\User';
2$model_name::where('id', $id)->first();
3
4$model = $this->model_name;
5$model::where('id', $id)->first();