We're finally at the point when we can make bookings, yay.
Goals of This Lesson
- Booking DB Model/Migration
- API endpoint & first successful booking
- Calculating the total price of booking
- Validation: apartment capacity and availability
- Viewing and canceling user's bookings
As usual, covered by tests, so by the end of this lesson, we will have these tests passing:

Booking DB Model/Migration
First, the database structure for that...
In (Show) method in (BookingController):
Are you sure can show the result with trashed when we used Model Binding?
Becouse the method return 404, so the test (test_user_can_cancel_their_booking_but_still_view_it) will fail.
I think we need used query in (Show) method
Not 100% sure actually, but in the repository that test didn't fail. Could you compare to the repository, please?
Yes I compare to repository, still (test_user_can_cancel_their_booking_but_still_view_it) fail.
In these lines assert status 200 but in my test return 404, so the test fail
Just cloned the last version of the repo, and that test passes for me: ✓ user can cancel their booking but still view it
That said, found that another test is failing after my last new lesson, so thanks for reminding me to rerun
php artisan test, need to update another lesson :)Thanks for you, This course is the most course I found it for me, It contains more than learning how to build project.
Any fix for this ?
Yes, I organized the messages in json format like this. app/Exception/Handler.php