update fix deadcode, security

This commit is contained in:
baodev0
2026-09-28 08:26:29 +07:00
parent 3af59bd9c5
commit 82080b5b84
452 changed files with 4857 additions and 26289 deletions
@@ -1,63 +0,0 @@
<?php
namespace App\Repositories\Admin\Product;
use App\Models\Product;
use App\Repositories\BaseRepository;
use Illuminate\Support\Str;
class ProductRepository extends BaseRepository implements ProductRepositoryInterface
{
public function getModel()
{
return Product::class;
}
public function create(array $data = [])
{
if (empty($data['slug']) && !empty($data['name'])) {
$data['slug'] = Str::slug($data['name']);
}
return parent::create($data);
}
public function update(int $id = 0, array $data = [])
{
if (isset($data['name']) && empty($data['slug'])) {
$data['slug'] = Str::slug($data['name']);
}
return parent::update($id, $data);
}
public function filter(
array $data = [],
array $relationships = [],
array $withCount = [],
array $select = ['*'],
bool $returnQuery = false
) {
$query = $this->model
->select($select)
->with($relationships);
// if (!empty($data['vcenter_id'])) {
// $query->where('vcenter_id', $data['vcenter_id']);
// }
if (!empty($withCount)) {
$query->withCount($withCount);
}
if ($returnQuery) {
return $query;
}
if (!empty($data['paginate'])) {
return $query->paginate(
$data['per_page'] ?? 15
);
}
return $query->get();
}
}
@@ -1,16 +0,0 @@
<?php
namespace App\Repositories\Admin\Product;
use App\Repositories\BaseRepositoryInterface;
interface ProductRepositoryInterface extends BaseRepositoryInterface
{
public function filter(
array $data = [],
array $relationships = [],
array $withCount = [],
array $select = ['*'],
bool $returnQuery = false
);
}