upload foto, dan bugs import
This commit is contained in:
@@ -26,6 +26,10 @@ class Corporate extends Model
|
||||
'linking_rules' => 'array',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'avatar_url',
|
||||
];
|
||||
|
||||
public function imports()
|
||||
{
|
||||
return $this->morphMany(ImportLog::class, 'importable');
|
||||
@@ -36,6 +40,16 @@ class Corporate extends Model
|
||||
return $this->morphMany(File::class, 'fileable');
|
||||
}
|
||||
|
||||
public function avatar()
|
||||
{
|
||||
return $this->morphOne(File::class, 'fileable')->where('type', 'avatar')->latest();
|
||||
}
|
||||
|
||||
public function getAvatarUrlAttribute()
|
||||
{
|
||||
return $this->avatar ? $this->avatar->url : null;
|
||||
}
|
||||
|
||||
public function plans()
|
||||
{
|
||||
return $this->hasMany(Plan::class, 'corporate_id', 'id');
|
||||
|
||||
@@ -22,6 +22,8 @@ class Person extends Model
|
||||
'gender',
|
||||
'birth_date',
|
||||
'birth_place',
|
||||
'language',
|
||||
'race',
|
||||
'citizenship',
|
||||
'current_employment',
|
||||
'last_education',
|
||||
|
||||
Reference in New Issue
Block a user