示例#1
0
 /**
  * Display ajax response.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function ajax()
 {
     return $this->datatables->eloquent($this->query())->addColumn('action', 'administrator.extensions.datatables.action')->editColumn('name', function ($extension) {
         return "<h3 class=\"lead no-margin text-blue\">{$extension->name} <small>{$extension->version}</small></h3>\n                            <p>{$extension->description}</p>";
     })->editColumn('type', function ($extension) {
         return dt_label($extension->type, 'danger');
     })->editColumn('enabled', function ($extension) {
         return dt_check($extension->enabled);
     })->make(true);
 }
示例#2
0
 /**
  * @return \Illuminate\Http\JsonResponse
  */
 public function ajax()
 {
     return $this->datatables->eloquent($this->query())->addColumn('roles', function (Permission $permission) {
         return dt_label($permission->roles()->count());
     })->addColumn('roles', function (Permission $permission) {
         return view('administrator.permissions.datatables.roles', compact('permission'))->render();
     })->editColumn('system', function (Permission $permission) {
         return dt_check($permission->system);
     })->editColumn('slug', function (Permission $permission) {
         return '<small>' . $permission->slug . '</small>';
     })->addColumn('action', 'administrator.permissions.datatables.action')->make(true);
 }