From 6039fcb5f16aa2dbc8c971101f2d46145d8c8ac5 Mon Sep 17 00:00:00 2001 From: cuneytsenturk Date: Wed, 24 Oct 2018 12:07:28 +0300 Subject: [PATCH] Wizard files permission and route, controller, view files added --- app/Http/Controllers/Common/Companies.php | 5 + app/Http/Controllers/Wizard/Companies.php | 82 +++++++---- app/Http/Controllers/Wizard/Currencies.php | 23 +-- app/Http/Controllers/Wizard/Finish.php | 52 +------ app/Http/Controllers/Wizard/Taxes.php | 76 +--------- app/Http/Requests/Wizard/Company.php | 30 ++++ app/Listeners/Updates/Version130.php | 102 ++++++++++++++ database/seeds/Roles.php | 4 + database/seeds/Settings.php | 3 +- public/css/app.css | 2 +- resources/lang/en-GB/general.php | 3 + .../views/wizard/companies/edit.blade.php | 53 +------ .../views/wizard/currencies/edit.blade.php | 131 +++--------------- resources/views/wizard/finish/index.blade.php | 73 ++++++++++ resources/views/wizard/taxes/edit.blade.php | 131 +++--------------- routes/web.php | 14 +- 16 files changed, 346 insertions(+), 438 deletions(-) create mode 100644 app/Http/Requests/Wizard/Company.php create mode 100644 resources/views/wizard/finish/index.blade.php diff --git a/app/Http/Controllers/Common/Companies.php b/app/Http/Controllers/Common/Companies.php index 9ed22afe0..1c8efba9e 100644 --- a/app/Http/Controllers/Common/Companies.php +++ b/app/Http/Controllers/Common/Companies.php @@ -264,6 +264,11 @@ class Companies extends Controller event(new CompanySwitched($company)); } + // Check wizard + if (!setting('general.wizard', false)) { + return redirect('wizard'); + } + return redirect('/'); } diff --git a/app/Http/Controllers/Wizard/Companies.php b/app/Http/Controllers/Wizard/Companies.php index a9fdeaff2..c929d655f 100644 --- a/app/Http/Controllers/Wizard/Companies.php +++ b/app/Http/Controllers/Wizard/Companies.php @@ -2,11 +2,15 @@ namespace App\Http\Controllers\Wizard; -use Illuminate\Routing\Controller; +use App\Http\Controllers\Controller; +use App\Http\Requests\Wizard\Company as Request; use App\Models\Common\Company; +use App\Traits\Uploads; class Companies extends Controller { + use Uploads; + /** * Show the form for creating a new resource. * @@ -14,15 +18,15 @@ class Companies extends Controller */ public function edit() { - if (setting(setting('general.wizard', false))) { - return redirect('/'); + if (setting('general.wizard', false)) { + //return redirect('/'); } $company = Company::find(session('company_id')); $company->setSettings(); - return view('wizard.companies.edit', compact('company', 'currencies')); + return view('wizard.companies.edit', compact('company')); } /** @@ -33,34 +37,43 @@ class Companies extends Controller * * @return Response */ - public function update(Company $company, Request $request) + public function update(Request $request) { - // Update company - $company->update($request->input()); + // Company + $company = Company::find(session('company_id')); - // Get the company settings - setting()->forgetAll(); - setting()->setExtraColumns(['company_id' => $company->id]); - setting()->load(true); + $fields = $request->all(); - // Update settings - setting()->set('general.company_name', $request->get('company_name')); - setting()->set('general.company_email', $request->get('company_email')); - setting()->set('general.company_address', $request->get('company_address')); + $skip_keys = ['company_id', '_method', '_token']; + $file_keys = ['company_logo', 'invoice_logo']; - if ($request->file('company_logo')) { - $company_logo = $this->getMedia($request->file('company_logo'), 'settings', $company->id); - - if ($company_logo) { - $company->attachMedia($company_logo, 'company_logo'); - - setting()->set('general.company_logo', $company_logo->id); + foreach ($fields as $key => $value) { + // Don't process unwanted keys + if (in_array($key, $skip_keys)) { + continue; } + + // Process file uploads + if (in_array($key, $file_keys)) { + // Upload attachment + if ($request->file($key)) { + $media = $this->getMedia($request->file($key), 'settings'); + + $company->attachMedia($media, $key); + + $value = $media->id; + } + + // Prevent reset + if (empty($value)) { + continue; + } + } + + setting()->set('general.' . $key, $value); } - setting()->set('general.default_payment_method', 'offlinepayment.cash.1'); - setting()->set('general.default_currency', $request->get('default_currency')); - + // Save all settings setting()->save(); // Redirect @@ -68,6 +81,23 @@ class Companies extends Controller flash($message)->success(); - return redirect('common/companies'); + return redirect('wizard/currencies'); + } + + /** + * Update the specified resource in storage. + * + * @param Request $request + * + * @return Response + */ + public function skip() + { + setting()->set('general.wizard', true); + + // Save all settings + setting()->save(); + + return redirect('/'); } } diff --git a/app/Http/Controllers/Wizard/Currencies.php b/app/Http/Controllers/Wizard/Currencies.php index 1b8cde9a5..24022e1c0 100644 --- a/app/Http/Controllers/Wizard/Currencies.php +++ b/app/Http/Controllers/Wizard/Currencies.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers\Wizard; -use Akaunting\Money\Currency as MoneyCurrency; use App\Http\Controllers\Controller; use App\Http\Requests\Setting\Currency as Request; use App\Models\Banking\Account; @@ -17,27 +16,15 @@ class Currencies extends Controller * * @return Response */ - public function edit(Currency $currency) + public function edit() { - // Get current currencies - $current = Currency::pluck('code')->toArray(); - - // Prepare codes - $codes = array(); - $currencies = MoneyCurrency::getCurrencies(); - foreach ($currencies as $key => $item) { - // Don't show if already available - if (($key != $currency->code) && in_array($key, $current)) { - continue; - } - - $codes[$key] = $key; + if (setting('general.wizard', false)) { + //return redirect('/'); } - // Set default currency - $currency->default_currency = ($currency->code == setting('general.default_currency')) ? 1 : 0; + $currencies = Currency::all(); - return view('settings.currencies.edit', compact('currency', 'codes')); + return view('wizard.currencies.edit', compact('currencies')); } /** diff --git a/app/Http/Controllers/Wizard/Finish.php b/app/Http/Controllers/Wizard/Finish.php index 1c474f59f..859d91ce3 100644 --- a/app/Http/Controllers/Wizard/Finish.php +++ b/app/Http/Controllers/Wizard/Finish.php @@ -12,62 +12,16 @@ class Finish extends Controller * * @return Response */ - public function edit() + public function index() { if (setting(setting('general.wizard', false))) { - return redirect('/'); + //return redirect('/'); } $company = Company::find(session('company_id')); $company->setSettings(); - return view('wizard.companies.edit', compact('company', 'currencies')); - } - - /** - * Update the specified resource in storage. - * - * @param Company $company - * @param Request $request - * - * @return Response - */ - public function update(Company $company, Request $request) - { - // Update company - $company->update($request->input()); - - // Get the company settings - setting()->forgetAll(); - setting()->setExtraColumns(['company_id' => $company->id]); - setting()->load(true); - - // Update settings - setting()->set('general.company_name', $request->get('company_name')); - setting()->set('general.company_email', $request->get('company_email')); - setting()->set('general.company_address', $request->get('company_address')); - - if ($request->file('company_logo')) { - $company_logo = $this->getMedia($request->file('company_logo'), 'settings', $company->id); - - if ($company_logo) { - $company->attachMedia($company_logo, 'company_logo'); - - setting()->set('general.company_logo', $company_logo->id); - } - } - - setting()->set('general.default_payment_method', 'offlinepayment.cash.1'); - setting()->set('general.default_currency', $request->get('default_currency')); - - setting()->save(); - - // Redirect - $message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 1)]); - - flash($message)->success(); - - return redirect('common/companies'); + return view('wizard.finish.index', compact('company', 'currencies')); } } diff --git a/app/Http/Controllers/Wizard/Taxes.php b/app/Http/Controllers/Wizard/Taxes.php index 9f0bcb12a..65dc7b3a6 100644 --- a/app/Http/Controllers/Wizard/Taxes.php +++ b/app/Http/Controllers/Wizard/Taxes.php @@ -8,24 +8,6 @@ use App\Models\Setting\Tax; class Taxes extends Controller { - /** - * Store a newly created resource in storage. - * - * @param Request $request - * - * @return Response - */ - public function store(Request $request) - { - Tax::create($request->all()); - - $message = trans('messages.success.added', ['type' => trans_choice('general.tax_rates', 1)]); - - flash($message)->success(); - - return redirect('settings/taxes'); - } - /** * Show the form for editing the specified resource. * @@ -33,9 +15,11 @@ class Taxes extends Controller * * @return Response */ - public function edit(Tax $tax) + public function edit() { - return view('settings.taxes.edit', compact('tax')); + $tax = []; + + return view('wizard.taxes.edit', compact('tax')); } /** @@ -70,56 +54,4 @@ class Taxes extends Controller return redirect('settings/taxes/' . $tax->id . '/edit'); } } - - /** - * Enable the specified resource. - * - * @param Tax $tax - * - * @return Response - */ - public function enable(Tax $tax) - { - $tax->enabled = 1; - $tax->save(); - - $message = trans('messages.success.enabled', ['type' => trans_choice('general.tax_rates', 1)]); - - flash($message)->success(); - - return redirect()->route('taxes.index'); - } - - /** - * Disable the specified resource. - * - * @param Tax $tax - * - * @return Response - */ - public function disable(Tax $tax) - { - $relationships = $this->countRelationships($tax, [ - 'items' => 'items', - 'invoice_items' => 'invoices', - 'bill_items' => 'bills', - ]); - - if (empty($relationships)) { - $tax->enabled = 0; - $tax->save(); - - $message = trans('messages.success.disabled', ['type' => trans_choice('general.tax_rates', 1)]); - - flash($message)->success(); - } else { - $message = trans('messages.warning.disabled', ['name' => $tax->name, 'text' => implode(', ', $relationships)]); - - flash($message)->warning(); - - return redirect()->route('taxes.index'); - } - - return redirect()->route('taxes.index'); - } } diff --git a/app/Http/Requests/Wizard/Company.php b/app/Http/Requests/Wizard/Company.php new file mode 100644 index 000000000..114f6877f --- /dev/null +++ b/app/Http/Requests/Wizard/Company.php @@ -0,0 +1,30 @@ + 'mimes:' . setting('general.file_types') . '|between:0,' . setting('general.file_size') * 1024, + ]; + } +} diff --git a/app/Listeners/Updates/Version130.php b/app/Listeners/Updates/Version130.php index b6aa5bd1d..2d1d36b66 100644 --- a/app/Listeners/Updates/Version130.php +++ b/app/Listeners/Updates/Version130.php @@ -3,6 +3,8 @@ namespace App\Listeners\Updates; use App\Events\UpdateFinished; +use App\Models\Auth\Role; +use App\Models\Auth\Permission; use Artisan; class Version130 extends Listener @@ -24,10 +26,110 @@ class Version130 extends Listener return; } + $permissions = $this->getPermissions(); + + // Attach permission to roles + $roles = Role::all(); + + foreach ($roles as $role) { + $allowed = ['admin']; + + if (!in_array($role->name, $allowed)) { + continue; + } + + foreach ($permissions as $permission) { + $role->attachPermission($permission); + } + } + // Set new Item Reminder settings setting(['general.send_item_reminder' => '0']); setting(['general.schedule_item_stocks' => '3,5,7']); + setting(['general.wizard' => '0']); setting()->save(); } + + protected function getPermissions() + { + $permissions = []; + + // Create permissions + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-companies', + 'display_name' => 'Create Wizard Compaines', + 'description' => 'Create Wizard Compaines', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-currencies', + 'display_name' => 'Create Wizard Currencies', + 'description' => 'Create Wizard Currencies', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-taxes', + 'display_name' => 'Create Wizard Taxes', + 'description' => 'Create Wizard Taxes', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-finish', + 'display_name' => 'Create Wizard Finish', + 'description' => 'Create Wizard Finish', + ]); + + // Read permissions + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-companies', + 'display_name' => 'Read Wizard Compaines', + 'description' => 'Read Wizard Compaines', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-currencies', + 'display_name' => 'Read Wizard Currencies', + 'description' => 'Read Wizard Currencies', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-taxes', + 'display_name' => 'Read Wizard Taxes', + 'description' => 'Read Wizard Taxes', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-finish', + 'display_name' => 'Read Wizard Finish', + 'description' => 'Read Wizard Finish', + ]); + + // Update permissions + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-companies', + 'display_name' => 'Update Wizard Compaines', + 'description' => 'Update Wizard Compaines', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-currencies', + 'display_name' => 'Update Wizard Currencies', + 'description' => 'Update Wizard Currencies', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-taxes', + 'display_name' => 'Update Wizard Taxes', + 'description' => 'Update Wizard Taxes', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-finish', + 'display_name' => 'Update Wizard Finish', + 'description' => 'Update Wizard Finish', + ]); + + return $permissions; + } } diff --git a/database/seeds/Roles.php b/database/seeds/Roles.php index b6d1b93eb..71069bd0d 100644 --- a/database/seeds/Roles.php +++ b/database/seeds/Roles.php @@ -63,6 +63,10 @@ class Roles extends Seeder 'reports-income-expense-summary' => 'r', 'reports-profit-loss' => 'r', 'reports-tax-summary' => 'r', + 'wizard-companies' => 'c,r,u', + 'wizard-currencies' => 'c,r,u', + 'wizard-taxes' => 'c,r,u', + 'wizard-finish' => 'c,r,u', ], 'manager' => [ 'admin-panel' => 'r', diff --git a/database/seeds/Settings.php b/database/seeds/Settings.php index 1c530c9b5..1746965ab 100644 --- a/database/seeds/Settings.php +++ b/database/seeds/Settings.php @@ -51,7 +51,8 @@ class Settings extends Seeder 'general.session_lifetime' => '30', 'general.file_size' => '2', 'general.file_types' => 'pdf,jpeg,jpg,png', - 'offlinepayment.methods' => '[{"code":"offlinepayment.cash.1","name":"Cash","order":"1","description":null},{"code":"offlinepayment.bank_transfer.2","name":"Bank Transfer","order":"2","description":null}]', + 'general.wizard' => '0', + 'offlinepayment.methods' => '[{"code":"offlinepayment.cash.1","name":"Cash","order":"1","description":null},{"code":"offlinepayment.bank_transfer.2","name":"Bank Transfer","order":"2","description":null}]', ]); } } diff --git a/public/css/app.css b/public/css/app.css index 702c2ccb3..4374d6c64 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -826,7 +826,7 @@ input[type="number"] { width: 50px; height: 50px; text-align: center; - padding: 0px 0; + padding: 1px 0; font-size: 30px; line-height: 1.428571; border-radius: 30px; diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index daee66c9d..ab1ca05b3 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -102,6 +102,9 @@ return [ 'partially' => 'Partially', 'partially_paid' => 'Partially Paid', 'export' => 'Export', + 'finish' => 'Finish', + 'wizard' => 'Wizard', + 'skip' => 'Skip', 'enable' => 'Enable', 'disable' => 'Disable', 'select_all' => 'Select All', diff --git a/resources/views/wizard/companies/edit.blade.php b/resources/views/wizard/companies/edit.blade.php index 7c68d40f6..d2fa4a0af 100644 --- a/resources/views/wizard/companies/edit.blade.php +++ b/resources/views/wizard/companies/edit.blade.php @@ -28,11 +28,14 @@ +
- {!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies', $company->id], 'role' => 'form', 'class' => 'form-loading-button']) !!} + {!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies'], 'role' => 'form', 'class' => 'form-loading-button']) !!} +

