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-04 17:24:12 +03:00
|
|
|
use App\Models\Faculty;
|
|
|
|
|
|
|
|
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-04 17:24:12 +03:00
|
|
|
}
|