Closed Sjos12 closed 1 year ago
Can you share the full stack trace and a more complete example route definition? E.g. if you're importing the controller class or adding any middleware to the route. It doesn't look like that error is coming from your routes file.
This doesn't look related to Ziggy. Feel free to comment again if you can share more information or reproduce this in a fresh app.
Ziggy version
v1.5.0
Laravel version
v9.0
Description
We are working on a large scale application that has recently upgraded to Laravel 8.0. The application makes use of both the old (string) and new (array) syntax in different parts in the app for defining routes.
new
Route::get('/example', [ExampleController::class, 'exampleMethod']);
and
old
Route::get('/example', 'ExampleController@exampleMethod');
However Ziggy doesn't seem to support using both the old and the new syntax at the same time. Only allowing the old syntax where a route is defined via a string. The following error is thrown while generating the route file for the new syntax:
To try and workaround this issue I thought I might define a filter array under config/ziggy.php to only allow generation for route definitions using the old syntax. But after looking at the Ziggy source code it seems that ziggy is still retrieving and processing routes that are excluded under config/ziggy.php.
Any help is much appreciated.
Ziggy call and context
Ziggy configuration
Route definition