{{ trans_choice('general.companies', 1) }}

+
@@ -64,7 +67,7 @@
{!! Form::button('  ' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading')]) !!} - {!! Form::button('  ' . trans('general.skip'), ['type' => 'button', 'class' => 'btn btn-default', 'data-loading-text' => trans('general.loading')]) !!} +  {{ trans('general.skip') }}
@@ -87,48 +90,6 @@ var text_yes = '{{ trans('general.yes') }}'; var text_no = '{{ trans('general.no') }}'; - $(document).ready(function () { - var navListItems = $('div.setup-panel div a'), - allWells = $('.setup-content'), - allNextBtn = $('.nextBtn'); - - allWells.hide(); - - navListItems.click(function (e) { - e.preventDefault(); - var $target = $($(this).attr('href')), - $item = $(this); - - if (!$item.hasClass('disabled')) { - navListItems.removeClass('btn-success').addClass('btn-default'); - $item.addClass('btn-success'); - allWells.hide(); - $target.show(); - $target.find('input:eq(0)').focus(); - } - }); - - allNextBtn.click(function () { - var curStep = $(this).closest(".setup-content"), - curStepBtn = curStep.attr("id"), - nextStepWizard = $('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().next().children("a"), - curInputs = curStep.find("input[type='text'],input[type='url']"), - isValid = true; - - $(".form-group").removeClass("has-error"); - for (var i = 0; i < curInputs.length; i++) { - if (!curInputs[i].validity.valid) { - isValid = false; - $(curInputs[i]).closest(".form-group").addClass("has-error"); - } - } - - if (isValid) nextStepWizard.removeAttr('disabled').trigger('click'); - }); - - $('div.setup-panel div a.btn-success').trigger('click'); - }); - $(document).ready(function() { $('#company_logo').fancyfile({ text : '{{ trans('general.form.select.file') }}', @@ -142,7 +103,7 @@ @if($company->company_logo) company_logo_html = ''; - $('#company .fancy-file .fake-file').append(company_logo_html); + $('.form-group.col-md-6 .fancy-file .fake-file').append(company_logo_html); $(document).on('click', '#remove-company_logo', function (e) { confirmDelete("#company_logo-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '' . $company->company_logo->basename . '', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}"); diff --git a/resources/views/wizard/currencies/edit.blade.php b/resources/views/wizard/currencies/edit.blade.php index 317a6fbb3..d6d12b4e7 100644 --- a/resources/views/wizard/currencies/edit.blade.php +++ b/resources/views/wizard/currencies/edit.blade.php @@ -4,60 +4,56 @@ @section('content') -
- {!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies', $company->id], 'role' => 'form', 'class' => 'form-loading-button']) !!} -
+
+
- 1 + 1

{{ trans_choice('general.companies', 1) }}

- 2 + 2

{{ trans_choice('general.currencies', 2) }}

- 3 +

{{ trans_choice('general.taxes', 2) }}

- 4 -

{{ trans_choice('general.companies', 1) }}

+ +

{{ trans_choice('general.finish', 1) }}

+
+ +
+ {!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/currencies'], 'role' => 'form', 'class' => 'form-loading-button']) !!} + +
+

{{ trans_choice('general.currencies', 1) }}

+
+
-
-
- {!! Form::label('sale_price', trans('modules.api_token'), ['class' => 'control-label']) !!} -
- - {!! Form::text('api_token', setting('general.api_token', null), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_token')])]) !!} -
- {!! $errors->first('api_token', '

:message

') !!} -
-

- {!! trans('modules.token_link') !!} -

-
{{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} - - {{ Form::fileGroup('company_logo', trans('settings.company.logo')) }}
@@ -65,96 +61,13 @@
@endsection -@push('js') - -@endpush - -@push('css') - -@endpush - @push('scripts') @endpush diff --git a/resources/views/wizard/finish/index.blade.php b/resources/views/wizard/finish/index.blade.php new file mode 100644 index 000000000..4398eb27b --- /dev/null +++ b/resources/views/wizard/finish/index.blade.php @@ -0,0 +1,73 @@ +@extends('layouts.wizard') + +@section('title', trans('general.wizard')) + +@section('content') + +
+
+
+
+
+ 1 +

{{ trans_choice('general.companies', 1) }}

+
+
+ 2 +

{{ trans_choice('general.currencies', 2) }}

+
+
+ 3 +

{{ trans_choice('general.taxes', 2) }}

+
+
+ 4 +

{{ trans_choice('general.finish', 1) }}

+
+
+
+
+
+ +
+ {!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/taxes'], 'role' => 'form', 'class' => 'form-loading-button']) !!} + +
+

{{ trans('general.finish') }}

+
+ + +
+ + {{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} + + {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} + + {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} +
+ + + + + + {!! Form::close() !!} +
+@endsection + +@push('scripts') + +@endpush diff --git a/resources/views/wizard/taxes/edit.blade.php b/resources/views/wizard/taxes/edit.blade.php index 317a6fbb3..75e1d9caa 100644 --- a/resources/views/wizard/taxes/edit.blade.php +++ b/resources/views/wizard/taxes/edit.blade.php @@ -4,60 +4,56 @@ @section('content') -
- {!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies', $company->id], 'role' => 'form', 'class' => 'form-loading-button']) !!} -
+
+
- 1 + 1

{{ trans_choice('general.companies', 1) }}

- 2 + 2

{{ trans_choice('general.currencies', 2) }}

- 3 + 3

{{ trans_choice('general.taxes', 2) }}

- 4 -

{{ trans_choice('general.companies', 1) }}

+ +

{{ trans_choice('general.finish', 1) }}

+
+ +
+ {!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/taxes'], 'role' => 'form', 'class' => 'form-loading-button']) !!} + +
+

{{ trans_choice('general.taxes', 1) }}

+
+
-
-
- {!! Form::label('sale_price', trans('modules.api_token'), ['class' => 'control-label']) !!} -
- - {!! Form::text('api_token', setting('general.api_token', null), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_token')])]) !!} -
- {!! $errors->first('api_token', '

:message

') !!} -
-

- {!! trans('modules.token_link') !!} -

-
{{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} - - {{ Form::fileGroup('company_logo', trans('settings.company.logo')) }}
@@ -65,96 +61,13 @@
@endsection -@push('js') - -@endpush - -@push('css') - -@endpush - @push('scripts') @endpush diff --git a/routes/web.php b/routes/web.php index a7e12bf81..9e67f631a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -10,17 +10,17 @@ Route::group(['middleware' => 'language'], function () { Route::group(['middleware' => 'permission:read-admin-panel'], function () { Route::group(['prefix' => 'wizard'], function () { Route::get('/', 'Wizard\Companies@edit'); + Route::get('skip', 'Wizard\Companies@skip'); Route::get('companies', 'Wizard\Companies@edit'); - Route::post('companies', 'Wizard\Companies@update'); + Route::patch('companies', 'Wizard\Companies@update'); - Route::get('currencies', 'Wizard\Currencies@create'); - Route::post('language', 'Wizard\Currencies@store'); + Route::get('currencies', 'Wizard\Currencies@edit'); + Route::post('currencies', 'Wizard\Currencies@update'); - Route::get('taxes', 'Wizard\Taxes@create'); - Route::post('taxes', 'Wizard\Taxes@store'); + Route::get('taxes', 'Wizard\Taxes@edit'); + Route::post('taxes', 'Wizard\Taxes@update'); - Route::get('finish', 'Wizard\Finish@create'); - Route::post('finish', 'Wizard\Finish@store'); + Route::get('finish', 'Wizard\Finish@index'); }); });