SectorService.php 351 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Services;
  3. use App\Models\Sector;
  4. use Illuminate\Database\Eloquent\Collection;
  5. class SectorService
  6. {
  7. public function getAllItems(): Collection
  8. {
  9. return Sector::where('active', true)->orderBy('name')->get();
  10. }
  11. public function getItem(int $id): Sector
  12. {
  13. return Sector::findOrFail($id);
  14. }
  15. }