/**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $manufacturer = Manufacturer::find($id);
     if ($manufacturer) {
         if (!$manufacturer->vehicles()->count()) {
             $manufacturer->delete();
             return response()->json(['message' => 'Manufacturer deleted'], 201);
         } else {
             return response()->json(['error' => 'This manufacturer has associated vehicles, delete these first'], 422);
         }
     } else {
         return response()->json(['error' => 'This manufacturer does not exist'], 422);
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param $idManufacturer
  * @param $idVehicle
  * @return \Illuminate\Http\Response
  */
 public function destroy($idManufacturer, $idVehicle)
 {
     $vehicle = Manufacturer::find($idManufacturer)->vehicles()->find($idVehicle);
     if ($vehicle) {
         $vehicle->delete();
         return response()->json(['message' => 'Vehicle deleted'], 201);
     } else {
         return response()->json(['error' => 'This vehicle does not exist'], 422);
     }
 }