api code global jain
This commit is contained in:
45
app/Http/Requests/Api/Chaturmas/UpdateChaturmasRequest.php
Normal file
45
app/Http/Requests/Api/Chaturmas/UpdateChaturmasRequest.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Chaturmas;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
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()
|
||||
{
|
||||
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.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user