Route error

Published 1 year ago by csbonito

Hello I'm new to Laravel and I already got a Tiny problem

When Im declaring my route:

Route::get('statisticB', [ 'uses' => '[email protected]', 'as' => 'DocMatri' ]);

and I list the routes a I have (php Artisan route:list)

I get the next error:

[Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected 'list' (T_LIST)

I run php Artisan route:list -v and get the same error.

Any ideas whats going on?

Thank you

Best Answer (As Selected By csbonito)
Snapey

have a look in the Laravel log for the class and line of the error

mdecooman
Route::get('statisticB', [
    'as' => 'DocMatri', 'uses' => '[email protected]'
]);

But in version 5.4, uses this one instead (easier to read)

Route::get('statisticB', '[email protected]')->name('DocMatri');
csbonito

Thanks for the quick replay

yes I´m using version 5.4

I did the change but I get the same error

bestmomo
bestmomo
1 year ago (356,570 XP)

Hello,

Which PHP version do you use ?

csbonito

version 5.6.25

When I delete that route I have no problem

Snapey
Snapey
1 year ago (1,036,815 XP)

have a look in the Laravel log for the class and line of the error

csbonito

Well manage to solve the problem checking in the log file.

Thank you very much

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