added login user assign company control
This commit is contained in:
@ -57,7 +57,9 @@ class Users extends Controller
|
|||||||
|
|
||||||
$landing_pages = $u->landing_pages;
|
$landing_pages = $u->landing_pages;
|
||||||
|
|
||||||
return view('auth.users.show', compact('user', 'landing_pages'));
|
$companies = $user->companies()->collect();
|
||||||
|
|
||||||
|
return view('auth.users.show', compact('user', 'landing_pages', 'companies'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -160,7 +160,8 @@
|
|||||||
</x-table.thead>
|
</x-table.thead>
|
||||||
|
|
||||||
<x-table.tbody>
|
<x-table.tbody>
|
||||||
@foreach($user->companies as $item)
|
@foreach($companies as $item)
|
||||||
|
@if (in_array($item->id, user()->company_ids))
|
||||||
<x-table.tr>
|
<x-table.tr>
|
||||||
<x-table.td class="w-2/12 sm:w-1/12">
|
<x-table.td class="w-2/12 sm:w-1/12">
|
||||||
{{ $item->id }}
|
{{ $item->id }}
|
||||||
@ -219,6 +220,42 @@
|
|||||||
</x-slot>
|
</x-slot>
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
</x-table.tr>
|
</x-table.tr>
|
||||||
|
@else
|
||||||
|
<x-table.tr>
|
||||||
|
<x-table.td class="w-2/12 sm:w-1/12">
|
||||||
|
***
|
||||||
|
</x-table.td>
|
||||||
|
|
||||||
|
<x-table.td class="w-8/12 sm:w-4/12">
|
||||||
|
<x-slot name="first" class="flex" override="class">
|
||||||
|
<div class="font-bold truncate">
|
||||||
|
***
|
||||||
|
</div>
|
||||||
|
</x-slot>
|
||||||
|
<x-slot name="second">
|
||||||
|
***
|
||||||
|
</x-slot>
|
||||||
|
</x-table.td>
|
||||||
|
|
||||||
|
<x-table.td class="w-4/12" hidden-mobile>
|
||||||
|
<x-slot name="first">
|
||||||
|
***
|
||||||
|
</x-slot>
|
||||||
|
<x-slot name="second">
|
||||||
|
***
|
||||||
|
</x-slot>
|
||||||
|
</x-table.td>
|
||||||
|
|
||||||
|
<x-table.td class="w-3/12" kind="amount">
|
||||||
|
<x-slot name="first">
|
||||||
|
***
|
||||||
|
</x-slot>
|
||||||
|
<x-slot name="second">
|
||||||
|
***
|
||||||
|
</x-slot>
|
||||||
|
</x-table.td>
|
||||||
|
</x-table.tr>
|
||||||
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</x-table.tbody>
|
</x-table.tbody>
|
||||||
</x-table>
|
</x-table>
|
||||||
|
Reference in New Issue
Block a user