Laravel Request::all() Should Not Be Called Statically

Laravel Request::all() Should Not Be Called Statically

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Laravel Request::all() Should Not Be Called Statically

Encountering the error "Non-static method Illuminate\Http\Request::all() should not be called statically" usually signals a fundamental misunderstanding of how dependency injection works within the modern Laravel application stack. This specific exception occurs when you attempt to access the Request object using static syntax, such as $input = Request::all();, inside a controller method like store().

The root cause lies in how Laravel's service container resolves bindings. The Illuminate\Http\Request class is bound to the global application instance in the container. When you invoke Request::class, you are bypassing the container and treating the object as if it were an independent utility function rather than a stateful context object. While this pattern might have been acceptable in older versions of the framework or specific legacy contexts, modern Laravel architecture explicitly discourages static access to request data within controllers.

To resolve this error, you must rely on the implicit binding provided by the controller mechanism. In standard Laravel applications using the default service provider configuration, the Request instance is automatically injected into your controller methods. You can retrieve it directly as a property of the class without any explicit declaration in the method signature:

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Route;

class StoreController extends Controller
{
    public function store(Request $request)
    {
        // Accessing the request instance directly avoids static calls
        $input = $request->all(); 
        
        // Or even better, use property access for specific data
        $name = $request->name;
        
        // Process the input...
        return redirect('/success');
    }
}

This approach leverages Laravel's implicit binding feature. When you define a method parameter as Request $request, the framework automatically resolves the global request instance from the container and passes it to that argument. This ensures you are always working with the current HTTP context, whether the request came via an API, a form submission, or a CLI command (if configured).

Attempting to call Request::all() statically fails because the class does not define a public static method named all. The all() method is intended to be called on the instance of the request object that represents the current user's interaction. By calling it statically, you are essentially asking Laravel to guess which request object you want, leading to the "incompatible context" error message seen in the source material.

There are scenarios where static access might seem convenient, but they often introduce subtle bugs. For instance, if you rely on static calls for validation or file uploads within a controller, you risk mixing global state expectations with specific request data. The framework encourages explicit dependency injection to make these dependencies clear and testable. If you need to pass the request object to another class, injecting it ensures that class has access to the correct context without needing to rely on static globals.

While some developers might look for workarounds involving app()->make(Request::class), this is generally unnecessary in standard controllers where implicit binding suffices. Implicit binding keeps your code clean and aligns with Laravel's philosophy of keeping controllers thin and focused on business logic rather than plumbing.

If you are migrating from a legacy application or following outdated tutorials that suggest static access, updating your code to use the injected $request parameter is the most robust solution. It eliminates the error and adheres to current best practices for building scalable Laravel applications. For further guidance on controller patterns and request handling in modern versions of the framework, resources like https://laravelcompany.com provide valuable insights into maintaining secure and efficient web applications.

Our network