Hi @Tammy,
The create method both instantiates and saves in one call, so it looks like you are doing an extra database query to save the CarImage record.
$car = Car::create($request->all());
$car->save();
$img = CarImage::create(['name'=>$file->getClientOriginalName(), 'car_id' => $car->id]);
that is all you need. these lines are redundant after the create call:
$img->car()->associate($car);
$img->save();
or if you want, you can write it like this:
$car = Car::create($request->all());
$car->save();
$img = new CarImage();
$img->name = $file->getClientOriginalName();
$img->car_id = $car->id; //this is the same as writing $img->car()->associate($car)
$img->save();
Saved you a query! Hope this helps.