beginnerLaravel
What is a single-action or invokable controller?
Answer
Clear, interview-ready explanation
A single-action, or invokable, controller is a controller class with one public __invoke method. It represents one focused endpoint or use case instead of grouping multiple related actions in the same class.
Laravel registers it by passing the controller class directly to the route, for example Route::post('/reports', GenerateReportController::class). This style is useful for actions such as exporting a report, processing a webhook, or provisioning a server, where a dedicated class makes the responsibility and dependencies clear.