this makes possible adding extra attributes to models

This commit is contained in:
Sevan Nerse
2021-02-26 17:16:48 +03:00
parent 962e626c9e
commit 5878c96c3a
16 changed files with 54 additions and 99 deletions

View File

@ -28,7 +28,7 @@ class Company extends Eloquent
'enabled' => 'boolean',
];
public $extras = [
public $allAttributes = [
//
];
@ -39,6 +39,19 @@ class Company extends Eloquent
*/
public $sortable = ['name', 'domain', 'email', 'enabled', 'created_at'];
/**
* Create a new Eloquent model instance.
*
* @param array $attributes
* @return void
*/
public function __construct(array $attributes = [])
{
$this->allAttributes = $attributes;
parent::__construct($attributes);
}
public static function boot()
{
parent::boot();