public function getIndex() { $config = Config::select(['id', 'name', 'value'])->live()->orderBy('id', 'DESC'); return Datatables::of($config)->add_column('actions', function ($row) { return permshtml('settings/config/' . $row->id . '/edit', '<a href="' . url('settings/config/' . $row->id . '/edit') . '" class="btn btn-xs btn-default">' . trans('app.edit') . '</a>') . " " . permshtml('settings/config/' . $row->id, '<a href="' . url('settings/config/' . $row->id) . '" data-token="' . csrf_token() . '" class="del-item btn btn-xs btn-danger">' . trans('app.delete') . '</a>', "delete"); })->removeColumn('id')->make(); }
public function getIndex() { $users = User::select(['id', 'name', 'surname', 'email'])->live()->orderBy('id', 'DESC'); return Datatables::of($users)->add_column('groups', function ($user) { return implode(', ', $user->Groups()->lists('name')->all()); })->add_column('actions', function ($row) { return permshtml('settings/users/' . $row->id . '/edit', '<a href="' . url('settings/users/' . $row->id . '/edit') . '" class="btn btn-xs btn-default">' . trans('app.edit') . '</a>') . " " . permshtml('settings/users/' . $row->id, '<a href="' . url('settings/users/' . $row->id) . '" data-token="' . csrf_token() . '" class="del-item btn btn-xs btn-danger">' . trans('app.delete') . '</a>', "delete"); })->removeColumn('id')->make(); }