laravel sanctum api get auth user if route not auth code example
Example 1: snactum laravel
composer require laravel/sanctum
Example 2: sanctum laravel
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
composer require laravel/sanctum
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"