api code global jain
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\PassiveUser;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePassiveUserRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'relationship' => 'required',
|
||||
'birth_date' => 'required|date_format:Y-m-d|lessThan:14',
|
||||
'avatar' => 'mimes:jpeg,png,jpg',
|
||||
// 'school_name' => 'required',
|
||||
// 'about' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation messages that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'birth_date.less_than' => "Age must me less than 14 years",
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user