Skip to content

Commit

Permalink
Get default value from the route element
Browse files Browse the repository at this point in the history
  • Loading branch information
eliurkis committed Jan 27, 2018
1 parent c703ef9 commit 5f521e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ protected function prepareField($name, $properties = [])
? isset($properties['value_alias'])
? $this->entityInstance->{$properties['value_alias']}
: $this->entityInstance->$name
: (isset($config['default_value']) ? $config['default_value'] : null);
: ($this->fields[$name]['default_value'] ?? null);

// Define field type class namespace
$className = '\Eliurkis\Crud\FieldTypes\\'.ucfirst($properties['type']);
Expand Down

0 comments on commit 5f521e9

Please sign in to comment.