Skip to main content

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

Read more here

In this lesson, we will incorporate an edit form into the vehicle's CRUD operation. This form will be similar to the create form, except it will have a different URL /vehicles/:id/edit. The data of a specific vehicle will be retrieved from the API using the :id URL parameter.

Update vehicle

  1. Update the src/hooks/useVehicle.jsx hook with the following content...

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

M
Márlon ✓ Link copied!

Hello, Just out of curiosity, why not use just one component to add or edit a vehicle?

PK
Povilas Korop ✓ Link copied!

Personal preference of separating them, if the logic of create and edit becomes different (it usually does).

J
jwinder ✓ Link copied!

From the Laravel API Lesson in connection with this:

description wasnt added to $fillable for Vehicle Model if im not mistaken. It also needs to be added to the VehicleResource

A
augusto-dmh ✓ Link copied!

i don't even remember being added to the database, so i'm just ignoring it rather than updating the API.

The only change i made was validating 'remember_me' field in login logic.