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,14 +2,8 @@
namespace App\Repositories\Shop;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Yajra\DataTables\DataTables;
use App\Models\Shop\Article;
use App\Models\Shop\Price;
use Yajra\DataTables\DataTables;
class Prices
{
@@ -17,12 +11,14 @@ class Prices
{
$data['prices'] = Price::byArticle($id)->notGeneric()->get()->toArray();
$data['generics'] = Price::byArticle($id)->generic()->with(['generic.prices', 'generic.category'])->get()->toArray();
return $data;
}
public static function getDatatable()
{
$model = Price::orderBy('name');
return Datatables::of($model)->make(true);
}
@@ -40,6 +36,7 @@ class Prices
{
$id = isset($data['id']) ? $data['id'] : false;
$item = $id ? self::update($data) : self::create($data);
return $item->id;
}
@@ -53,6 +50,7 @@ class Prices
$id = $id ? $id : $data['id'];
$item = self::get($id);
$item->update($data);
return $item;
}