add shipping rules
This commit is contained in:
@@ -3,14 +3,19 @@
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use \Venturecraft\Revisionable\RevisionableTrait;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
|
||||
class DeliveryPackage extends Model
|
||||
{
|
||||
use RevisionableTrait, SoftDeletes, Userstamps;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $table = 'shop_delivery_packages';
|
||||
|
||||
public function scopeByWeight($query, $weight)
|
||||
{
|
||||
return $query->orderBy('weight')->where($this->table . '.weight', '>=', $weight);
|
||||
}
|
||||
|
||||
protected $revisionEnabled = true;
|
||||
|
||||
protected $keepRevisionOf = ['weight', 'weight_flyer', 'weight_packaging'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user