Trait isnt recognized

So I created my own Trait, and it seems like it isnt recognized by the blade file:
<?php

namespace Filament\Support\Concerns;

use Closure;
use Illuminate\Contracts\Support\Htmlable;

trait HasDuration
{
    protected string|float|Closure|null $duration = null;

    public function duration(string|Htmlable|float|Closure|null $duration = null): static
    {
        $this->duration = $duration;
        return $this;
    }

    public function getDuration(): float|null|Htmlable
    {
        dd($this->duration);
        return $this->evaluate($this->duration);
    }
}

I added the trait to the Section php file:
<?php

namespace Filament\Forms\Components;

// ...
use Filament\Support\Concerns\HasDuration;
// ...
class Section extends Component implements Contracts\CanConcealComponents, Contracts\CanEntangleWithSingularRelationships
{
    use Concerns\CanBeCollapsed;
    use Concerns\CanBeCompacted;
    use Concerns\EntanglesStateWithSingularRelationship;
    use HasDescription;
    use HasDuration;
    use HasExtraAlpineAttributes;
    use HasHeading;
    use HasIcon;
    use HasIconColor;
  // ...
}
Solution
Make sure you add
:duration="$getDuration()" to the proper file
Was this page helpful?