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

You need to create an instance of the User model first, otherwise it thinks you want to search (query) your Users. which is why you're getting an error from the query builder.

$user = new User();
echo $user->exampleOne();

This was asked and answered earlier today: http://laravel.io/forum/02-25-2014-custom-methods

Last updated 2 years ago.
0

Thanks for you reply Andrew,

I've actually tried that before, I've also tried changing the function name but it leads me nowhere. I checked the IRC and seems like I've got double class name. But where's the other one.

Last updated 2 years ago.
0

Seems I got it resolved. Turns out I've got double class names

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ninjakid ninjakid Joined 26 Feb 2014

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.