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

@ -20,12 +20,25 @@ class Setting extends Eloquent
*/
protected $fillable = ['company_id', 'key', 'value'];
public $extras = [
public $allAttributes = [
//
];
public $timestamps = false;
/**
* Create a new Eloquent model instance.
*
* @param array $attributes
* @return void
*/
public function __construct(array $attributes = [])
{
$this->allAttributes = $attributes;
parent::__construct($attributes);
}
public function company()
{
return $this->belongsTo('App\Models\Common\Company');