fix owned url
This commit is contained in:
parent
0afc8911db
commit
83b01a84df
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue