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

  • 8390
  • Created Dec 2016
  • Updated Dec 2025

Files in this example

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

bytefury/crater

  • 8224
  • 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 Dec 2025

Files in this example

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

driesvints/driesvints.com

  • 74
  • Created May 2020
  • Updated Dec 2025

Files in this example

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

Gummibeer/gummibeer.de

  • 11
  • Created May 2020
  • Updated Oct 2025

Files in this example

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

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.