Skip to content

Commit

Permalink
added asterisks to required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tabacitu committed Jul 7, 2018
1 parent d70af21 commit 3876de8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,12 @@ All Notable changes to `Backpack Generators` will be documented in this file
### Security
- Nothing

## 1.2.2 - 2018-06-22

### Fixed
- composer requirements;


## 1.2.1 - 2018-06-22

### Fixed
Expand Down
5 changes: 1 addition & 4 deletions composer.json
Expand Up @@ -19,10 +19,7 @@
}
],
"require": {
"backpack/base": "^0.9.0",
"illuminate/support": ">=5.1",
"illuminate/console": ">=5.1",
"php" : ">=5.5.0"
"backpack/base": "^0.9.0"
},
"require-dev": {
"phpunit/phpunit" : "4.*",
Expand Down
16 changes: 10 additions & 6 deletions src/Console/stubs/crud-controller.stub
Expand Up @@ -35,12 +35,6 @@ class DummyClassCrudController extends CrudController

$this->crud->setFromDb();

// ------ CRUD FIELDS
// $this->crud->addField($options, 'update/create/both');
// $this->crud->addFields($array_of_arrays, 'update/create/both');
// $this->crud->removeField('name', 'update/create/both');
// $this->crud->removeFields($array_of_names, 'update/create/both');

// ------ CRUD COLUMNS
// $this->crud->addColumn(); // add a single column, at the end of the stack
// $this->crud->addColumns(); // add multiple columns, at the end of the stack
Expand All @@ -49,6 +43,16 @@ class DummyClassCrudController extends CrudController
// $this->crud->setColumnDetails('column_name', ['attribute' => 'value']); // adjusts the properties of the passed in column (by name)
// $this->crud->setColumnsDetails(['column_1', 'column_2'], ['attribute' => 'value']);

// ------ CRUD FIELDS
// $this->crud->addField($options, 'update/create/both');
// $this->crud->addFields($array_of_arrays, 'update/create/both');
// $this->crud->removeField('name', 'update/create/both');
// $this->crud->removeFields($array_of_names, 'update/create/both');

// add asterisk for fields that are required in DummyClassRequest
$this->crud->setRequiredFields(StoreRequest::class, 'create');
$this->crud->setRequiredFields(UpdateRequest::class, 'edit');

// ------ CRUD BUTTONS
// possible positions: 'beginning' and 'end'; defaults to 'beginning' for the 'line' stack, 'end' for the others;
// $this->crud->addButton($stack, $name, $type, $content, $position); // add a button; possible types are: view, model_function
Expand Down

0 comments on commit 3876de8

Please sign in to comment.