public function edit($idPart)
 {
     $part = $this->partRepo->find($idPart);
     $part = $this->partRepo->getInputs($part);
     $this->helper->validateRecord($part);
     $vehicle_id = VehicleRepositoryEloquent::getVehicles(true);
     $vendor_id = ContactRepositoryEloquent::getContacts('vendor', true);
     $part_type_id = TypeRepositoryEloquent::getTypes('part');
     $part_model_id = ModelRepositoryEloquent::getModels('part', array_keys($part_type_id->toArray())[0]);
     $part_id = self::getParts($idPart, true);
     $typedialog = TypeRepositoryEloquent::getDialogStoreOptions('part');
     $modeldialog = ModelRepositoryEloquent::getDialogStoreOptions('part');
     $modeldialog['model_type_id'] = $part->part_type_id;
     $attributes = [];
     if (config('app.attributes_api_url') != null) {
         $attributes = AttributeRepositoryEloquent::getAttributesWithValues('part.' . $part->partType->name, $idPart);
     }
     $sensor_data = $filters = null;
     if ($part->partType->name == Lang::get('setup.sensor')) {
         $filters = $this->helper->getFilters($this->request->all(), $this->tireSensorRepo->getFields(), $this->request);
         $filters['id'] = $part->id;
         $filters['sort'] = 'created_at';
         $filters['order'] = 'desc';
         $sensor_data = $this->tireSensorRepo->results($filters);
     }
     return view("part.edit", compact('part', 'vehicle_id', 'vendor_id', 'part_type_id', 'part_model_id', 'part_id', 'sensor_data', 'filters', 'attributes', 'modeldialog', 'typedialog'));
 }
 public function edit($idModel)
 {
     $model = $this->modelRepo->find($idModel);
     $this->helper->validateRecord($model);
     $company_id = CompanyRepositoryEloquent::getCompanies();
     $model_type_id = TypeRepositoryEloquent::getTypes();
     $vendor_id = ContactRepositoryEloquent::getContacts();
     return view("model.edit", compact('model', 'model_type_id', 'company_id', 'vendor_id'));
 }
 public function edit($idCompany)
 {
     $company = $this->companyRepo->find($idCompany);
     $company->company_id = $company->id;
     $this->helper->validateRecord($company);
     $contact = $this->contactRepo->find($company['contact_id']);
     $this->helper->validateRecord($contact);
     $contact_id = ContactRepositoryEloquent::getContacts();
     return view("company.edit", compact('company', 'contact', 'contact_id'));
 }
 public function edit($idUser)
 {
     $user = $this->userRepo->find($idUser);
     $this->helper->validateRecord($user);
     $role = $user->getRoles()[0];
     $user->role_id = Role::where('slug', $role)->first()->id;
     $contact = $this->contactRepo->find($user['contact_id']);
     $this->helper->validateRecord($contact);
     $role = $this->helper->getAvailableRoles();
     $language = $user->getAvailableLanguages();
     $companies = CompanyRepositoryEloquent::getCompanies();
     $contacts = ContactRepositoryEloquent::getContacts();
     return view("user.edit", compact('user', 'contact', 'role', 'language', 'companies', 'contacts'));
 }
 public function edit($idTrip)
 {
     $trip = $this->tripRepo->find($idTrip);
     $trip = $this->tripRepo->getInputs($trip);
     $this->helper->validateRecord($trip);
     $company_id = CompanyRepositoryEloquent::getCompanies();
     $vehicle_id = VehicleRepositoryEloquent::getVehicles();
     $driver_id = ContactRepositoryEloquent::getContacts('driver');
     $vendor_id = ContactRepositoryEloquent::getContacts('vendor', true);
     $trip_type_id = TypeRepositoryEloquent::getTypes('trip');
     $fuel_type = TypeRepositoryEloquent::getTypes('fuel');
     $typedialog = TypeRepositoryEloquent::getDialogStoreOptions('trip');
     $attributes = [];
     if (config('app.attributes_api_url') != null) {
         $attributes = AttributeRepositoryEloquent::getAttributesWithValues('trip.' . $trip->type->name, $idTrip);
     }
     return view("trip.edit", compact('trip', 'driver_id', 'vendor_id', 'company_id', 'vehicle_id', 'trip_type_id', 'fuel_type', 'attributes', 'typedialog'));
 }
 public function edit($idEntry)
 {
     $entry = $this->entryRepo->find($idEntry);
     $entry = $this->entryRepo->getInputs($entry);
     $this->helper->validateRecord($entry);
     $company_id = CompanyRepositoryEloquent::getCompanies();
     $entry_type_id = TypeRepositoryEloquent::getTypes('entry');
     $vendor_id = ContactRepositoryEloquent::getContacts('vendor', true);
     $vehicle_id = VehicleRepositoryEloquent::getVehicles();
     $parts = PartRepositoryEloquent::getPartsByVehicle($entry->vehicle_id);
     $entry_parts = [];
     $typedialog = TypeRepositoryEloquent::getDialogStoreOptions('entry');
     foreach ($entry->partsEntries->toArray() as $entryPart) {
         $entry_parts[] = $entryPart['part_id'];
     }
     $attributes = [];
     if (config('app.attributes_api_url') != null) {
         $attributes = AttributeRepositoryEloquent::getAttributesWithValues('entry.' . $entry->type->name, $idEntry);
     }
     return view("entry.edit", compact('entry', 'entry_type_id', 'company_id', 'vehicle_id', 'vendor_id', 'parts', 'entry_parts', 'attributes', 'typedialog'));
 }
 public static function getDialogStoreOptions($entity_key = null)
 {
     $options['entity_key'] = $entity_key;
     $options['model_types'] = TypeRepositoryEloquent::getTypes();
     $options['vendors'] = ContactRepositoryEloquent::getContacts();
     return $options;
 }