| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/lhvpraktani.in/phire-dekha-2026/app/Models/ |
Upload File : |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Registration extends Model
{
protected $fillable = [
'full_name',
'phone',
'passing_year',
'participation_type',
'food_type',
'guests',
'base_fee',
'discount',
'guest_fee',
'grand_total',
'payment_screenshot_path',
];
public const TYPE_FULL_TIME = 'full_time';
public const TYPE_TILL_NOON = 'till_noon';
public const FOOD_NON_VEG = 'non_veg';
public const FOOD_VEG = 'veg';
public static function allowedParticipationTypes(): array
{
return [self::TYPE_FULL_TIME, self::TYPE_TILL_NOON];
}
public static function allowedFoodTypes(): array
{
return [self::FOOD_NON_VEG, self::FOOD_VEG];
}
/**
* Base fee pricing.
*
* Implemented (logical correction):
* - Full Time + year < 2015 => 1000
* - Till Noon + year < 2015 => 500
* - Full Time + year >= 2015 => 500
* - Till Noon + year >= 2015 => 300
*/
public static function baseFee(string $participationType, int $passingYear): int
{
$isOldBatch = $passingYear < 2015;
if ($participationType === self::TYPE_FULL_TIME && $isOldBatch) {
return 1000;
}
if ($participationType === self::TYPE_TILL_NOON && $isOldBatch) {
return 500;
}
if ($participationType === self::TYPE_FULL_TIME && !$isOldBatch) {
return 500;
}
// Till Noon + year >= 2015
return 300;
}
}