add shipping rules
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user