2019-07-16 04:38:11 +02:00
< ? php
2020-03-23 18:10:42 +01:00
use Illuminate\Support\Facades\Route ;
2021-05-27 01:14:21 +02:00
Route :: get ( 'client' , 'Auth\ContactLoginController@showLoginForm' ) -> name ( 'client.catchall' ) -> middleware ([ 'domain_db' , 'contact_account' , 'locale' ]); //catch all
2019-08-05 00:17:46 +02:00
2021-05-27 01:14:21 +02:00
Route :: get ( 'client/login' , 'Auth\ContactLoginController@showLoginForm' ) -> name ( 'client.login' ) -> middleware ([ 'domain_db' , 'contact_account' , 'locale' ]);
2019-07-16 04:38:11 +02:00
Route :: post ( 'client/login' , 'Auth\ContactLoginController@login' ) -> name ( 'client.login.submit' );
2021-05-27 01:14:21 +02:00
Route :: get ( 'client/register/{company_key?}' , 'Auth\ContactRegisterController@showRegisterForm' ) -> name ( 'client.register' ) -> middleware ([ 'domain_db' , 'contact_account' , 'locale' ]);
2020-05-28 17:39:38 +02:00
Route :: post ( 'client/register/{company_key?}' , 'Auth\ContactRegisterController@register' );
2021-05-27 01:14:21 +02:00
Route :: get ( 'client/password/reset' , 'Auth\ContactForgotPasswordController@showLinkRequestForm' ) -> name ( 'client.password.request' ) -> middleware ([ 'domain_db' , 'contact_account' , 'locale' ]);
2019-12-10 21:25:54 +01:00
Route :: post ( 'client/password/email' , 'Auth\ContactForgotPasswordController@sendResetLinkEmail' ) -> name ( 'client.password.email' ) -> middleware ( 'locale' );
2021-05-27 01:14:21 +02:00
Route :: get ( 'client/password/reset/{token}' , 'Auth\ContactResetPasswordController@showResetForm' ) -> name ( 'client.password.reset' ) -> middleware ([ 'domain_db' , 'contact_account' , 'locale' ]);
2019-12-10 21:25:54 +01:00
Route :: post ( 'client/password/reset' , 'Auth\ContactResetPasswordController@reset' ) -> name ( 'client.password.update' ) -> middleware ( 'locale' );
2019-07-17 06:15:25 +02:00
2020-04-16 23:19:21 +02:00
Route :: get ( 'view/{entity_type}/{invitation_key}' , 'ClientPortal\EntityViewController@index' ) -> name ( 'client.entity_view' );
Route :: get ( 'view/{entity_type}/{invitation_key}/password' , 'ClientPortal\EntityViewController@password' ) -> name ( 'client.entity_view.password' );
Route :: post ( 'view/{entity_type}/{invitation_key}/password' , 'ClientPortal\EntityViewController@handlePassword' );
2020-11-27 10:14:01 +01:00
Route :: get ( 'tmp_pdf/{hash}' , 'ClientPortal\TempRouteController@index' ) -> name ( 'tmp_pdf' );
2020-09-23 03:45:07 +02:00
Route :: get ( 'client/key_login/{contact_key}' , 'ClientPortal\ContactHashLoginController@login' ) -> name ( 'client.contact_login' ) -> middleware ([ 'contact_key_login' ]);
2021-03-31 02:07:54 +02:00
Route :: get ( 'client/magic_link/{magic_link}' , 'ClientPortal\ContactHashLoginController@magicLink' ) -> name ( 'client.contact_magic_link' ) -> middleware ([ 'contact_key_login' ]);
2020-12-13 10:46:29 +01:00
Route :: get ( 'documents/{document_hash}' , 'ClientPortal\DocumentController@publicDownload' ) -> name ( 'documents.public_download' );
2021-05-11 03:55:47 +02:00
Route :: get ( 'error' , 'ClientPortal\ContactHashLoginController@errorPage' ) -> name ( 'client.error' );
2020-09-23 03:45:07 +02:00
2021-05-15 05:31:41 +02:00
Route :: group ([ 'middleware' => [ 'auth:contact' , 'locale' , 'check_client_existence' , 'domain_db' ], 'prefix' => 'client' , 'as' => 'client.' ], function () {
2020-03-26 04:23:57 +01:00
Route :: get ( 'dashboard' , 'ClientPortal\DashboardController@index' ) -> name ( 'dashboard' ); // name = (dashboard. index / create / show / update / destroy / edit
2020-03-23 18:10:42 +01:00
2020-03-26 04:23:57 +01:00
Route :: get ( 'invoices' , 'ClientPortal\InvoiceController@index' ) -> name ( 'invoices.index' ) -> middleware ( 'portal_enabled' );
Route :: post ( 'invoices/payment' , 'ClientPortal\InvoiceController@bulk' ) -> name ( 'invoices.bulk' );
Route :: get ( 'invoices/{invoice}' , 'ClientPortal\InvoiceController@show' ) -> name ( 'invoice.show' );
Route :: get ( 'invoices/{invoice_invitation}' , 'ClientPortal\InvoiceController@show' ) -> name ( 'invoice.show_invitation' );
2020-03-23 18:10:42 +01:00
2020-03-26 04:23:57 +01:00
Route :: get ( 'recurring_invoices' , 'ClientPortal\RecurringInvoiceController@index' ) -> name ( 'recurring_invoices.index' ) -> middleware ( 'portal_enabled' );
2021-01-03 08:56:42 +01:00
Route :: get ( 'recurring_invoices/{recurring_invoice}' , 'ClientPortal\RecurringInvoiceController@show' ) -> name ( 'recurring_invoice.show' );
2020-03-26 04:23:57 +01:00
Route :: get ( 'recurring_invoices/{recurring_invoice}/request_cancellation' , 'ClientPortal\RecurringInvoiceController@requestCancellation' ) -> name ( 'recurring_invoices.request_cancellation' );
2020-03-23 18:10:42 +01:00
2020-03-26 04:23:57 +01:00
Route :: post ( 'payments/process' , 'ClientPortal\PaymentController@process' ) -> name ( 'payments.process' );
2020-10-13 12:32:15 +02:00
Route :: post ( 'payments/credit_response' , 'ClientPortal\PaymentController@credit_response' ) -> name ( 'payments.credit_response' );
2020-03-26 04:23:57 +01:00
Route :: get ( 'payments' , 'ClientPortal\PaymentController@index' ) -> name ( 'payments.index' ) -> middleware ( 'portal_enabled' );
Route :: get ( 'payments/{payment}' , 'ClientPortal\PaymentController@show' ) -> name ( 'payments.show' );
Route :: post ( 'payments/process/response' , 'ClientPortal\PaymentController@response' ) -> name ( 'payments.response' );
Route :: get ( 'payments/process/response' , 'ClientPortal\PaymentController@response' ) -> name ( 'payments.response.get' );
2020-03-23 18:10:42 +01:00
2020-03-26 04:23:57 +01:00
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' );
2020-03-23 18:10:42 +01:00
2020-06-09 14:42:23 +02:00
Route :: get ( 'payment_methods/{payment_method}/verification' , 'ClientPortal\PaymentMethodController@verify' ) -> name ( 'payment_methods.verification' );
Route :: post ( 'payment_methods/{payment_method}/verification' , 'ClientPortal\PaymentMethodController@processVerification' );
2021-05-12 16:39:29 +02:00
Route :: resource ( 'payment_methods' , 'ClientPortal\PaymentMethodController' ) -> except ([ 'edit' , 'update' ]);
2020-03-23 18:10:42 +01:00
Route :: match ([ 'GET' , 'POST' ], 'quotes/approve' , 'ClientPortal\QuoteController@bulk' ) -> name ( 'quotes.bulk' );
2020-06-24 01:18:38 +02:00
Route :: get ( 'quotes' , 'ClientPortal\QuoteController@index' ) -> name ( 'quotes.index' ) -> middleware ( 'portal_enabled' );
Route :: get ( 'quotes/{quote}' , 'ClientPortal\QuoteController@show' ) -> name ( 'quote.show' );
Route :: get ( 'quotes/{quote_invitation}' , 'ClientPortal\QuoteController@show' ) -> name ( 'quote.show_invitation' );
2020-03-23 18:10:42 +01:00
2020-10-28 00:21:53 +01:00
Route :: get ( 'credits' , 'ClientPortal\CreditController@index' ) -> name ( 'credits.index' );
2020-10-29 11:19:10 +01:00
Route :: get ( 'credits/{credit}' , 'ClientPortal\CreditController@show' ) -> name ( 'credit.show' );
Route :: get ( 'credits/{credit_invitation}' , 'ClientPortal\CreditController@show' ) -> name ( 'credits.show_invitation' );
2020-03-23 18:10:42 +01:00
2020-05-09 00:19:39 +02:00
Route :: get ( 'client/switch_company/{contact}' , 'ClientPortal\SwitchCompanyController' ) -> name ( 'switch_company' );
2020-09-28 12:04:34 +02:00
Route :: post ( 'documents/download_multiple' , 'ClientPortal\DocumentController@downloadMultiple' ) -> name ( 'documents.download_multiple' );
Route :: get ( 'documents/{document}/download' , 'ClientPortal\DocumentController@download' ) -> name ( 'documents.download' );
Route :: resource ( 'documents' , 'ClientPortal\DocumentController' ) -> only ([ 'index' , 'show' ]);
2020-08-14 17:29:26 +02:00
2021-04-10 06:07:08 +02:00
Route :: get ( 'subscriptions/{recurring_invoice}/plan_switch/{target}' , 'ClientPortal\SubscriptionPlanSwitchController@index' ) -> name ( 'subscription.plan_switch' );
2021-04-07 18:08:26 +02:00
2021-05-11 03:55:47 +02:00
Route :: resource ( 'subscriptions' , 'ClientPortal\SubscriptionController' ) -> middleware ( 'portal_enabled' ) -> only ([ 'index' ]);
2021-03-29 14:35:27 +02:00
2021-05-12 16:39:29 +02:00
Route :: resource ( 'tasks' , 'ClientPortal\TaskController' ) -> only ([ 'index' ]);
2020-08-18 16:01:25 +02:00
Route :: post ( 'upload' , 'ClientPortal\UploadController' ) -> name ( 'upload.store' );
2020-03-26 04:23:57 +01:00
Route :: get ( 'logout' , 'Auth\ContactLoginController@logout' ) -> name ( 'logout' );
2019-07-17 00:59:09 +02:00
});
2021-05-15 06:50:07 +02:00
Route :: get ( 'client/subscriptions/{subscription}/purchase' , 'ClientPortal\SubscriptionPurchaseController@index' ) -> name ( 'client.subscription.purchase' ) -> middleware ( 'domain_db' );
2021-03-11 14:05:23 +01:00
2019-11-16 04:12:29 +01:00
Route :: group ([ 'middleware' => [ 'invite_db' ], 'prefix' => 'client' , 'as' => 'client.' ], function () {
2020-04-15 02:30:52 +02:00
/*Invitation catches*/
2021-01-03 08:56:42 +01:00
Route :: get ( 'recurring_invoice/{invitation_key}' , 'ClientPortal\InvitationController@recurringRouter' );
2020-04-16 10:41:25 +02:00
Route :: get ( '{entity}/{invitation_key}' , 'ClientPortal\InvitationController@router' );
2021-01-15 03:02:55 +01:00
Route :: get ( 'recurring_invoice/{invitation_key}/download_pdf' , 'RecurringInvoiceController@downloadPdf' ) -> name ( 'recurring_invoice.download_invitation_key' );
2020-04-15 02:30:52 +02:00
Route :: get ( 'invoice/{invitation_key}/download_pdf' , 'InvoiceController@downloadPdf' ) -> name ( 'invoice.download_invitation_key' );
Route :: get ( 'quote/{invitation_key}/download_pdf' , 'QuoteController@downloadPdf' ) -> name ( 'quote.download_invitation_key' );
Route :: get ( 'credit/{invitation_key}/download_pdf' , 'CreditController@downloadPdf' ) -> name ( 'credit.download_invitation_key' );
2020-03-26 04:23:57 +01:00
Route :: get ( '{entity}/{invitation_key}/download' , 'ClientPortal\InvitationController@routerForDownload' );
2020-04-15 02:30:52 +02:00
Route :: get ( '{entity}/{client_hash}/{invitation_key}' , 'ClientPortal\InvitationController@routerForIframe' ) -> name ( 'invoice.client_hash_and_invitation_key' ); //should never need this
2019-09-23 07:59:01 +02:00
});
2020-09-06 11:38:10 +02:00
Route :: get ( 'phantom/{entity}/{invitation_key}' , '\App\Utils\PhantomJS\Phantom@displayInvitation' ) -> middleware ([ 'invite_db' , 'phantom_secret' ]) -> name ( 'phantom_view' );
2020-08-04 13:00:19 +02:00
2020-03-21 06:37:30 +01:00
Route :: fallback ( 'BaseController@notFoundClient' );