Problem when try access route that need token with my spa, show me "Route [login] not defined.", but needs show unautorized status.
| Q | A
| ----------------- | ---
| Bug? | no
| New Feature? | no
| Framework | Laravel
| Framework version | 5.7
| Package version | 1.0.0-rc.2
| PHP version | 7.2
Try name Your route Route::post('login', 'AuthController@login')->name('login');
But it's on api, the right way it's return {message: unathenticated} throught rest.
@richellyitalo
you should check line 216 in file "vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php"
you could put Accept: application/json in your request header
Thanks, @john-xu .
After check that and run php artisan make:auth it's works.
Thanks guys and have a nice day!
Most helpful comment
@richellyitalo
you should check line 216 in file "vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php"
you could put Accept: application/json in your request header