are you returning to view()?
$myModel = Convert::find(1);
return view('test', compact(
'myModel ',
));
}
in blade
{{$myModel->pressure()}}
might work?
My function does not interact with my database, so it does not belong in my model, right? Think thats why I can't get it to work. Moving it to a helper file would be a better option?
The function is a simple converter. It converts Bar into Pa, Mpa, Psi etc.
Update: Created a helper file and added it to composer, works nice it seems. (App/helpers/Converter.php)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community