@yield('title', lang('role.group_user'))

@section('breadcrumb')
	<h2>@lang('role.group_user')</h2>
	<h3><a href="{{ route('create') }}">@lang('master.add_bt')</a></h3>
@endsection

@extension('message')

@php
	$extensionOption = [
		'name' => 'table-group-user',
		'title' => 'group-user',
		'controller_url' => route('index'),
		'before_get_data' => function($model) {
			$auth = load_auth();
			$user = $auth->getUser();
			if($auth->hasRole(\RoleGlobal::$role->viewAllBranch)) {
				$model->whereIn('branchID', $user->getBranchsId());
			} else {
				$model->where('branchID', $user->branchID);
			}
		}
	];
@endphp

@extension('datatable', 'GroupUserModel', $extensionOption)