Skip to main content

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

Read more here

Firstly for a user to be able to order parking in a particular zone they must be able to add their owned vehicles. In this lesson, we will start to implement our first CRUD. When a user is registered or logged in he will be redirected to the vehicles.index page. Yet we have only a placeholder for the vehicles list because we do not have any vehicles stored and need to create some first.

Add vehicle

And the form to add a vehicle will look like this. After pressing the Save vehicle form is submitted to the server and then redirected back to the list. Pressing the Cancel redirect will immediately disregard the form without submitting it.

Add vehicle

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

OK
Oleksandr Kravchenko ✓ Link copied!

I think using a router inside a store is quite bad practice. Actions is place only for business logic. What if you add a new way to add vehicles like a popup on "vehicle.index"

ZA
Zain Amin ✓ Link copied!

I think you haven't added a description in the vehicles table (https://laraveldaily.com/lesson/build-laravel-api-step-by-step/manage-vehicles), but no problem, I can add it.

CM
Chris McGee ✓ Link copied!

I ran into the same problem. As you noted, super-easy to add.

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.