api code global jain
This commit is contained in:
40
app/Http/Requests/Chaturmas/UpdateChaturmasRequest.php
Normal file
40
app/Http/Requests/Chaturmas/UpdateChaturmasRequest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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),
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user