Skip to main content

Code Examples of invokable controllers

Discover how to use Laravel's invokable controllers method in real-world applications. Browse 5 examples from popular open-source projects.

5 examples
These are also called "Single Action Controllers", where you have only one method __invoke() inside, and you attach the Route to the Controller:
Route::post('/server', ProvisionServer::class);
Read more in the official Laravel docs.

pterodactyl/panel

  • 8951
  • Created Dec 2016
  • Updated Jun 2026

Files in this example

  • app/Http/Controllers/Admin/Nodes/SystemInformationController.php
    • routes/admin.php
View full example

bytefury/crater

  • 8295
  • Created Nov 2019
  • Updated Aug 2024

Files in this example

  • routes/web.php
    • app/Http/Controllers/V1/Invoice/InvoicePdfController.php
View full example

christophrumpel/larastreamers

  • 238
  • Created May 2021
  • Updated Mar 2026

Files in this example

  • app/Http/Controllers/PageHomeController.php
    • routes/web.php
View full example

driesvints/driesvints.com

  • 73
  • Created May 2020
  • Updated Jun 2026

Files in this example

  • app/Http/Controllers/PostController.php
    • routes/web.php
View full example

Gummibeer/gummibeer.de

  • 11
  • Created May 2020
  • Updated Apr 2026

Files in this example

  • app/Http/Controllers/Blog/IndexController.php
    • routes/web.php
View full example