TransactionCreated::class, 'deleted' => TransactionDeleted::class, 'restored' => TransactionRestored::class, 'updated' => TransactionUpdated::class, ]; /** * The table associated with the model. * * @var string */ protected $table = Transaction::TABLE; /** * The primary key associated with the table. * * @var string */ protected $primaryKey = Transaction::ATTRIBUTE_ID; /** * The attributes that should be cast. * * @var array */ protected $casts = [ Transaction::ATTRIBUTE_AMOUNT => 'decimal:2', Transaction::ATTRIBUTE_DATE => 'date:Y-m-d', Transaction::ATTRIBUTE_SERVICE => Service::class, ]; /** * Get name. * * @return string */ public function getName(): string { return Str::of($this->service->description) ->append(' ') ->append($this->date->format(AllowedDateFormat::YMD)) ->__toString(); } }