fix owned url

This commit is contained in:
Marley Rae 2022-04-28 12:26:55 -07:00
parent 0afc8911db
commit 83b01a84df

View file

@ -5,6 +5,7 @@
use App\Traits\Categorizable;
use App\Traits\Imageable;
use App\Traits\Ownable;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
@ -28,6 +29,15 @@ class Owned extends Model
// injected by trait: categories (many-to-many polymorphic)
/* --------------------------------------------------------------------------------- url ---- */
protected function url() : Attribute
{
return Attribute::make(
get: fn () => "/{$this->slug}",
);
}
/* ------------------------------------------------------------------------------- store ---- */
public static function store(array $validated) : static