/** * Restore the specified resource from storage. * RESTORE /clients/{clientID} * * @param String $clientID * @return Redirect */ public function restore($clientID) { $client_name = $this->clients->getClientByAssignedId($clientID)->client_name; $restoreClient = $this->execute(new RestoreClientCommand($clientID)); if ($restoreClient) { Flash::success('Account of ' . $client_name . ' client has been successfully restored!'); } else { Flash::success('Failed to restore account of ' . $client_name . ' client!'); } return Redirect::route('clients.index'); }
/** * Handles the command. * * @param RemoveClientCommand $command * @return Client */ public function handle($command) { $clientRemove = $this->clientRepository->remove($command->client_id); return $clientRemove; }
/** * Handle the command * * @param AddClientCommand $command * @return Client */ public function handle($command) { $client = Client::register($command->client_id, $command->client_name, $command->address, $command->cp_first_name, $command->cp_middle_name, $command->cp_last_name, $command->email, $command->mobile, $command->telephone); $this->clientRepository->save($client); return $client; }