You don't need to define the onlyActive
and onlyOwner
functions as static. Remove the static
keyword from the function definition and that'll solve the problem.
The static calls you often see are actually done via the Facades (http://laravel.com/docs/facades) - so, that's likely why you're thinking you need to define functions as static.
Hello and thank you for quick reply, I have tried that already here is error provided to me
Non-static method User::onlyOwner() should not be called statically, assuming $this from incompatible context
and the line that is causing this
$users = User::onlyOwner( $id )->onlyActive()->sortable()->paginate(10);
Yes I figured out (myself, you "approved"). Thanks.
The big problem with Laravel that I can not stand is no one is "telling me" where (in what file) to put what, where should be all my scopes stored? where should I save facades etc...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community