dstpabuaran.com/app/Services/Admin/Master/SupplierService.php
Yoga Pangestu 8edeaf0db7 feat: implement supplier management with CRUD functionality
- Added SupplierController for handling supplier operations.
- Created SupplierRequest for validation of supplier data.
- Introduced SupplierService for business logic related to suppliers.
- Developed UI components for supplier management, including a data table and dialogs for creating and editing suppliers.
- Updated routes to include resourceful routes for suppliers.
- Added SupplierSeeder for populating initial supplier data.
- Implemented tests for supplier functionality, including creation, updating, and deletion.
2026-07-29 01:16:58 +07:00

32 lines
586 B
PHP

<?php
namespace App\Services\Admin\Master;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Collection;
class SupplierService
{
public function getAll(): Collection
{
return Supplier::latest()->get();
}
public function create(array $data): Supplier
{
return Supplier::create($data);
}
public function update(Supplier $supplier, array $data): Supplier
{
$supplier->update($data);
return $supplier;
}
public function delete(Supplier $supplier): bool
{
return $supplier->delete();
}
}