Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Admin Endpoint: Create Tours

Premium
4:43

Comments & Discussion

DI
Demchyshyn Ivan ✓ Link copied!

Hello, Povilas! When creating a tour i get an error: "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'travel_id' cannot be null I thought i'm doing something wrong for comparison i downloaded your code from github for comparison and it gives the same error. What might be the problem?

DI
Demchyshyn Ivan ✓ Link copied!

sorry after after some fixes in docker your code worked correctly but i still have this weird error

PK
Povilas Korop ✓ Link copied!

Travel_id cannot be null means you didn't pass travel_id? Please post the full request what parameters you passed, then I could maybe advise.

DI
Demchyshyn Ivan ✓ Link copied!

After dd(), the request contains all the fields that I enter in postman ({ "name": "New tour", "starting_date": "2023-07-18", "ending_date": "2023-07-19", "price": "250.00"} ), as I try to display the data with the help of dd, it is from travel, I do not receive any useful information. I understand that the route localhost/api/v1/admin/travels/{travel}/tours does not work correctly.

PK
Povilas Korop ✓ Link copied!

Sorry from the information you give me here, I don't see why it's not working for you, your case needs personal debugging, which I don't have time for, unfortunately. Please fully compare your code to mine and your requests to my requests in the course. No one else complained that it didn't work.