add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 297dcc62d2
commit 39c80ce6d1
459 changed files with 6219 additions and 5416 deletions

View File

@@ -2,23 +2,32 @@
namespace App\Models\Shop;
use App\Traits\Model\Imageable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\HasMedia;
use Rinvex\Tags\Traits\Taggable;
use Kirschbaum\PowerJoins\PowerJoins;
use Rinvex\Tags\Traits\Taggable;
use Spatie\MediaLibrary\HasMedia;
use Wildside\Userstamps\Userstamps;
use App\Traits\Model\Imageable;
use Venturecraft\Revisionable\RevisionableTrait;
class Merchandise extends Model implements HasMedia
{
use Imageable, PowerJoins, SoftDeletes, Taggable, UserStamps;
use Imageable, PowerJoins, RevisionableTrait, SoftDeletes, Taggable, UserStamps;
protected $guarded = ['id'];
protected $table = 'shop_merchandises';
protected $revisionEnabled = true;
protected $keepRevisionOf = [
'producer_id',
'name',
'description',
'plus',
];
public function Articles()
{
return $this->morphMany(Article::class, 'product');
@@ -34,8 +43,8 @@ class Merchandise extends Model implements HasMedia
return $this->morphToMany(Tag::class, 'taggable');
}
public function scopeByProducer($query, $producer_id)
public function scopeByProducer($query, $producerId)
{
return $query->where('producer_id', $producer_id);
return $query->where('producer_id', $producerId);
}
}