@extends('ui::layouts.app')

@section('content')

    <div class="ui grid two column">
        <div class="column"><h2 class="ui header">@lang('overide::label.users')</h2></div>
        <div class="column right aligned" style="display: none"><a href="{{ route('overide::users.create') }}" class="ui button primary"><i class="icon plus"></i> @lang('overide::action.add')</a></div>
    </div>

    <div class="ui divider hidden"></div>



    {!! Suitable::source($users)->search('true')
    ->columns([
        //new \Laravolt\Suitable\Columns\Checkall(),
        ['header' => trans('overide::users.name'), 'raw' => function($data){
            return $data->name;
        }],
        ['header' => trans('overide::users.email'), 'field' => 'email'],
        ['header' => trans('overide::users.roles'), 'raw' => function($data){
            return $data->roles->implode('name', ', ');
        }],
        ['header' => trans('overide::users.status'), 'raw' => function($data){
            return sprintf('<div class="ui label basic mini">%s</div>', $data->getStatusLabel());
        }],
        ['header' => trans('overide::users.registered_at'), 'raw' => function($data){
            return sprintf('%s', $data->created_at->format('j F Y'));
        }],
        ['header' => false, 'raw' => function($data){
            
                return "<a class='ui button mini' href='".route('overide::users.edit', $data->id)."'>".trans('overide::action.edit')."</a>";
      
        }],
    ])
    ->render() !!}

@endsection
