Support the ongoing development of Laravel.io →
posted 5 years ago
Last updated 2 years ago.
0

Hi, Can I see your view Page ?

0

are you returning to view()?

$myModel = Convert::find(1);

return view('test', compact(
			'myModel ',
		));
	}

in blade

{{$myModel->pressure()}}

might work?

0

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)

Last updated 5 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

kgp43 kgp43 Joined 2 Nov 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.