/** * 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; }
/** * Get all clients ordered by client name * * @return Client */ public function orderByName() { return Client::orderBy('client_name')->get(); }