2015-03-12 01:44:39 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Application Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register all of the routes for an application.
|
|
|
|
| It's a breeze. Simply tell Laravel the URIs it should respond to
|
2015-03-12 04:39:52 +01:00
|
|
|
| and give it the Closure to execute when that URI is requested.
|
2015-03-12 01:44:39 +01:00
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-03-12 04:39:52 +01:00
|
|
|
// Application setup
|
2015-10-18 09:30:28 +02:00
|
|
|
Route::get('/setup', 'AppController@showSetup');
|
|
|
|
Route::post('/setup', 'AppController@doSetup');
|
|
|
|
Route::get('/install', 'AppController@install');
|
|
|
|
Route::get('/update', 'AppController@update');
|
2015-03-12 01:44:39 +01:00
|
|
|
|
2015-03-12 04:39:52 +01:00
|
|
|
// Public pages
|
|
|
|
Route::get('/', 'HomeController@showIndex');
|
2015-10-18 09:30:28 +02:00
|
|
|
Route::get('/log_error', 'HomeController@logError');
|
|
|
|
Route::get('/invoice_now', 'HomeController@invoiceNow');
|
|
|
|
Route::get('/keep_alive', 'HomeController@keepAlive');
|
|
|
|
Route::post('/get_started', 'AccountController@getStarted');
|
2015-03-12 04:39:52 +01:00
|
|
|
|
|
|
|
// Client visible pages
|
2017-05-01 08:50:10 +02:00
|
|
|
Route::group(['middleware' => ['lookup:contact', 'auth:client']], function () {
|
2016-05-23 10:31:49 +02:00
|
|
|
Route::get('view/{invitation_key}', 'ClientPortalController@view');
|
|
|
|
Route::get('download/{invitation_key}', 'ClientPortalController@download');
|
2016-11-04 14:34:15 +01:00
|
|
|
Route::put('sign/{invitation_key}', 'ClientPortalController@sign');
|
2016-02-29 22:46:27 +01:00
|
|
|
Route::get('view', 'HomeController@viewLogo');
|
|
|
|
Route::get('approve/{invitation_key}', 'QuoteController@approve');
|
2016-06-20 16:14:43 +02:00
|
|
|
Route::get('payment/{invitation_key}/{gateway_type?}/{source_id?}', 'OnlinePaymentController@showPayment');
|
|
|
|
Route::post('payment/{invitation_key}', 'OnlinePaymentController@doPayment');
|
|
|
|
Route::match(['GET', 'POST'], 'complete/{invitation_key?}/{gateway_type?}', 'OnlinePaymentController@offsitePayment');
|
|
|
|
Route::get('bank/{routing_number}', 'OnlinePaymentController@getBankInfo');
|
|
|
|
Route::get('client/payment_methods', 'ClientPortalController@paymentMethods');
|
|
|
|
Route::post('client/payment_methods/verify', 'ClientPortalController@verifyPaymentMethod');
|
|
|
|
//Route::get('client/payment_methods/add/{gateway_type}/{source_id?}', 'ClientPortalController@addPaymentMethod');
|
|
|
|
//Route::post('client/payment_methods/add/{gateway_type}', 'ClientPortalController@postAddPaymentMethod');
|
|
|
|
Route::post('client/payment_methods/default', 'ClientPortalController@setDefaultPaymentMethod');
|
|
|
|
Route::post('client/payment_methods/{source_id}/remove', 'ClientPortalController@removePaymentMethod');
|
2016-05-23 10:31:49 +02:00
|
|
|
Route::get('client/quotes', 'ClientPortalController@quoteIndex');
|
2016-09-23 11:02:48 +02:00
|
|
|
Route::get('client/credits', 'ClientPortalController@creditIndex');
|
2016-05-23 10:31:49 +02:00
|
|
|
Route::get('client/invoices', 'ClientPortalController@invoiceIndex');
|
|
|
|
Route::get('client/invoices/recurring', 'ClientPortalController@recurringInvoiceIndex');
|
|
|
|
Route::post('client/invoices/auto_bill', 'ClientPortalController@setAutoBill');
|
|
|
|
Route::get('client/documents', 'ClientPortalController@documentIndex');
|
|
|
|
Route::get('client/payments', 'ClientPortalController@paymentIndex');
|
2016-09-13 15:32:03 +02:00
|
|
|
Route::get('client/dashboard/{contact_key?}', 'ClientPortalController@dashboard');
|
2016-05-23 10:31:49 +02:00
|
|
|
Route::get('client/documents/js/{documents}/{filename}', 'ClientPortalController@getDocumentVFSJS');
|
|
|
|
Route::get('client/documents/{invitation_key}/{documents}/{filename?}', 'ClientPortalController@getDocument');
|
|
|
|
Route::get('client/documents/{invitation_key}/{filename?}', 'ClientPortalController@getInvoiceDocumentsZip');
|
2016-05-15 12:58:11 +02:00
|
|
|
|
2017-01-30 20:40:43 +01:00
|
|
|
Route::get('api/client.quotes', ['as' => 'api.client.quotes', 'uses' => 'ClientPortalController@quoteDatatable']);
|
|
|
|
Route::get('api/client.credits', ['as' => 'api.client.credits', 'uses' => 'ClientPortalController@creditDatatable']);
|
|
|
|
Route::get('api/client.invoices', ['as' => 'api.client.invoices', 'uses' => 'ClientPortalController@invoiceDatatable']);
|
|
|
|
Route::get('api/client.recurring_invoices', ['as' => 'api.client.recurring_invoices', 'uses' => 'ClientPortalController@recurringInvoiceDatatable']);
|
|
|
|
Route::get('api/client.documents', ['as' => 'api.client.documents', 'uses' => 'ClientPortalController@documentDatatable']);
|
|
|
|
Route::get('api/client.payments', ['as' => 'api.client.payments', 'uses' => 'ClientPortalController@paymentDatatable']);
|
|
|
|
Route::get('api/client.activity', ['as' => 'api.client.activity', 'uses' => 'ClientPortalController@activityDatatable']);
|
2016-02-29 22:46:27 +01:00
|
|
|
});
|
2016-03-08 22:22:59 +01:00
|
|
|
|
2016-06-20 16:14:43 +02:00
|
|
|
Route::get('license', 'NinjaController@show_license_payment');
|
|
|
|
Route::post('license', 'NinjaController@do_license_payment');
|
|
|
|
Route::get('claim_license', 'NinjaController@claim_license');
|
2015-03-12 04:39:52 +01:00
|
|
|
|
|
|
|
Route::post('signup/validate', 'AccountController@checkEmail');
|
|
|
|
Route::post('signup/submit', 'AccountController@submitSignup');
|
|
|
|
|
2015-10-18 09:30:28 +02:00
|
|
|
Route::get('/auth/{provider}', 'Auth\AuthController@authLogin');
|
|
|
|
Route::get('/auth_unlink', 'Auth\AuthController@authUnlink');
|
2017-03-06 10:23:50 +01:00
|
|
|
|
|
|
|
Route::group(['middleware' => 'cors'], function () {
|
2017-03-06 10:27:03 +01:00
|
|
|
Route::match(['GET', 'POST', 'OPTIONS'], '/buy_now/{gateway_type?}', 'OnlinePaymentController@handleBuyNow');
|
2017-03-06 10:23:50 +01:00
|
|
|
});
|
2015-10-11 16:41:09 +02:00
|
|
|
|
2017-05-01 14:17:52 +02:00
|
|
|
Route::group(['middleware' => 'lookup:postmark'], function () {
|
|
|
|
Route::post('/hook/email_bounced', 'AppController@emailBounced');
|
|
|
|
Route::post('/hook/email_opened', 'AppController@emailOpened');
|
|
|
|
});
|
|
|
|
|
2016-06-24 14:40:10 +02:00
|
|
|
Route::post('/payment_hook/{accountKey}/{gatewayId}', 'OnlinePaymentController@handlePaymentWebhook');
|
2017-05-01 14:17:52 +02:00
|
|
|
//Route::post('/hook/bot/{platform?}', 'BotController@handleMessage');
|
2015-10-08 11:49:26 +02:00
|
|
|
|
2015-03-29 14:37:42 +02:00
|
|
|
// Laravel auth routes
|
2016-07-03 18:11:58 +02:00
|
|
|
Route::get('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@getRegister']);
|
|
|
|
Route::post('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@postRegister']);
|
|
|
|
Route::get('/login', ['as' => 'login', 'uses' => 'Auth\AuthController@getLoginWrapper']);
|
|
|
|
Route::post('/login', ['as' => 'login', 'uses' => 'Auth\AuthController@postLoginWrapper']);
|
|
|
|
Route::get('/logout', ['as' => 'logout', 'uses' => 'Auth\AuthController@getLogoutWrapper']);
|
|
|
|
Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmail']);
|
|
|
|
Route::post('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@postEmail']);
|
|
|
|
Route::get('/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset']);
|
|
|
|
Route::post('/password/reset', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset']);
|
2016-03-02 14:36:42 +01:00
|
|
|
Route::get('/user/confirm/{code}', 'UserController@confirm');
|
2015-03-29 14:37:42 +02:00
|
|
|
|
2016-03-05 04:22:54 +01:00
|
|
|
// Client auth
|
2016-07-03 18:11:58 +02:00
|
|
|
Route::get('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\AuthController@getLogin']);
|
|
|
|
Route::post('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\AuthController@postLogin']);
|
|
|
|
Route::get('/client/logout', ['as' => 'logout', 'uses' => 'ClientAuth\AuthController@getLogout']);
|
|
|
|
Route::get('/client/sessionexpired', ['as' => 'logout', 'uses' => 'ClientAuth\AuthController@getSessionExpired']);
|
|
|
|
Route::get('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@getEmail']);
|
|
|
|
Route::post('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@postEmail']);
|
|
|
|
Route::get('/client/password/reset/{invitation_key}/{token}', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@getReset']);
|
|
|
|
Route::post('/client/password/reset', ['as' => 'forgot', 'uses' => 'ClientAuth\PasswordController@postReset']);
|
2016-03-05 04:22:54 +01:00
|
|
|
|
2015-05-08 10:21:29 +02:00
|
|
|
if (Utils::isNinja()) {
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('/signup/register', 'AccountController@doRegister');
|
|
|
|
Route::get('/news_feed/{user_type}/{version}/', 'HomeController@newsFeed');
|
|
|
|
Route::get('/demo', 'AccountController@demo');
|
|
|
|
}
|
|
|
|
|
2016-01-28 13:04:55 +01:00
|
|
|
if (Utils::isReseller()) {
|
|
|
|
Route::post('/reseller_stats', 'AppController@stats');
|
|
|
|
}
|
|
|
|
|
2017-03-09 16:52:58 +01:00
|
|
|
if (Utils::isTravis()) {
|
2017-03-09 16:48:21 +01:00
|
|
|
Route::get('/check_data', 'AppController@checkData');
|
|
|
|
}
|
|
|
|
|
2017-05-01 08:50:10 +02:00
|
|
|
Route::group(['middleware' => ['lookup:user', 'auth:user']], function () {
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::get('dashboard', 'DashboardController@index');
|
2016-09-11 16:30:23 +02:00
|
|
|
Route::get('dashboard_chart_data/{group_by}/{start_date}/{end_date}/{currency_id}/{include_expenses}', 'DashboardController@chartData');
|
2016-11-18 14:31:43 +01:00
|
|
|
Route::get('set_entity_filter/{entity_type}/{filter?}', 'AccountController@setEntityFilter');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::get('hide_message', 'HomeController@hideMessage');
|
|
|
|
Route::get('force_inline_pdf', 'UserController@forcePDFJS');
|
2016-07-27 14:46:05 +02:00
|
|
|
Route::get('account/get_search_data', ['as' => 'get_search_data', 'uses' => 'AccountController@getSearchData']);
|
2016-09-25 19:36:15 +02:00
|
|
|
Route::get('check_invoice_number/{invoice_id?}', 'InvoiceController@checkInvoiceNumber');
|
2016-10-25 16:07:56 +02:00
|
|
|
Route::post('save_sidebar_state', 'UserController@saveSidebarState');
|
2016-12-25 18:43:42 +01:00
|
|
|
Route::post('contact_us', 'HomeController@contactUs');
|
2017-04-04 11:54:38 +02:00
|
|
|
Route::post('handle_command', 'BotController@handleCommand');
|
2016-05-18 09:12:33 +02:00
|
|
|
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::get('settings/user_details', 'AccountController@showUserDetails');
|
|
|
|
Route::post('settings/user_details', 'AccountController@saveUserDetails');
|
2017-03-14 14:18:31 +01:00
|
|
|
Route::post('settings/payment_gateway_limits', 'AccountGatewayController@savePaymentGatewayLimits');
|
2016-05-08 20:31:23 +02:00
|
|
|
Route::post('users/change_password', 'UserController@changePassword');
|
2015-03-12 04:39:52 +01:00
|
|
|
|
|
|
|
Route::resource('clients', 'ClientController');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/clients', 'ClientController@getDatatable');
|
|
|
|
Route::get('api/activities/{client_id?}', 'ActivityController@getDatatable');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('clients/bulk', 'ClientController@bulk');
|
2017-01-23 16:00:44 +01:00
|
|
|
Route::get('clients/statement/{client_id}', 'ClientController@statement');
|
2015-03-12 04:39:52 +01:00
|
|
|
|
2015-05-27 18:52:10 +02:00
|
|
|
Route::resource('tasks', 'TaskController');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/tasks/{client_id?}', 'TaskController@getDatatable');
|
2017-01-15 22:23:46 +01:00
|
|
|
Route::get('tasks/create/{client_id?}/{project_id?}', 'TaskController@create');
|
2015-05-27 18:52:10 +02:00
|
|
|
Route::post('tasks/bulk', 'TaskController@bulk');
|
2016-11-29 18:47:26 +01:00
|
|
|
Route::get('projects', 'ProjectController@index');
|
|
|
|
Route::get('api/projects', 'ProjectController@getDatatable');
|
|
|
|
Route::get('projects/create/{client_id?}', 'ProjectController@create');
|
|
|
|
Route::post('projects', 'ProjectController@store');
|
|
|
|
Route::put('projects/{projects}', 'ProjectController@update');
|
|
|
|
Route::get('projects/{projects}/edit', 'ProjectController@edit');
|
|
|
|
Route::post('projects/bulk', 'ProjectController@bulk');
|
2015-05-27 18:52:10 +02:00
|
|
|
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/recurring_invoices/{client_id?}', 'InvoiceController@getRecurringDatatable');
|
2016-01-18 10:13:39 +01:00
|
|
|
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::get('invoices/invoice_history/{invoice_id}', 'InvoiceController@invoiceHistory');
|
|
|
|
Route::get('quotes/quote_history/{invoice_id}', 'InvoiceController@invoiceHistory');
|
2016-01-18 10:13:39 +01:00
|
|
|
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::resource('invoices', 'InvoiceController');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/invoices/{client_id?}', 'InvoiceController@getDatatable');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::get('invoices/create/{client_id?}', 'InvoiceController@create');
|
2015-08-10 17:48:41 +02:00
|
|
|
Route::get('recurring_invoices/create/{client_id?}', 'InvoiceController@createRecurring');
|
2015-10-29 18:21:00 +01:00
|
|
|
Route::get('recurring_invoices', 'RecurringInvoiceController@index');
|
2016-08-23 22:20:03 +02:00
|
|
|
Route::get('recurring_invoices/{invoices}/edit', 'InvoiceController@edit');
|
2016-05-01 21:30:39 +02:00
|
|
|
Route::get('invoices/{invoices}/clone', 'InvoiceController@cloneInvoice');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('invoices/bulk', 'InvoiceController@bulk');
|
2015-10-30 13:56:25 +01:00
|
|
|
Route::post('recurring_invoices/bulk', 'InvoiceController@bulk');
|
2015-03-12 04:39:52 +01:00
|
|
|
|
2016-05-01 21:30:39 +02:00
|
|
|
Route::get('documents/{documents}/{filename?}', 'DocumentController@get');
|
|
|
|
Route::get('documents/js/{documents}/{filename}', 'DocumentController@getVFSJS');
|
|
|
|
Route::get('documents/preview/{documents}/{filename?}', 'DocumentController@getPreview');
|
2016-05-30 12:43:41 +02:00
|
|
|
Route::post('documents', 'DocumentController@postUpload');
|
2016-05-26 18:02:53 +02:00
|
|
|
Route::delete('documents/{documents}', 'DocumentController@delete');
|
2016-05-18 09:12:33 +02:00
|
|
|
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::get('quotes/create/{client_id?}', 'QuoteController@create');
|
2016-05-01 21:30:39 +02:00
|
|
|
Route::get('quotes/{invoices}/clone', 'InvoiceController@cloneInvoice');
|
|
|
|
Route::get('quotes/{invoices}/edit', 'InvoiceController@edit');
|
|
|
|
Route::put('quotes/{invoices}', 'InvoiceController@update');
|
|
|
|
Route::get('quotes/{invoices}', 'InvoiceController@edit');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('quotes', 'InvoiceController@store');
|
|
|
|
Route::get('quotes', 'QuoteController@index');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/quotes/{client_id?}', 'QuoteController@getDatatable');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('quotes/bulk', 'QuoteController@bulk');
|
|
|
|
|
|
|
|
Route::resource('payments', 'PaymentController');
|
|
|
|
Route::get('payments/create/{client_id?}/{invoice_id?}', 'PaymentController@create');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/payments/{client_id?}', 'PaymentController@getDatatable');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('payments/bulk', 'PaymentController@bulk');
|
|
|
|
|
|
|
|
Route::resource('credits', 'CreditController');
|
|
|
|
Route::get('credits/create/{client_id?}/{invoice_id?}', 'CreditController@create');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/credits/{client_id?}', 'CreditController@getDatatable');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('credits/bulk', 'CreditController@bulk');
|
|
|
|
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/products', 'ProductController@getDatatable');
|
2016-09-23 16:00:47 +02:00
|
|
|
Route::resource('products', 'ProductController');
|
|
|
|
Route::post('products/bulk', 'ProductController@bulk');
|
|
|
|
|
2016-03-02 14:36:42 +01:00
|
|
|
Route::get('/resend_confirmation', 'AccountController@resendConfirmation');
|
|
|
|
Route::post('/update_setup', 'AppController@updateSetup');
|
2016-01-06 15:23:58 +01:00
|
|
|
|
|
|
|
// vendor
|
|
|
|
Route::resource('vendors', 'VendorController');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/vendors', 'VendorController@getDatatable');
|
2016-01-06 15:23:58 +01:00
|
|
|
Route::post('vendors/bulk', 'VendorController@bulk');
|
2016-01-06 20:52:09 +01:00
|
|
|
|
|
|
|
// Expense
|
|
|
|
Route::resource('expenses', 'ExpenseController');
|
2017-01-15 22:23:46 +01:00
|
|
|
Route::get('expenses/create/{vendor_id?}/{client_id?}/{category_id?}', 'ExpenseController@create');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/expenses', 'ExpenseController@getDatatable');
|
2016-11-25 15:02:39 +01:00
|
|
|
Route::get('api/expenses/{id}', 'ExpenseController@getDatatableVendor');
|
2016-01-19 20:35:15 +01:00
|
|
|
Route::post('expenses/bulk', 'ExpenseController@bulk');
|
2016-07-06 20:35:16 +02:00
|
|
|
Route::get('expense_categories', 'ExpenseCategoryController@index');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/expense_categories', 'ExpenseCategoryController@getDatatable');
|
2016-07-06 20:35:16 +02:00
|
|
|
Route::get('expense_categories/create', 'ExpenseCategoryController@create');
|
|
|
|
Route::post('expense_categories', 'ExpenseCategoryController@store');
|
|
|
|
Route::put('expense_categories/{expense_categories}', 'ExpenseCategoryController@update');
|
|
|
|
Route::get('expense_categories/{expense_categories}/edit', 'ExpenseCategoryController@edit');
|
|
|
|
Route::post('expense_categories/bulk', 'ExpenseCategoryController@bulk');
|
2016-11-11 00:24:54 +01:00
|
|
|
|
2017-01-30 17:05:31 +01:00
|
|
|
// BlueVine
|
|
|
|
Route::post('bluevine/signup', 'BlueVineController@signup');
|
|
|
|
Route::get('bluevine/hide_message', 'BlueVineController@hideMessage');
|
|
|
|
Route::get('bluevine/completed', 'BlueVineController@handleCompleted');
|
2016-12-28 15:39:29 +01:00
|
|
|
Route::get('white_label/hide_message', 'NinjaController@hideWhiteLabelMessage');
|
2017-02-07 16:23:55 +01:00
|
|
|
|
|
|
|
Route::get('reports', 'ReportController@showReports');
|
|
|
|
Route::post('reports', 'ReportController@showReports');
|
2015-03-12 04:39:52 +01:00
|
|
|
});
|
|
|
|
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::group([
|
2017-05-01 08:50:10 +02:00
|
|
|
'middleware' => ['lookup:user', 'auth:user', 'permissions.required'],
|
2016-03-16 00:08:00 +01:00
|
|
|
'permissions' => 'admin',
|
2017-01-30 17:05:31 +01:00
|
|
|
], function () {
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/users', 'UserController@getDatatable');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::resource('users', 'UserController');
|
|
|
|
Route::post('users/bulk', 'UserController@bulk');
|
|
|
|
Route::get('send_confirmation/{user_id}', 'UserController@sendConfirmation');
|
|
|
|
Route::get('/switch_account/{user_id}', 'UserController@switchAccount');
|
2017-01-29 21:07:44 +01:00
|
|
|
Route::get('/account/{account_key}', 'UserController@viewAccountByKey');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::get('/unlink_account/{user_account_id}/{user_id}', 'UserController@unlinkAccount');
|
|
|
|
Route::get('/manage_companies', 'UserController@manageCompanies');
|
|
|
|
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/tokens', 'TokenController@getDatatable');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::resource('tokens', 'TokenController');
|
|
|
|
Route::post('tokens/bulk', 'TokenController@bulk');
|
|
|
|
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/tax_rates', 'TaxRateController@getDatatable');
|
2016-03-16 03:45:11 +01:00
|
|
|
Route::resource('tax_rates', 'TaxRateController');
|
|
|
|
Route::post('tax_rates/bulk', 'TaxRateController@bulk');
|
|
|
|
|
2016-05-05 16:46:22 +02:00
|
|
|
Route::get('settings/email_preview', 'AccountController@previewEmail');
|
2017-01-12 12:52:37 +01:00
|
|
|
Route::post('settings/client_portal', 'AccountController@saveClientPortalSettings');
|
|
|
|
Route::post('settings/email_settings', 'AccountController@saveEmailSettings');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::get('company/{section}/{subSection?}', 'AccountController@redirectLegacy');
|
|
|
|
Route::get('settings/data_visualizations', 'ReportController@d3');
|
|
|
|
|
2016-04-17 00:34:39 +02:00
|
|
|
Route::post('settings/change_plan', 'AccountController@changePlan');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::post('settings/cancel_account', 'AccountController@cancelAccount');
|
2017-03-28 16:51:31 +02:00
|
|
|
Route::post('settings/purge_data', 'AccountController@purgeData');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::post('settings/company_details', 'AccountController@updateDetails');
|
|
|
|
Route::post('settings/{section?}', 'AccountController@doSection');
|
|
|
|
|
|
|
|
Route::post('user/setTheme', 'UserController@setTheme');
|
|
|
|
Route::post('remove_logo', 'AccountController@removeLogo');
|
|
|
|
|
|
|
|
Route::post('/export', 'ExportController@doExport');
|
|
|
|
Route::post('/import', 'ImportController@doImport');
|
|
|
|
Route::post('/import_csv', 'ImportController@doImportCSV');
|
|
|
|
|
2016-06-09 09:56:22 +02:00
|
|
|
Route::get('gateways/create/{show_wepay?}', 'AccountGatewayController@create');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::resource('gateways', 'AccountGatewayController');
|
2016-05-12 04:55:37 +02:00
|
|
|
Route::get('gateways/{public_id}/resend_confirmation', 'AccountGatewayController@resendConfirmation');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/gateways', 'AccountGatewayController@getDatatable');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::post('account_gateways/bulk', 'AccountGatewayController@bulk');
|
|
|
|
|
2017-02-26 10:39:25 +01:00
|
|
|
Route::get('payment_terms', 'PaymentTermController@index');
|
|
|
|
Route::get('api/payment_terms', 'PaymentTermController@getDatatable');
|
|
|
|
Route::get('payment_terms/create', 'PaymentTermController@create');
|
|
|
|
Route::post('payment_terms', 'PaymentTermController@store');
|
|
|
|
Route::put('payment_terms/{payment_terms}', 'PaymentTermController@update');
|
|
|
|
Route::get('payment_terms/{payment_terms}/edit', 'PaymentTermController@edit');
|
|
|
|
Route::post('payment_terms/bulk', 'PaymentTermController@bulk');
|
|
|
|
|
2016-05-19 08:47:57 +02:00
|
|
|
Route::get('bank_accounts/import_ofx', 'BankAccountController@showImportOFX');
|
|
|
|
Route::post('bank_accounts/import_ofx', 'BankAccountController@doImportOFX');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::resource('bank_accounts', 'BankAccountController');
|
2016-11-24 10:41:11 +01:00
|
|
|
Route::get('api/bank_accounts', 'BankAccountController@getDatatable');
|
2016-03-16 00:08:00 +01:00
|
|
|
Route::post('bank_accounts/bulk', 'BankAccountController@bulk');
|
|
|
|
Route::post('bank_accounts/validate', 'BankAccountController@validateAccount');
|
|
|
|
Route::post('bank_accounts/import_expenses/{bank_id}', 'BankAccountController@importExpenses');
|
2016-08-18 21:52:59 +02:00
|
|
|
Route::get('self-update', 'SelfUpdateController@index');
|
|
|
|
Route::post('self-update', 'SelfUpdateController@update');
|
|
|
|
Route::get('self-update/download', 'SelfUpdateController@download');
|
2016-03-16 00:08:00 +01:00
|
|
|
});
|
|
|
|
|
2017-05-01 08:50:10 +02:00
|
|
|
Route::group(['middleware' => ['lookup:user', 'auth:user']], function () {
|
2016-08-23 22:20:03 +02:00
|
|
|
Route::get('settings/{section?}', 'AccountController@showSection');
|
|
|
|
});
|
|
|
|
|
2015-11-02 19:43:22 +01:00
|
|
|
// Route groups for API
|
2017-05-01 09:03:42 +02:00
|
|
|
Route::group(['middleware' => ['lookup:api', 'api'], 'prefix' => 'api/v1'], function () {
|
2016-05-02 10:38:01 +02:00
|
|
|
Route::get('ping', 'AccountApiController@ping');
|
2015-11-02 19:43:22 +01:00
|
|
|
Route::post('login', 'AccountApiController@login');
|
2016-10-06 14:46:27 +02:00
|
|
|
Route::post('oauth_login', 'AccountApiController@oauthLogin');
|
2016-03-08 22:24:06 +01:00
|
|
|
Route::post('register', 'AccountApiController@register');
|
2015-11-19 12:37:30 +01:00
|
|
|
Route::get('static', 'AccountApiController@getStaticData');
|
2015-11-08 10:43:32 +01:00
|
|
|
Route::get('accounts', 'AccountApiController@show');
|
2016-02-01 04:42:05 +01:00
|
|
|
Route::put('accounts', 'AccountApiController@update');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::resource('clients', 'ClientApiController');
|
2017-03-17 10:28:46 +01:00
|
|
|
Route::resource('contacts', 'ContactApiController');
|
2017-03-09 11:11:45 +01:00
|
|
|
Route::get('quotes', 'QuoteApiController@index');
|
2016-06-01 11:56:15 +02:00
|
|
|
Route::get('download/{invoice_id}', 'InvoiceApiController@download');
|
2015-09-07 11:07:55 +02:00
|
|
|
Route::resource('invoices', 'InvoiceApiController');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::resource('payments', 'PaymentApiController');
|
2015-09-07 11:07:55 +02:00
|
|
|
Route::resource('tasks', 'TaskApiController');
|
2015-04-28 22:13:52 +02:00
|
|
|
Route::post('hooks', 'IntegrationController@subscribe');
|
2015-03-12 04:39:52 +01:00
|
|
|
Route::post('email_invoice', 'InvoiceApiController@emailInvoice');
|
2016-02-03 15:03:56 +01:00
|
|
|
Route::get('user_accounts', 'AccountApiController@getUserAccounts');
|
2016-01-30 10:56:27 +01:00
|
|
|
Route::resource('products', 'ProductApiController');
|
2017-04-27 14:21:37 +02:00
|
|
|
Route::resource('projects', 'ProjectApiController');
|
2016-02-03 15:03:56 +01:00
|
|
|
Route::resource('tax_rates', 'TaxRateApiController');
|
2016-02-04 21:35:28 +01:00
|
|
|
Route::resource('users', 'UserApiController');
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::resource('expenses', 'ExpenseApiController');
|
2016-03-01 03:57:59 +01:00
|
|
|
Route::post('add_token', 'AccountApiController@addDeviceToken');
|
2016-03-01 04:44:14 +01:00
|
|
|
Route::post('update_notifications', 'AccountApiController@updatePushNotifications');
|
2016-03-22 09:50:09 +01:00
|
|
|
Route::get('dashboard', 'DashboardApiController@index');
|
2016-05-21 10:44:53 +02:00
|
|
|
Route::resource('documents', 'DocumentAPIController');
|
2016-01-06 15:23:58 +01:00
|
|
|
Route::resource('vendors', 'VendorApiController');
|
2016-10-28 10:37:28 +02:00
|
|
|
Route::resource('expense_categories', 'ExpenseCategoryApiController');
|
2015-03-12 04:39:52 +01:00
|
|
|
});
|
|
|
|
|
2015-04-14 20:58:07 +02:00
|
|
|
// Redirects for legacy links
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/rocksteady', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL, 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/about', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL, 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/contact', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL.'/contact', 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/plans', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL.'/pricing', 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/faq', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL.'/how-it-works', 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/features', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL.'/features', 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/testimonials', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL, 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/compare-online-invoicing{sites?}', function () {
|
2015-04-14 20:58:07 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL, 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/forgot', function () {
|
2016-06-05 17:50:41 +02:00
|
|
|
return Redirect::to(NINJA_APP_URL.'/recover_password', 301);
|
2015-06-10 22:55:23 +02:00
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/feed', function () {
|
2016-06-05 18:10:15 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL.'/feed', 301);
|
|
|
|
});
|
2017-01-30 17:05:31 +01:00
|
|
|
Route::get('/comments/feed', function () {
|
2016-06-05 20:05:11 +02:00
|
|
|
return Redirect::to(NINJA_WEB_URL.'/comments/feed', 301);
|
|
|
|
});
|
2017-03-21 10:47:46 +01:00
|
|
|
Route::get('/terms', function () {
|
|
|
|
return Redirect::to(NINJA_WEB_URL.'/terms', 301);
|
|
|
|
});
|
2015-04-14 20:58:07 +02:00
|
|
|
|
2015-03-12 04:39:52 +01:00
|
|
|
/*
|
2016-03-03 20:39:15 +01:00
|
|
|
if (Utils::isNinjaDev())
|
2015-03-12 04:39:52 +01:00
|
|
|
{
|
2016-03-03 20:39:15 +01:00
|
|
|
//ini_set('memory_limit','1024M');
|
2016-08-29 17:04:01 +02:00
|
|
|
//set_time_limit(0);
|
|
|
|
Auth::loginUsingId(1);
|
2015-03-12 04:39:52 +01:00
|
|
|
}
|
2016-05-18 09:12:33 +02:00
|
|
|
*/
|
2017-01-10 11:53:17 +01:00
|
|
|
|
2017-01-10 12:16:37 +01:00
|
|
|
// Include static app constants
|
2017-01-10 12:14:36 +01:00
|
|
|
require_once app_path() . '/Constants.php';
|