dstpabuaran.com/app/Services/Admin/Master/CustomerService.php
Yoga Pangestu 5c1ef6a7b0 feat: add customer management functionality and update navigation
- Introduced CustomerController for handling customer operations.
- Added resourceful routes for customers in the web routes.
- Updated DatabaseSeeder to include CustomerSeeder for initial data population.
- Modified sidebar navigation to link to the customers index.
2026-07-29 01:30:29 +07:00

32 lines
586 B
PHP

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