better management of shipping and basket summary display
This commit is contained in:
@@ -3,9 +3,12 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Homepage;
|
||||
use App\Traits\Model\Basic;
|
||||
|
||||
class Homepages
|
||||
{
|
||||
use Basic;
|
||||
|
||||
public static function getLast()
|
||||
{
|
||||
$model = Homepage::latest('id')->first();
|
||||
@@ -28,34 +31,8 @@ class Homepages
|
||||
return self::get(3)->text ?? '';
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
public static function getModel()
|
||||
{
|
||||
return Homepage::find($id);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$item = ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
||||
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Homepage::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Homepage::destroy($id);
|
||||
return Homepage::query();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user