Fix API key creation logic

This commit is contained in:
Dane Everitt 2020-03-28 16:06:36 -07:00
parent ff49165447
commit e4e5dea6b8
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 68 additions and 57 deletions

View file

@ -140,7 +140,12 @@ abstract class Validable extends Model
}
return $this->getValidator()->setData(
$this->toArray()
// Trying to do self::toArray() here will leave out keys based on the whitelist/blacklist
// for that model. Doing this will return all of the attributes in a format that can
// properly be validated.
$this->addCastAttributesToArray(
$this->getAttributes(), $this->getMutatedAttributes()
)
)->passes();
}
}