Build form for merchandise

This commit is contained in:
Ludovic CANDELLIER
2022-04-14 23:41:58 +02:00
parent c2ef0c7b35
commit 68a13b7a58
5 changed files with 89 additions and 22 deletions

View File

@@ -3,12 +3,18 @@
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\HasMedia;
use Rinvex\Tags\Traits\Taggable;
use Kirschbaum\PowerJoins\PowerJoins;
use Wildside\Userstamps\Userstamps;
class Merchandise extends Model
use App\Traits\Model\Imageable;
class Merchandise extends Model implements HasMedia
{
use Taggable;
use Imageable, PowerJoins, SoftDeletes, Taggable, UserStamps;
protected $guarded = ['id'];
protected $table = 'shop_merchandises';
@@ -17,4 +23,9 @@ class Merchandise extends Model
{
return $this->morphMany(Article::class, 'product');
}
public function tags()
{
return $this->morphToMany('App\Models\Shop\Tag', 'taggable');
}
}