Support the ongoing development of Laravel.io →
Eloquent
Last updated 1 year ago.
0

Either make it a static function or use Laravel's query scopes.

http://laravel.com/docs/5.1/eloquent#query-scopes

Otherwise, you have to create a new instance of the model to call that function.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.