Roman_applicant-site/app/Http/Controllers/DirectionForTildaController...

100 lines
2.4 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Enums\ExaminationTypeEnum;
use App\Models\Direction;
use App\Models\Faculty;
use Illuminate\Http\Request;
use Spatie\QueryBuilder\QueryBuilder;
class DirectionForTildaController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$directions = QueryBuilder::for(Direction::class)
->allowedFilters('name')
->orderBy('id', 'desc')->get();
// $directions = Direction::all()->sortBy('created_at', SORT_REGULAR, true);
$filter = $request->filter ?? null;
return view('new-design.tilda.index', compact('directions', 'filter'));
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(Direction $direction)
{
// $department = $direction->department;
// $faculty = Faculty::find($department->faculty->id);
// $educationalInstitution = $faculty->educationalInstitution;
//
// $ege = $direction
// ->entranceExaminations
// ->where('examination_type_id', '=', ExaminationTypeEnum::Ege->value)
// ->sortBy('position')
// ->pluck('scores', 'subject_id');
//
// $spo = $direction
// ->entranceExaminations->where('examination_type_id', '=', ExaminationTypeEnum::Spo->value)
// ->sortBy('position')
// ->pluck('scores', 'subject_id');
//
// $magistracy = $direction
// ->entranceExaminations
// ->where('examination_type_id', '=', ExaminationTypeEnum::Magistracy->value)
// ->sortBy('position')
// ->pluck('scores', 'subject_id');
return view(
'new-design.tilda.show',
compact(
'direction'
)
);
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}