User edit form assign section control

This commit is contained in:
Cüneyt Şentürk 2022-11-01 15:57:23 +03:00
parent 77338eaabd
commit be044e34fb

View File

@ -38,21 +38,23 @@
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{!! trans('auth.form_description.assign', ['url' => $roles_url]) !!}" />
</x-slot>
@if (user()->can('read-common-companies') || user()->hasRole(['admin', 'manager']))
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.assign') }}" description="{!! trans('auth.form_description.assign', ['url' => $roles_url]) !!}" />
</x-slot>
<x-slot name="body">
@can('read-common-companies')
<x-form.group.select multiple remote name="companies" label="{{ trans_choice('general.companies', 2) }}" :options="$companies" selected-key="company_ids" :remote_action="route('companies.index')" form-group-class="sm:col-span-6" />
@endcan
<x-slot name="body">
@can('read-common-companies')
<x-form.group.select multiple remote name="companies" label="{{ trans_choice('general.companies', 2) }}" :options="$companies" selected-key="company_ids" :remote_action="route('companies.index')" form-group-class="sm:col-span-6" />
@endcan
@role('admin|manager')
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" selected-key="roles.id" />
@endrole
</x-slot>
</x-form.section>
@role('admin|manager')
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" selected-key="roles.id" />
@endrole
</x-slot>
</x-form.section>
@endif
<x-form.section>
<x-slot name="head">
@ -69,15 +71,15 @@
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
@canany(['update-auth-users', 'update-auth-profile'])
<x-form.section>
<x-slot name="foot">
@if (user()->can('read-auth-users'))
<x-form.buttons cancel-route="users.index" />
@else
<x-form.buttons cancel-route="dashboard" />
@endif
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="foot">
@if (user()->can('read-auth-users'))
<x-form.buttons cancel-route="users.index" />
@else
<x-form.buttons cancel-route="dashboard" />
@endif
</x-slot>
</x-form.section>
@endcanany
</x-form>
</x-form.container>