$userSubjects * @property-read Collection $insights */ class Subject extends Model { /** @var array */ protected $fillable = [ 'user_id', 'name', 'description', 'introduction', 'message_type', 'custom_instructions', 'is_system', 'is_active', ]; /** @var array */ protected $casts = [ 'is_system' => 'boolean', 'is_active' => 'boolean', ]; /** * Get the user who created the subject. */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the user subjects associated with this subject. */ public function userSubjects(): HasMany { return $this->hasMany(UserSubject::class); } /** * Get the insights associated with this subject. */ public function insights(): HasMany { return $this->hasMany(Insight::class); } }