What I want to set up in .routesweb.php
is something like
Route::resource('/main', CallController::class);
So, if user goes to www.sitename.com/
, the index of CallController
should be executed and displayed. However, if I try to compile that with npx vite build
, I am invariably met with an error of such type:
Expected identifier but found ":"
216 | * @route '/{}'
217 | */
218 | export const show = (args: { : string | number } | [param: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
| ^
219 | url: show.url(args, options),
220 | method: 'get',
The error only seems to go away, if some other path other that /
is being assigned to as the path for the CallController
‘s index.
The only workaround that I have found is to set the resource route as /calls
and redirect from it from `/’:
Route::get('/', function () {
return redirect('/main');
})->name('home');
But I wonder, whether it is the intended behaviour and if it is possible to use /
as a route for a resource/controller?