@extends('layout.app') @section('title',"- Roles") @section('main') @php $roleCounts = []; // Loop through $userData to count role names foreach ($userData as $data) { foreach ($data->roles as $role) { $roleName = $role->name; // Increment the count for the current role name if (isset($roleCounts[$roleName])) { $roleCounts[$roleName]++; } else { $roleCounts[$roleName] = 1; } } } @endphp

Roles List

{{-- @foreach($roleCounts as $roleName => $count)
Total : {{ $count }}
  • Avatar
  • Avatar
  • Avatar
  • Avatar
  • Avatar

{{ $roleName }}

Edit Role
@endforeach--}} {{--
Total : {{ $totalCustomer }}
  • Avatar
  • Avatar
  • Avatar
  • Avatar
  • Avatar

Customers

Inno Gas
--}}
Role Table
ID Name Guard Name Create At Update At Actions
@endsection @section('script') @endsection