/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($publicId)
 {
     $client = Client::withTrashed()->scope($publicId)->with('contacts', 'size', 'industry')->firstOrFail();
     Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT);
     $actionLinks = [[trans('texts.create_invoice'), URL::to('invoices/create/' . $client->public_id)], [trans('texts.enter_payment'), URL::to('payments/create/' . $client->public_id)], [trans('texts.enter_credit'), URL::to('credits/create/' . $client->public_id)]];
     if (Utils::isPro()) {
         array_unshift($actionLinks, [trans('texts.create_quote'), URL::to('quotes/create/' . $client->public_id)]);
     }
     $data = array('actionLinks' => $actionLinks, 'showBreadcrumbs' => false, 'client' => $client, 'credit' => $client->getTotalCredit(), 'title' => trans('texts.view_client'), 'hasRecurringInvoices' => Invoice::scope()->where('is_recurring', '=', true)->whereClientId($client->id)->count() > 0);
     return View::make('clients.show', $data);
 }
 /**
  * Force remove the specified client from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function delete($id)
 {
     Client::withTrashed()->where('id', $id)->forceDelete();
     return Redirect::route('clients.index');
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($publicId)
 {
     $client = Client::withTrashed()->scope($publicId)->with('contacts', 'industry')->firstOrFail();
     Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT);
     $monday = '';
     $tuesday = '';
     $wednesday = '';
     $thursday = '';
     $friday = '';
     $saturday = '';
     $sunday = '';
     $frecuency = strstr($client->custom_value1, '1');
     if ($frecuency != false) {
         $monday = 'Lun, ';
     }
     $frecuency = strstr($client->custom_value1, '2');
     if ($frecuency != false) {
         $tuesday = 'Mar, ';
     }
     $frecuency = strstr($client->custom_value1, '3');
     if ($frecuency != false) {
         $wednesday = 'Mié, ';
     }
     $frecuency = strstr($client->custom_value1, '4');
     if ($frecuency != false) {
         $thursday = 'Jue, ';
     }
     $frecuency = strstr($client->custom_value1, '5');
     if ($frecuency != false) {
         $friday = 'Vie, ';
     }
     $frecuency = strstr($client->custom_value1, '6');
     if ($frecuency != false) {
         $saturday = 'Sáb, ';
     }
     $frecuency = strstr($client->custom_value1, '7');
     if ($frecuency != false) {
         $sunday = 'Dom, ';
     }
     $client->custom_value1 = $monday . $tuesday . $wednesday . $thursday . $friday . $saturday . $sunday;
     $actionLinks = [[trans('texts.create_invoice'), URL::to('invoices/create/' . $client->public_id)]];
     $data = array('actionLinks' => $actionLinks, 'showBreadcrumbs' => false, 'client' => $client, 'title' => trans('texts.view_client'), 'hasRecurringInvoices' => Invoice::scope()->where('is_recurring', '=', true)->whereClientId($client->id)->count() > 0);
     return View::make('clients.show', $data);
 }