Laravel stops with Non-static method ... cannot be called statically
Your error
Non-static method App\Models\User::getActive() cannot be called statically2 more lines it can showFix it fast
Most common cause, 1 of 3A public method on an Eloquent model is called as User::method()
Turn query helpers into local scopes.
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
#[Scope]
protected function active(Builder $query): void
{
$query->where('active', 1);
}
}
// caller
$users = User::active()->get();Short answer
PHP 8 throws Non-static method X::foo() cannot be called statically when an ordinary method is called with ::. Laravel reroutes static calls through __callStatic only for unreachable methods, so a public model method, the Illuminate\Http\Request class used as a facade, or a plain service class fails. Use #[Scope], import the facade, or inject the class. Laravel 13, PHP 8.3+.
Which cause do you have?
Note the class inside the message, then list the imports of the file named first in the stack trace. An App\Models class points to cause 1, Illuminate\Http\Request to cause 2, and another class of yours to cause 3.
grep -n "^use " app/Http/Controllers/OrderController.phpThen find the line you see in this list and open its fix:
- 1A public method on an Eloquent model is called as User::method()
The class in the message lives under App\Models, and the method is declared public function without static - 2Illuminate\Http\Request is imported, but the code calls it like a facade
The message names Illuminate\Http\Request, and the file has use Illuminate\Http\Request; followed by Request::input() or Request::all() - 3A plain service class is called with ::
The class is one of yours, such as App\Services\ReportService, with no facade behind it, and the caller writes ReportService::build()
What does the error look like?
Non-static method App\Models\User::getActive() cannot be called staticallyNon-static method Illuminate\Http\Request::input() cannot be called staticallyError: Non-static method App\Services\ReportService::build() cannot be called statically
Cause 1 of 3
A public method on an Eloquent model is called as User::method()
You seeThe class in the message lives under App\Models, and the method is declared public function without static
Check
Non-static method App\Models\User::getActive() cannot be called statically means the model method is public and not static. PHP calls __callStatic only for methods that are inaccessible in a static context, and Eloquent's Model::__callStatic is what turns User::something() into a query, so a public instance method never reaches it and PHP raises the Error.
grep -n "public function getActive" app/Models/User.phpFix
Turn query helpers into local scopes. Laravel 13 marks them with the #[Scope] attribute on a protected method, which keeps the method inaccessible from outside so the static call is routed to the query builder.
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
#[Scope]
protected function active(Builder $query): void
{
$query->where('active', 1);
}
}
// caller
$users = User::active()->get();Verify
The scope returns a count instead of throwing the Error.
php artisan tinker --execute="dump(App\Models\User::active()->count());"Confirmed by laravel.com
Cause 2 of 3
Illuminate\Http\Request is imported, but the code calls it like a facade
You seeThe message names Illuminate\Http\Request, and the file has use Illuminate\Http\Request; followed by Request::input() or Request::all()
Check
All Laravel facades sit in the Illuminate\Support\Facades namespace, and the facade reference lists Illuminate\Http\Request as the class the Request facade stands for. With the class imported instead of the facade, Request::input() is a direct static call to an instance method.
grep -rn "Request::" app/ routes/Fix
Keep the class import and let Laravel inject the current request into the controller method, then call methods on that object. Importing Illuminate\Support\Facades\Request also works if you want the static style.
use Illuminate\Http\Request;
class OrderController extends Controller
{
public function store(Request $request)
{
$email = $request->input('email');
// ...
}
}Verify
Posting to the route returns your normal response and the log shows no new Error.
php artisan test --filter=OrderControllerConfirmed by laravel.com
Cause 3 of 3
A plain service class is called with ::
You seeThe class is one of yours, such as App\Services\ReportService, with no facade behind it, and the caller writes ReportService::build()
Check
An ordinary PHP class has no static proxy, so ReportService::build() on a public instance method runs into the PHP 8 rule that calling non-static methods statically throws an Error. Before PHP 8.0 the same call only produced an E_DEPRECATED warning, which is why older code may still contain it.
grep -rn "ReportService::" app/Fix
Inject the service through the constructor or the method and call it on the instance; the service container builds it for you. To keep the static look, import it with the Facades\ prefix as a real-time facade.
// Option 1: injection
public function show(\App\Services\ReportService $reports, string $month)
{
return $reports->build($month);
}
// Option 2: real-time facade
use Facades\App\Services\ReportService;
ReportService::build($month);Verify
The page that called build() renders, and the Error is gone from the log.
php artisan test --filter=ReportConfirmed by php.net
How do I stop it coming back?
- Write every reusable query condition as a #[Scope] method, so model helpers never need to be public instance methods called with ::.
- When the editor auto-imports Request, check which one it picked: only Illuminate\Support\Facades\Request supports static calls.
- In controllers, type-hint Illuminate\Http\Request instead of importing it and calling it statically.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: Spotless Laundry, EZ Estimater.