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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community