2024-03-04 17:24:12 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Helpers;
|
|
|
|
|
2024-03-06 17:11:35 +03:00
|
|
|
use App\Models\Direction;
|
2024-03-12 11:22:37 +03:00
|
|
|
use App\Models\DirectionProfile;
|
2024-06-11 10:18:38 +03:00
|
|
|
use App\Models\Document;
|
2024-03-13 10:26:59 +03:00
|
|
|
use App\Models\EntranceExamination;
|
2024-03-12 14:36:35 +03:00
|
|
|
use App\Models\ExaminationType;
|
2024-03-04 17:24:12 +03:00
|
|
|
use App\Models\Faculty;
|
2024-03-12 09:32:57 +03:00
|
|
|
use App\Models\EducationalInstitution;
|
2024-03-12 12:40:05 +03:00
|
|
|
use App\Models\SubjectType;
|
2024-03-12 13:50:42 +03:00
|
|
|
use App\Models\Subject;
|
2024-03-04 17:24:12 +03:00
|
|
|
|
|
|
|
class PositionHelper
|
|
|
|
{
|
|
|
|
public static function faculty()
|
|
|
|
{
|
|
|
|
$maxPosition = Faculty::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-06 17:11:35 +03:00
|
|
|
|
|
|
|
public static function direction()
|
|
|
|
{
|
|
|
|
$maxPosition = Direction::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-12 09:32:57 +03:00
|
|
|
|
|
|
|
public static function educationalInstitution()
|
|
|
|
{
|
|
|
|
$maxPosition = EducationalInstitution::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-12 11:22:37 +03:00
|
|
|
|
2024-03-12 12:40:05 +03:00
|
|
|
public static function directionProfile()
|
2024-03-12 11:22:37 +03:00
|
|
|
{
|
|
|
|
$maxPosition = DirectionProfile::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-12 12:40:05 +03:00
|
|
|
|
|
|
|
public static function subjectType()
|
|
|
|
{
|
|
|
|
$maxPosition = SubjectType::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-12 13:50:42 +03:00
|
|
|
|
|
|
|
public static function subject()
|
|
|
|
{
|
|
|
|
$maxPosition = Subject::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-12 14:36:35 +03:00
|
|
|
|
|
|
|
public static function examinationType()
|
|
|
|
{
|
|
|
|
$maxPosition = ExaminationType::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-13 10:26:59 +03:00
|
|
|
|
|
|
|
public static function entranceExamination()
|
|
|
|
{
|
|
|
|
$maxPosition = EntranceExamination::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-13 10:56:14 +03:00
|
|
|
|
|
|
|
public static function department()
|
|
|
|
{
|
|
|
|
$maxPosition = EntranceExamination::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-06-11 10:18:38 +03:00
|
|
|
|
|
|
|
public static function document()
|
|
|
|
{
|
|
|
|
$maxPosition = Document::max('position');
|
|
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
|
|
}
|
2024-03-04 17:24:12 +03:00
|
|
|
}
|