Esempio n. 1
0
 public function edit($id, UserRepository $userReposiory, CountryRepository $countryRepository)
 {
     $user = $userReposiory->findUser($id);
     $countries = $countryRepository->getAllCountries();
     $pageTitle = 'Edit a customer';
     return view('users.edit', compact('pageTitle', 'user', 'countries'));
 }
Esempio n. 2
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(UserRepository $repository, Flash $flash)
 {
     $user = $repository->findUser($this->id);
     if ($user->email != $this->data['email']) {
         if ($repository->findUserByEmail($this->data['email'])) {
             $flash->error('Email already exists.');
             return null;
         }
     }
     return $repository->updateUser($this->id, $this->data);
 }