i created a login system with Laravel & sentinel. after that i just test api in Laravel with this code to obtain some data about the current logged in user using this code in api.php. but i had an error message when i test it " The use statement with non-compound name 'Sentinel' has no effect"
<?php
use Illuminate\Http\Request;
use Sentinel;
Route::get('/test', function(){
if(Sentinel::check()) {
return response()->json([
'loggedUser' => [
'firstname' => Sentinel::getUser()->first_name,
'lastname' => Sentinel::getUser()->last_name
]
]); }else {
return null;
}
}
);