From 10bd79ad7a3e937bbbcf69154d26bf937a319682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 11 Aug 2020 16:52:10 +0300 Subject: [PATCH] replace url to route --- app/Http/Controllers/Api/Auth/Permissions.php | 2 +- app/Http/Controllers/Api/Auth/Roles.php | 2 +- app/Http/Controllers/Api/Auth/Users.php | 2 +- app/Http/Controllers/Api/Banking/Accounts.php | 2 +- app/Http/Controllers/Api/Banking/Reconciliations.php | 2 +- app/Http/Controllers/Api/Banking/Transactions.php | 2 +- app/Http/Controllers/Api/Banking/Transfers.php | 2 +- app/Http/Controllers/Api/Common/Companies.php | 2 +- app/Http/Controllers/Api/Common/Contacts.php | 2 +- app/Http/Controllers/Api/Common/Items.php | 2 +- app/Http/Controllers/Api/Common/Reports.php | 2 +- app/Http/Controllers/Api/Purchases/Bills.php | 2 +- app/Http/Controllers/Api/Sales/Invoices.php | 2 +- app/Http/Controllers/Api/Settings/Categories.php | 2 +- app/Http/Controllers/Api/Settings/Currencies.php | 2 +- app/Http/Controllers/Api/Settings/Settings.php | 2 +- app/Http/Controllers/Api/Settings/Taxes.php | 2 +- app/Http/Controllers/Common/Search.php | 12 ++++++++---- app/Http/ViewComposers/Notifications.php | 2 +- app/Listeners/Update/V20/Version200.php | 4 +++- app/Notifications/Auth/Reset.php | 2 +- app/Traits/SiteApi.php | 2 +- app/Utilities/Overrider.php | 2 +- resources/views/partials/media/file.blade.php | 4 ++-- resources/views/wizard/companies/edit.blade.php | 2 +- resources/views/wizard/currencies/index.blade.php | 4 ++-- resources/views/wizard/finish/index.blade.php | 4 ++-- resources/views/wizard/taxes/index.blade.php | 4 ++-- 28 files changed, 41 insertions(+), 35 deletions(-) diff --git a/app/Http/Controllers/Api/Auth/Permissions.php b/app/Http/Controllers/Api/Auth/Permissions.php index 3a671314f..530d24c2a 100644 --- a/app/Http/Controllers/Api/Auth/Permissions.php +++ b/app/Http/Controllers/Api/Auth/Permissions.php @@ -45,7 +45,7 @@ class Permissions extends ApiController { $permission = $this->dispatch(new CreatePermission($request)); - return $this->response->created(url('api/permissions/' . $permission->id)); + return $this->response->created(route('api.permissions.show', $permission->id)); } /** diff --git a/app/Http/Controllers/Api/Auth/Roles.php b/app/Http/Controllers/Api/Auth/Roles.php index e50cb6919..d9ad12c2c 100644 --- a/app/Http/Controllers/Api/Auth/Roles.php +++ b/app/Http/Controllers/Api/Auth/Roles.php @@ -45,7 +45,7 @@ class Roles extends ApiController { $role = $this->dispatch(new CreateRole($request)); - return $this->response->created(url('api/roles/' . $role->id)); + return $this->response->created(route('api.roles.show', $role->id)); } /** diff --git a/app/Http/Controllers/Api/Auth/Users.php b/app/Http/Controllers/Api/Auth/Users.php index 47b31b75f..6f4987b32 100644 --- a/app/Http/Controllers/Api/Auth/Users.php +++ b/app/Http/Controllers/Api/Auth/Users.php @@ -52,7 +52,7 @@ class Users extends ApiController { $user = $this->dispatch(new CreateUser($request)); - return $this->response->created(url('api/users/' . $user->id)); + return $this->response->created(route('api.users.show', $user->id)); } /** diff --git a/app/Http/Controllers/Api/Banking/Accounts.php b/app/Http/Controllers/Api/Banking/Accounts.php index 398f5eaa7..9b1490583 100644 --- a/app/Http/Controllers/Api/Banking/Accounts.php +++ b/app/Http/Controllers/Api/Banking/Accounts.php @@ -52,7 +52,7 @@ class Accounts extends ApiController { $account = $this->dispatch(new CreateAccount($request)); - return $this->response->created(url('api/accounts/' . $account->id)); + return $this->response->created(route('api.accounts.show', $account->id)); } /** diff --git a/app/Http/Controllers/Api/Banking/Reconciliations.php b/app/Http/Controllers/Api/Banking/Reconciliations.php index 56a5e91f2..e45d53d21 100644 --- a/app/Http/Controllers/Api/Banking/Reconciliations.php +++ b/app/Http/Controllers/Api/Banking/Reconciliations.php @@ -45,7 +45,7 @@ class Reconciliations extends ApiController { $reconciliation = $this->dispatch(new CreateReconciliation($request)); - return $this->response->created(url('api/reconciliations/' . $reconciliation->id)); + return $this->response->created(route('api.reconciliations.show', $reconciliation->id)); } /** diff --git a/app/Http/Controllers/Api/Banking/Transactions.php b/app/Http/Controllers/Api/Banking/Transactions.php index 61dcbbe54..7ad0175d9 100644 --- a/app/Http/Controllers/Api/Banking/Transactions.php +++ b/app/Http/Controllers/Api/Banking/Transactions.php @@ -45,7 +45,7 @@ class Transactions extends ApiController { $transaction = $this->dispatch(new CreateTransaction($request)); - return $this->response->created(url('api/transactions/' . $transaction->id)); + return $this->response->created(route('api.transactions.show', $transaction->id)); } /** diff --git a/app/Http/Controllers/Api/Banking/Transfers.php b/app/Http/Controllers/Api/Banking/Transfers.php index 959c94c93..41e41ce9e 100644 --- a/app/Http/Controllers/Api/Banking/Transfers.php +++ b/app/Http/Controllers/Api/Banking/Transfers.php @@ -75,7 +75,7 @@ class Transfers extends ApiController { $transfer = $this->dispatch(new CreateTransfer($request)); - return $this->response->created(url('api/transfers/' . $transfer->id)); + return $this->response->created(route('api.transfers.show', $transfer->id)); } /** diff --git a/app/Http/Controllers/Api/Common/Companies.php b/app/Http/Controllers/Api/Common/Companies.php index f49ce37fd..625467a35 100644 --- a/app/Http/Controllers/Api/Common/Companies.php +++ b/app/Http/Controllers/Api/Common/Companies.php @@ -56,7 +56,7 @@ class Companies extends ApiController { $company = $this->dispatch(new CreateCompany($request)); - return $this->response->created(url('api/companies/' . $company->id)); + return $this->response->created(route('api.companies.show', $company->id)); } /** diff --git a/app/Http/Controllers/Api/Common/Contacts.php b/app/Http/Controllers/Api/Common/Contacts.php index 2b98dc227..4387dd874 100644 --- a/app/Http/Controllers/Api/Common/Contacts.php +++ b/app/Http/Controllers/Api/Common/Contacts.php @@ -67,7 +67,7 @@ class Contacts extends ApiController { $contact = $this->dispatch(new CreateContact($request)); - return $this->response->created(url('api/contacts/' . $contact->id)); + return $this->response->created(route('api.contacts.show', $contact->id)); } /** diff --git a/app/Http/Controllers/Api/Common/Items.php b/app/Http/Controllers/Api/Common/Items.php index 60f4f89b1..a9f5287c6 100644 --- a/app/Http/Controllers/Api/Common/Items.php +++ b/app/Http/Controllers/Api/Common/Items.php @@ -50,7 +50,7 @@ class Items extends ApiController { $item = $this->dispatch(new CreateItem($request)); - return $this->response->created(url('api/items/' . $item->id)); + return $this->response->created(route('api.items.show', $item->id)); } /** diff --git a/app/Http/Controllers/Api/Common/Reports.php b/app/Http/Controllers/Api/Common/Reports.php index 9433a2f4e..162529be3 100644 --- a/app/Http/Controllers/Api/Common/Reports.php +++ b/app/Http/Controllers/Api/Common/Reports.php @@ -45,7 +45,7 @@ class Reports extends ApiController { $report = $this->dispatch(new CreateReport($request)); - return $this->response->created(url('api/reports/' . $report->id)); + return $this->response->created(route('api.reports.show', $report->id)); } /** diff --git a/app/Http/Controllers/Api/Purchases/Bills.php b/app/Http/Controllers/Api/Purchases/Bills.php index 3eb4b5aa1..070e7736f 100644 --- a/app/Http/Controllers/Api/Purchases/Bills.php +++ b/app/Http/Controllers/Api/Purchases/Bills.php @@ -45,7 +45,7 @@ class Bills extends ApiController { $bill = $this->dispatch(new CreateBill($request)); - return $this->response->created(url('api/bills/' . $bill->id)); + return $this->response->created(route('api.bills.show', $bill->id)); } /** diff --git a/app/Http/Controllers/Api/Sales/Invoices.php b/app/Http/Controllers/Api/Sales/Invoices.php index 3da1d3329..a2455c804 100644 --- a/app/Http/Controllers/Api/Sales/Invoices.php +++ b/app/Http/Controllers/Api/Sales/Invoices.php @@ -52,7 +52,7 @@ class Invoices extends ApiController { $invoice = $this->dispatch(new CreateInvoice($request)); - return $this->response->created(url('api/invoices/' . $invoice->id)); + return $this->response->created(route('api.invoices.show', $invoice->id)); } /** diff --git a/app/Http/Controllers/Api/Settings/Categories.php b/app/Http/Controllers/Api/Settings/Categories.php index 0d20646a4..5fb18c698 100644 --- a/app/Http/Controllers/Api/Settings/Categories.php +++ b/app/Http/Controllers/Api/Settings/Categories.php @@ -45,7 +45,7 @@ class Categories extends ApiController { $category = $this->dispatch(new CreateCategory($request)); - return $this->response->created(url('api/categories/' . $category->id)); + return $this->response->created(route('api.categories.show', $category->id)); } /** diff --git a/app/Http/Controllers/Api/Settings/Currencies.php b/app/Http/Controllers/Api/Settings/Currencies.php index 56ab2f5cb..e867d9838 100644 --- a/app/Http/Controllers/Api/Settings/Currencies.php +++ b/app/Http/Controllers/Api/Settings/Currencies.php @@ -52,7 +52,7 @@ class Currencies extends ApiController { $currency = $this->dispatch(new CreateCurrency($request)); - return $this->response->created(url('api/currencies/' . $currency->id)); + return $this->response->created(route('api.currencies.show', $currency->id)); } /** diff --git a/app/Http/Controllers/Api/Settings/Settings.php b/app/Http/Controllers/Api/Settings/Settings.php index a288bdf7a..6454bbb46 100644 --- a/app/Http/Controllers/Api/Settings/Settings.php +++ b/app/Http/Controllers/Api/Settings/Settings.php @@ -52,7 +52,7 @@ class Settings extends ApiController { $setting = Setting::create($request->all()); - return $this->response->created(url('api/settings/'.$setting->id)); + return $this->response->created(route('api.settings.show', $setting->id)); } /** diff --git a/app/Http/Controllers/Api/Settings/Taxes.php b/app/Http/Controllers/Api/Settings/Taxes.php index 718d12fbe..fcbba72b7 100644 --- a/app/Http/Controllers/Api/Settings/Taxes.php +++ b/app/Http/Controllers/Api/Settings/Taxes.php @@ -45,7 +45,7 @@ class Taxes extends ApiController { $tax = $this->dispatch(new CreateTax($request)); - return $this->response->created(url('api/taxes/' . $tax->id)); + return $this->response->created(route('api.taxes.show', $tax->id)); } /** diff --git a/app/Http/Controllers/Common/Search.php b/app/Http/Controllers/Common/Search.php index 4e514aa48..8187b98ab 100644 --- a/app/Http/Controllers/Common/Search.php +++ b/app/Http/Controllers/Common/Search.php @@ -64,8 +64,9 @@ class Search extends Controller 'href' => route('invoices.show', $invoice->id), ]; } - }/* + } + /* $income_transactions = Transaction::income()->usingSearchString($keyword)->get(); if ($income_transactions->count()) { @@ -78,7 +79,8 @@ class Search extends Controller 'href' => url('sales/revenues/' . $transaction->id), ]; } - }*/ + } + */ $customers = Contact::customer()->enabled()->usingSearchString($search->keyword)->get(); @@ -107,7 +109,8 @@ class Search extends Controller ]; } } -/* + + /* $payments = Transaction::expense()->usingSearchString($keyword)->get(); if ($revenues->count()) { @@ -120,7 +123,8 @@ class Search extends Controller 'href' => url('sales/revenues/' . $revenue->id), ]; } - }*/ + } + */ $vendors = Contact::vendor()->enabled()->usingSearchString($search->keyword)->get(); diff --git a/app/Http/ViewComposers/Notifications.php b/app/Http/ViewComposers/Notifications.php index 858a243e3..a80dbc67e 100644 --- a/app/Http/ViewComposers/Notifications.php +++ b/app/Http/ViewComposers/Notifications.php @@ -37,7 +37,7 @@ class Notifications $message = str_replace('#path#', $path, $notification->message); $message = str_replace('#token#', csrf_token(), $message); - $message = str_replace('#url#', url('/'), $message); + $message = str_replace('#url#', route('dashboard'), $message); if (!setting('notifications.' . $notification->path . '.' . $notification->id . '.status', 1)) { continue; diff --git a/app/Listeners/Update/V20/Version200.php b/app/Listeners/Update/V20/Version200.php index 9736481f7..11fed20a6 100644 --- a/app/Listeners/Update/V20/Version200.php +++ b/app/Listeners/Update/V20/Version200.php @@ -99,9 +99,11 @@ class Version200 extends Listener setting()->load(true); // Override settings - config(['app.url' => url('/')]); + config(['app.url' => route('dashboard')]); config(['app.timezone' => setting('general.timezone', 'UTC')]); + date_default_timezone_set(config('app.timezone')); + app()->setLocale(setting('general.default_locale')); $updated_settings = [ diff --git a/app/Notifications/Auth/Reset.php b/app/Notifications/Auth/Reset.php index 645a2de6b..545e2dd8f 100644 --- a/app/Notifications/Auth/Reset.php +++ b/app/Notifications/Auth/Reset.php @@ -45,7 +45,7 @@ class Reset extends Notification { return (new MailMessage) ->line(trans('auth.notification.message_1')) - ->action(trans('auth.notification.button'), url('auth/reset', $this->token)) + ->action(trans('auth.notification.button'), route('auth.reset', $this->token)) ->line(trans('auth.notification.message_2')); } } diff --git a/app/Traits/SiteApi.php b/app/Traits/SiteApi.php index 5d73e0f04..20e29a789 100644 --- a/app/Traits/SiteApi.php +++ b/app/Traits/SiteApi.php @@ -19,7 +19,7 @@ trait SiteApi $headers['headers'] = [ 'Authorization' => 'Bearer ' . setting('apps.api_key'), 'Accept' => 'application/json', - 'Referer' => app()->runningInConsole() ? config('app.url') : url('/'), + 'Referer' => app()->runningInConsole() ? config('app.url') : route('dashboard'), 'Akaunting' => version('short'), 'Language' => language()->getShortCode(), 'Information' => json_encode(Info::all()), diff --git a/app/Utilities/Overrider.php b/app/Utilities/Overrider.php index ef1fb8ec7..73fbec4dd 100644 --- a/app/Utilities/Overrider.php +++ b/app/Utilities/Overrider.php @@ -56,7 +56,7 @@ class Overrider } // Set app url dynamically - config(['app.url' => url('/')]); + config(['app.url' => route('dashboard')]); } protected static function loadCurrencies() diff --git a/resources/views/partials/media/file.blade.php b/resources/views/partials/media/file.blade.php index 1eb5b6dd8..5d7889b2b 100644 --- a/resources/views/partials/media/file.blade.php +++ b/resources/views/partials/media/file.blade.php @@ -10,7 +10,7 @@ @else - {{ $file->basename }} + {{ $file->basename }} @endif @@ -37,7 +37,7 @@ @endif @endpermission - + diff --git a/resources/views/wizard/companies/edit.blade.php b/resources/views/wizard/companies/edit.blade.php index d61931da6..a93c4c280 100644 --- a/resources/views/wizard/companies/edit.blade.php +++ b/resources/views/wizard/companies/edit.blade.php @@ -67,7 +67,7 @@ '
' . ' ' . trans('general.save') . '', [':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-icon btn-success button-submit header-button-top', 'data-loading-text' => trans('general.loading')]) !!} - + {{ trans('general.skip') }} diff --git a/resources/views/wizard/currencies/index.blade.php b/resources/views/wizard/currencies/index.blade.php index 02fcace59..145c8b3ca 100644 --- a/resources/views/wizard/currencies/index.blade.php +++ b/resources/views/wizard/currencies/index.blade.php @@ -123,13 +123,13 @@