*/ protected $fillable = [ 'contact_id', 'name', 'active', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'active' => 'boolean', ]; /** * Get the contact associated with the goal. */ public function contact(): BelongsTo { return $this->belongsTo(Contact::class); } /** * Get the streaks associated with the goal. */ public function streaks(): HasMany { return $this->hasMany(Streak::class); } /** * Get the goal's feed item. */ public function feedItem(): MorphOne { return $this->morphOne(ContactFeedItem::class, 'feedable'); } }