[Vuejs]-Invalid Route Action When Routing invokable class

-1👍

Add RegisterController function

     Route::group([
    'prefix' => 'auth',
    'namespace' => 'Auth'
], function(){
    Route::post('register', 'RegisterController@store');
});

-1👍

You are missing a parameter in your post function from Route.

You want something like

Route::post('route_name', 'Controller@myFunction')

Or in your case:

Route::post('register', 'RegisterController@registerFunctionName');

Other variation per 9.x documentation:

Route::post('register',  [RegisterController::class, 'registerFunctionName']);

Please refer to:
https://laravel.com/docs/9.x/routing

-2👍

This is an invokable controller yes?

you need to just alter the syntax

Route::group([
    'prefix' => 'auth',
    'namespace' => 'Auth'
], function(){
    Route::post('register', [RegisterController::class]);
});

and then import the class at the top of your routes file and make sure you have a single public method of __invoke() in your controller.

Leave a comment