Files
Global-Jain/app/Http/Requests/Api/Chaturmas/StoreChaturmasRequest.php

46 lines
948 B
PHP
Raw Normal View History

2025-11-05 10:37:10 +05:30
<?php
namespace App\Http\Requests\Api\Chaturmas;
use Illuminate\Foundation\Http\FormRequest;
class StoreChaturmasRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'sant_id' => 'exists:sants,id',
'sagh_id' => 'exists:sanghs,id',
'place' => 'nullable',
'year' => 'required|exists:chaturmas_dates,id|date_format:Y',
];
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function message()
{
return [
'year.exists' => 'Chaturmas already exist for selected year.',
];
}
}