|bool */ protected $guarded = ['id']; /** * The attributes that should be mutated to dates. * * @var array */ protected $dates = ['written_at']; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'written_by_me' => 'boolean', ]; /** * Get the account record associated with the message. * * @return BelongsTo */ public function account() { return $this->belongsTo(Account::class); } /** * Get the contact record associated with the message. * * @return BelongsTo */ public function contact() { return $this->belongsTo(Contact::class); } /** * Get the Conversation records associated with the message. * * @return BelongsTo */ public function conversation() { return $this->belongsTo(Conversation::class); } }