This commit is contained in:
F4ilji
2026-04-07 17:54:26 +05:00
parent 04adba6682
commit 936b1fb5b0
468 changed files with 43498 additions and 4176 deletions
@@ -0,0 +1,30 @@
<?php
namespace App\Containers\Dashboard\Actions\Departments;
use App\Containers\InstituteStructure\Models\Department;
class ListDepartmentTeachersAction
{
public function run(Department $department, array $filters = []): array
{
$query = $department->teachers();
// Поиск по имени
if (!empty($filters['search'])) {
$query->where('name', 'like', '%' . $filters['search'] . '%');
}
// Фильтр по должности
if (!empty($filters['position'])) {
$query->where('teaching_position', 'like', '%' . $filters['position'] . '%');
}
$teachers = $query->orderBy('teachers_departments.sort')->paginate(20)->withQueryString();
return [
'teachers' => $teachers,
'filters' => $filters,
];
}
}