diff --git a/app/Http/Controllers/ClientPortal/PaymentMethodController.php b/app/Http/Controllers/ClientPortal/PaymentMethodController.php new file mode 100644 index 000000000000..ae556d59d058 --- /dev/null +++ b/app/Http/Controllers/ClientPortal/PaymentMethodController.php @@ -0,0 +1,95 @@ + ['card' => 'images/credit_cards/Test-Visa-Icon.png', 'text' => 'Visa'], + 2 => ['card' => 'images/credit_cards/Test-MasterCard-Icon.png', 'text' => 'Master Card'], + 4 => ['card' => 'images/credit_cards/Test-AmericanExpress-Icon.png', 'text' => 'American Express'], + 8 => ['card' => 'images/credit_cards/Test-Diners-Icon.png', 'text' => 'Diners'], + 16 => ['card' => 'images/credit_cards/Test-Discover-Icon.png', 'text' => 'Discover'], + ]; + + public function company() + { + return $this->belongsTo(Company::class); + } +} diff --git a/app/Models/Presenters/ClientPresenter.php b/app/Models/Presenters/ClientPresenter.php index 78e6b7d9c19c..bc5055a5dac0 100644 --- a/app/Models/Presenters/ClientPresenter.php +++ b/app/Models/Presenters/ClientPresenter.php @@ -47,38 +47,6 @@ class ClientPresenter extends EntityPresenter return $str; } - public function getCityState() - { - $client = $this->entity; - $swap = $client->country && $client->country->swap_postal_code; - $city = e($client->city); - $state = e($client->state); - $postalCode = e($client->postal_code); - - if ($city || $state || $postalCode) { - return $this->cityStateZip($city, $state, $postalCode, $swap); - } else { - return false; - } - } - - public function cityStateZip($city, $state, $postalCode, $swap) - { - $str = $city; - - if ($state) { - if ($str) { - $str .= ', '; - } - $str .= $state; - } - - if ($swap) { - return $postalCode . ' ' . $str; - } else { - return $str . ' ' . $postalCode; - } - } } diff --git a/routes/client.php b/routes/client.php index ba4a7a11edc3..013762e61e43 100644 --- a/routes/client.php +++ b/routes/client.php @@ -23,12 +23,13 @@ Route::group(['middleware' => ['auth:contact'], 'prefix' => 'client', 'as' => 'c Route::get('payments', 'ClientPortal\PaymentController@index')->name('payments.index'); - Route::get('profile/{client_contact}/edit', 'ClientPortal\ProfileController@edit')->name('profile.edit'); Route::put('profile/{client_contact}/edit', 'ClientPortal\ProfileController@update')->name('profile.update'); Route::put('profile/{client_contact}/edit_client', 'ClientPortal\ProfileController@updateClient')->name('profile.edit_client'); Route::put('profile/{client_contact}/localization', 'ClientPortal\ProfileController@updateClientLocalization')->name('profile.edit_localization'); + Route::resource('payment_methods', 'ClientPortal\PaymentMethodController');// name = (payment_methods. index / create / show / update / destroy / edit + Route::post('document', 'ClientPortal\DocumentController@store')->name('document.store'); Route::delete('document', 'ClientPortal\DocumentController@destroy')->name('document.destroy');