*/ use HasFactory; use HasUuids; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'is_public' => 'bool', 'public_until' => 'datetime', 'properties' => ReportPropertiesDto::class, ]; public function getShareableLink(): ?string { if ($this->is_public && $this->share_secret !== null) { return route('shared-report').'#'.$this->share_secret; } return null; } /** * @return BelongsTo */ public function organization(): BelongsTo { return $this->belongsTo(Organization::class, 'organization_id'); } }