예제 #1
0
 /**
  * Returns a new grid instance of all available groups.
  *
  * @return \Cartalyst\DataGrid\DataGrid
  */
 public function grid()
 {
     $columns = ['id', 'name', 'created_at'];
     $settings = ['sort' => 'created_at', 'direction' => 'desc', 'threshold' => 10, 'throttle' => 11];
     $transformer = function (Role $role) {
         return ['name' => $role->name, 'created_at' => $role->created_at->format('Y-m-d g:i a'), 'view_url' => route('maintenance.admin.roles.show', [$role->id])];
     };
     return $this->role->grid($columns, $settings, $transformer);
 }