Files
Global-Jain/app/Http/Requests/Chaturmas/UpdateChaturmasRequest.php
2025-11-05 10:37:10 +05:30

41 lines
942 B
PHP

<?php
namespace App\Http\Requests\Chaturmas;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
class UpdateChaturmasRequest 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(Request $request)
{
return [
'place' => 'required',
'chaturmas_date_id' => [
'required',
'exists:chaturmas_dates,id',
'date_format:Y',
Rule::unique('chaturmas', 'chaturmas_date_id')
->where('sant_id', $this->chaturma->sant_id)
->ignore($this->chaturma->id),
]
];
}
}