public function fieldsAbilities($model, $delimiter = '.', $fillable_only = false, $name = null)
    {
        if (is_string($model)) {
            $model = app($model);
        }
        if ($fillable_only) {
            $columns = $model->getFillable();
        } else {
            $columns = Schema::getColumnListing($model->getTable());
        }
        if (!$this->model_crud_abilities) {
            $name = $name ?: class_basename($model);
            $this->modelAbilities($name, $delimiter);
        }

        // create columns crud abilities
        foreach ($columns as $column) {
            foreach ($this->model_crud_abilities as $ability => $model_ability) {
                $this->fields_crud_abilities[$column][$ability] =
                    strtolower($model_ability.$delimiter.$column);
            }
        }

        return $this;
    }
public function fieldsAbilities($model, $delimiter = '.', $fillable_only = false, $name = null)
    {
        if (is_string($model)) {
            $model = app($model);
        }
        if ($fillable_only) {
            $columns = $model->getFillable();
        } else {
            $columns = Schema::getColumnListing($model->getTable());
        }
        if (!$this->model_crud_abilities) {
            $name = $name ?: class_basename($model);
            $this->modelAbilities($name, $delimiter);
        }

        // create columns crud abilities
        foreach ($columns as $column) {
            foreach ($this->model_crud_abilities as $ability => $model_ability) {
                $this->fields_crud_abilities[$column][$ability] =
                    strtolower($model_ability.$delimiter.$column);
            }
        }

        return $this;
    }
public function fieldsAbilities ( $ model , $ delimiter = '.' , $ fillable_only = false , $ name = null ) { if ( is_string ( $ model ) ) { $ model = app ( $ model ) ; } if ( $ fillable_only ) { $ columns = $ model -> getFillable ( ) ; } else { $ columns = Schema :: getColumnListing ( $ model -> getTable ( ) ) ; } if ( ! $ this -> model_crud_abilities ) { $ name = $ name ? : class_basename ( $ model ) ; $ this -> modelAbilities ( $ name , $ delimiter ) ; } // create columns crud abilities foreach ( $ columns as $ column ) { foreach ( $ this -> model_crud_abilities as $ ability => $ model_ability ) { $ this -> fields_crud_abilities [ $ column ] [ $ ability ] = strtolower ( $ model_ability . $ delimiter . $ column ) ; } } return $ this ; }
Generates an ability for each field for each model CRUD ability
ex. ClassName.create.field1, ClassName.create.field2,
ClassName.store.field2, ClassName.store.field2, ..etc.

@param $model
@param string $delimiter
@param bool   $fillable_only
@param string $name

@return $this
Generates an ability for each field for each model CRUD ability ex . ClassName . create . field1 ClassName . create . field2 ClassName . store . field2 ClassName . store . field2 .. etc .