I want to use Model functions in view
My controller function code:
$model = Model::find(1);
View::make('view')->withModel($model);
return view('index.search', ['tickets' => $result]);
My model code:
<?php
namespace App;
namespace App\models;
use Illuminate\Database\Eloquent\Model;
class Tickets extends Model
{
public function someFunction() {
echo 'hello world!';
}
}
My view code:
{{ $model->someFunction() }}