Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek committed Mar 3, 2019
1 parent 4ed7d84 commit bf85e7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/Commands/Bases/ControllerCommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,8 @@ protected function getCommandInput()
'modelName',
'prefix',
'perPage',
'fileSnippet',
'modelDirectory',
'langFile',
'fields',
'withFormRequest',
'formRequestName',
'force',
Expand Down
5 changes: 4 additions & 1 deletion src/Support/FieldOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function optimizeStringField()
*/
protected function optimizeRequiredField()
{
if (!array_key_exists('is-nullable', $this->meta) && ($this->parser->isNullable() || !$this->parser->isRequired() || $this->parser->isConditionalRequired())) {
if (!array_key_exists('is-nullable', $this->meta) && !$this->field->isPrimary() && ($this->parser->isNullable() || !$this->parser->isRequired() || $this->parser->isConditionalRequired())) {
$this->field->isNullable = true;
}

Expand Down Expand Up @@ -209,6 +209,9 @@ protected function optimizeBoolean()
protected function optimizePrimaryKey()
{
if ($this->field->isPrimary()) {

$this->field->isNullable = false;

if ($this->meta == null) {
$this->field->isOnFormView = false;
$this->field->isOnIndexView = false;
Expand Down

0 comments on commit bf85e7f

Please sign in to comment.