1 year ago

Register invokable route with ::class

Posted 1 year ago by vnc00


I hoped I could register a invokable route just like this but it isn't working. It would be really great and I would bet I've seen this on twitter days ago, but cannot find the tweet:

Route::get('start-analysis', Reporting\StartAnalysis::class);

So I tried it that way, which is also not working:

Route::get('start-analysis', [Reporting\StartAnalysis::class]);

I don't wanna use a simple string, like:

Route::get('start-analysis', 'StartAnalysis');

Please sign in or create an account to participate in this conversation.