for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Cortex\Auth\DataTables\Adminarea;
use Cortex\Auth\Models\Role;
use Cortex\Foundation\DataTables\AbstractDataTable;
class RolesDataTable extends AbstractDataTable
{
/**
* {@inheritdoc}
*/
protected $model = Role::class;
* Display ajax response.
*
* @return \Illuminate\Http\JsonResponse
public function ajax()
return datatables($this->query())
->orderColumn('title', 'title->"$.'.app()->getLocale().'" $1')
->make(true);
}
* Get columns.
* @return array
protected function getColumns(): array
$link = config('cortex.foundation.route.locale_prefix')
? '"<a href=\""+routes.route(\'adminarea.roles.edit\', {role: full.id, locale: \''.$this->request->segment(1).'\'})+"\">"+data+"</a>"'
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.
: '"<a href=\""+routes.route(\'adminarea.roles.edit\', {role: full.id})+"\">"+data+"</a>"';
return [
'title' => ['title' => trans('cortex/auth::common.title'), 'render' => $link, 'responsivePriority' => 0],
'name' => ['title' => trans('cortex/auth::common.name')],
'created_at' => ['title' => trans('cortex/auth::common.created_at'), 'render' => "moment(data).format('MMM Do, YYYY')"],
'updated_at' => ['title' => trans('cortex/auth::common.updated_at'), 'render' => "moment(data).format('MMM Do, YYYY')"],
];
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.