mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
feafbd9826
* Datamapping JSON Settings * JSON Mapping * User Setting Defaults * Testing Json Mapper * Implemented User Settings - hydrated from JSON format
34 lines
607 B
PHP
34 lines
607 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class CompanyUser extends BaseModel
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'settings' => 'collection',
|
|
];
|
|
|
|
public function account()
|
|
{
|
|
return $this->hasOne(Account::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->hasOne(User::class)->withPivot('permissions', 'settings');
|
|
}
|
|
|
|
public function company()
|
|
{
|
|
return $this->hasOne(Company::class)->withPivot('permissions', 'settings');
|
|
}
|
|
}
|