Last commit before showcase.

This commit is contained in:
Simon Pocrnjič
2024-11-14 21:02:10 +01:00
parent 953ff38d64
commit ad8b3c07e1
16 changed files with 302 additions and 143 deletions
+17
View File
@@ -12,12 +12,29 @@ class PersonPhone extends Model
/** @use HasFactory<\Database\Factories\Person/PersonPhoneFactory> */
use HasFactory;
protected $fillable = [
'nu',
'country_code',
'type_id',
'description',
'person_id',
'user_id'
];
protected $hidden = [
'user_id',
'person_id',
'deleted'
];
protected static function booted(){
static::creating(function (PersonPhone $personPhone) {
if(!isset($personPhone->user_id)){
$personPhone->user_id = auth()->id();
}
});
}
public function person(): BelongsTo
{
return $this->belongsTo(\App\Models\Person\Person::class);