Laravel- Call function of a Model in a blade file

May 4, 2020

You have a category.blade.php blade file and you want to call a function name someFunc() inside the Category model

Here you pass the instance of the model to the view

$model = Category::find(1);
View::make('category')->withModel($model);

Inside your category.blade.php blade file you can call the function

{{$model->someFunc()}}