xxxxxxxxxx
php artisan passport:client --personal
And change PASSPORT_PERSONAL_ACCESS_CLIENT_ID, PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET
in .env file
xxxxxxxxxx
$booking->user_id = auth()->user()->id;//not working
1. auth('api')->user(); //if u are using api guard ...(web guard)
2. $request->user('api'); //by reqeust class
3. Auth::guard('api')->user() //using Auth facade
Route::middleware(['auth:api'])->put('/booking','BookingsController@store');
use Illuminate\Support\Facades\Auth
$booking->user_id = Auth::user()->id;
xxxxxxxxxx
$request->user('api'); or auth('api')->user(); or auth()->user(); or auth('api')->user();