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

@@ -2,8 +2,8 @@
namespace App\Repositories\Shop;
use App\Repositories\Core\Tag;
use App\Models\Shop\Merchandise;
use App\Repositories\Core\Tag;
use App\Traits\Repository\Imageable;
class Merchandises
@@ -17,6 +17,7 @@ class Merchandises
foreach ($data as $key => $name) {
$export[] = ['value' => $key, 'text' => $name];
}
return $export;
}
@@ -37,7 +38,7 @@ class Merchandises
public static function getStatuses()
{
return ['Actif','Suspendu','Invisible','Obsolete'];
return ['Actif', 'Suspendu', 'Invisible', 'Obsolete'];
}
public static function getAll()
@@ -53,6 +54,7 @@ class Merchandises
public static function getFull($id)
{
$data = self::get($id)->toArray();
return $data;
}
@@ -65,6 +67,7 @@ class Merchandises
{
$id = isset($data['id']) ? $data['id'] : false;
$item = $id ? self::update($data, $id) : self::create($data);
return $item;
}
@@ -77,6 +80,7 @@ class Merchandises
$merchandise = self::store($data);
self::storeImages($merchandise, $images);
self::storeTags($merchandise, $tags);
return $merchandise;
}
@@ -95,6 +99,7 @@ class Merchandises
$id = $id ? $id : $data['id'];
$item = self::get($id);
$item->update($data);
return $item;
}