fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
+8 -11
View File
@@ -13,9 +13,9 @@ class SupplierService
$query = Supplier::query();
if ($q !== '') {
$query->where(function ($builder) use ($q) {
$builder->where('name', 'like', '%'.$q.'%')
->orWhere('email', 'like', '%'.$q.'%')
->orWhere('phone', 'like', '%'.$q.'%');
$builder->where('name', 'like', '%' . $q . '%')
->orWhere('email', 'like', '%' . $q . '%')
->orWhere('phone', 'like', '%' . $q . '%');
});
}
@@ -37,8 +37,7 @@ class SupplierService
try {
$supplier = Supplier::query()->create($this->payload($data));
} catch (\Throwable $e) {
Log::error('Supplier create failed: '.$e->getMessage());
Log::error('Supplier create failed: ' . $e->getMessage());
return ['ok' => false, 'message' => 'Failed to save supplier.'];
}
@@ -48,15 +47,14 @@ class SupplierService
public function update(int $id, array $data): array
{
$supplier = Supplier::query()->find($id);
if (! $supplier) {
if (!$supplier) {
return ['ok' => false, 'message' => 'Supplier not found.'];
}
try {
$supplier->update($this->payload($data));
} catch (\Throwable $e) {
Log::error('Supplier update failed: '.$e->getMessage());
Log::error('Supplier update failed: ' . $e->getMessage());
return ['ok' => false, 'message' => 'Failed to update supplier.'];
}
@@ -66,15 +64,14 @@ class SupplierService
public function delete(int $id): array
{
$supplier = Supplier::query()->find($id);
if (! $supplier) {
if (!$supplier) {
return ['ok' => false, 'message' => 'Supplier not found.'];
}
try {
$supplier->delete();
} catch (\Throwable $e) {
Log::error('Supplier delete failed: '.$e->getMessage());
Log::error('Supplier delete failed: ' . $e->getMessage());
return ['ok' => false, 'message' => 'Failed to delete supplier.'];
}