<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Member extends Model {
    protected $fillable=['organization_id','full_name','nickname','title_prefix','title_suffix','position','whatsapp','email','address','photo_path','sk_number','period_start','period_end','is_active'];
    protected $casts=['period_start'=>'date','period_end'=>'date','is_active'=>'boolean'];
    public function organization(){ return $this->belongsTo(Organization::class); }
    public function getDisplayNameAttribute(): string { return trim(implode(' ', array_filter([$this->title_prefix,$this->full_name,$this->title_suffix]))); }
}
