add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 72a7b270f9
commit 0879b0abf0
459 changed files with 6219 additions and 5416 deletions

View File

@@ -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'];
}