forked from aslan/applicant-site
36 lines
871 B
PHP
36 lines
871 B
PHP
<?php
|
|
|
|
namespace App\Helpers;
|
|
|
|
use App\Models\Direction;
|
|
use App\Models\DirectionProfile;
|
|
use App\Models\Faculty;
|
|
use App\Models\EducationalInstitution;
|
|
|
|
class PositionHelper
|
|
{
|
|
public static function faculty()
|
|
{
|
|
$maxPosition = Faculty::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function direction()
|
|
{
|
|
$maxPosition = Direction::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function educationalInstitution()
|
|
{
|
|
$maxPosition = EducationalInstitution::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function directionProfiles()
|
|
{
|
|
$maxPosition = DirectionProfile::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
}
|