emamul.andalib's avatar

Function () does not exist

When I am submitting a form, my laravel application is showing this bunch of errors.

ReflectionException in Route.php line 152: Function () does not exist

Please help me to resolve the issue. Thank you.

0 likes
6 replies
bimalshah72's avatar
Level 6

@emamul-andalib

Are you using middleware in the route?

If yes, check you might forgot 'uses' key? ..e.g.

Route::get('foo/bar/{id}', ['middleware'=>'auth', 'uses'=>'FooController@show']);
9 likes
Robstar's avatar

As this page ranks in highly in Google I also got the same error due to an incorrect route definition of an invokable controller.

$r->get('{id}/verify-email', [PurchaseOrders\AnalysisController::class])

caused the error. Removing the wrapping array resolved the issue:

$r->get('{id}/verify-email', PurchaseOrders\AnalysisController::class)
15 likes
musheabdulhakim's avatar

Sometimes this happens when you don't specify the controller method of a route.

2 likes

Please or to participate in this conversation.