andrewber
andrewber copied to clipboard
`driver_id` should be `$request->user()->driver->id` in `TripController` `accept` method
Hi there, I think that this line https://github.com/aschmelyun/andrewber/blob/8b78fb0de628fa82254daa772989e0fd1c1fbad1/src/backend/app/Http/Controllers/TripController.php#L58
should be 'driver_id' => $request->user()->driver->id,
to reference the relation with the Driver
model in Trip
model.
Now when a driver accept the ride is saved the User
model id
and the $trip->load('driver.user');
can't be triggered.
Am I missing something?
Thank you in advance
Yes, I just came to post this issue and found there is already one.
In the accept method, it should be $request->user()->driver->id not the user id.
absolutely right, I've paused the video and came here for the same reason.