Skip to main content

Admin Endpoint: Create Tours

Premium
4:43
Demchyshyn Ivan avatar

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?

Demchyshyn Ivan avatar

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

Povilas Korop avatar

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.

Demchyshyn Ivan avatar

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.

Povilas Korop avatar

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.

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.