You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
516 B
21 lines
516 B
<?php
|
|
|
|
namespace App\Domains\Academic\Queries\Selection;
|
|
|
|
use App\Domains\Academic\Models\StudyProgram;
|
|
use Illuminate\Support\Collection;
|
|
|
|
class SelectStudyProgramQuery
|
|
{
|
|
public static function fetch(array $context = []): Collection
|
|
{
|
|
if(!isset($context['faculty'])) {
|
|
return new Collection();
|
|
}
|
|
|
|
return once(fn() => StudyProgram::select('id', 'name')
|
|
->where('faculty_id', $context['faculty'])
|
|
->get()
|
|
->pluck('name', 'id'));
|
|
}
|
|
}
|
|
|