1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Cortex\Auth\DataTables\Adminarea; |
6
|
|
|
|
7
|
|
|
use Cortex\Auth\Models\Sentinel; |
8
|
|
|
use Cortex\Foundation\DataTables\AbstractDataTable; |
9
|
|
|
|
10
|
|
|
class SentinelsDataTable extends AbstractDataTable |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* {@inheritdoc} |
14
|
|
|
*/ |
15
|
|
|
protected $model = Sentinel::class; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Get columns. |
19
|
|
|
* |
20
|
|
|
* @return array |
21
|
|
|
*/ |
22
|
|
|
protected function getColumns(): array |
23
|
|
|
{ |
24
|
|
|
$link = config('cortex.foundation.route.locale_prefix') |
25
|
|
|
? '"<a href=\""+routes.route(\'adminarea.sentinels.edit\', {sentinel: full.username, locale: \''.$this->request->segment(1).'\'})+"\">"+data+"</a>"' |
|
|
|
|
26
|
|
|
: '"<a href=\""+routes.route(\'adminarea.sentinels.edit\', {sentinel: full.username})+"\">"+data+"</a>"'; |
27
|
|
|
|
28
|
|
|
return [ |
29
|
|
|
'username' => ['title' => trans('cortex/auth::common.username'), 'render' => $link.'+(full.is_active ? " <i class=\"text-success fa fa-check\"></i>" : " <i class=\"text-danger fa fa-close\"></i>")', 'responsivePriority' => 0], |
|
|
|
|
30
|
|
|
'first_name' => ['title' => trans('cortex/auth::common.first_name')], |
31
|
|
|
'middle_name' => ['title' => trans('cortex/auth::common.middle_name'), 'visible' => false], |
32
|
|
|
'last_name' => ['title' => trans('cortex/auth::common.last_name')], |
33
|
|
|
'email' => ['title' => trans('cortex/auth::common.email'), 'render' => 'data+(data ? (full.email_verified ? " <i class=\"text-success fa fa-check\" title=\""+full.email_verified_at+"\"></i>" : " <i class=\"text-danger fa fa-close\"></i>") : "")'], |
|
|
|
|
34
|
|
|
'phone' => ['title' => trans('cortex/auth::common.phone'), 'render' => 'data+(data ? (full.phone_verified ? " <i class=\"text-success fa fa-check\" title=\""+full.phone_verified_at+"\"></i>" : " <i class=\"text-danger fa fa-close\"></i>") : "")'], |
|
|
|
|
35
|
|
|
'country_code' => ['title' => trans('cortex/auth::common.country')], |
36
|
|
|
'language_code' => ['title' => trans('cortex/auth::common.language'), 'visible' => false], |
37
|
|
|
'title' => ['title' => trans('cortex/auth::common.title'), 'visible' => false], |
38
|
|
|
'birthday' => ['title' => trans('cortex/auth::common.birthday'), 'visible' => false], |
39
|
|
|
'gender' => ['title' => trans('cortex/auth::common.gender'), 'visible' => false], |
40
|
|
|
'last_activity' => ['title' => trans('cortex/auth::common.last_activity'), 'render' => "moment(data).format('MMM Do, YYYY')", 'visible' => false], |
|
|
|
|
41
|
|
|
'created_at' => ['title' => trans('cortex/auth::common.created_at'), 'render' => "moment(data).format('MMM Do, YYYY')"], |
|
|
|
|
42
|
|
|
'updated_at' => ['title' => trans('cortex/auth::common.updated_at'), 'render' => "moment(data).format('MMM Do, YYYY')"], |
|
|
|
|
43
|
|
|
]; |
44
|
|
|
} |
45
|
|
|
} |
46
|
|
|
|
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.