Example of Invokable controllers in christophrumpel/larastreamers

File app/Http/Controllers/PageHomeController.php (link to Github)
use App\Actions\PrepareStreams;
use App\Models\Stream;
use Illuminate\Contracts\View\View;

class PageHomeController extends Controller
{
    public function __invoke(PrepareStreams $prepareStreams): View
    {
        return view('pages.home', [
            'streamsByDate' => $prepareStreams->handle(Stream::approved()->upcoming()->get()),
        ]);
    }
}
File routes/web.php (link to Github)
use Illuminate\Support\Facades\Route;

Route::get('/', PageHomeController::class)
    ->name('home');

Additional resources on Invokable controllers: