Files
freeu-project/app/Http/Requests/UpdateLeadRequest.php
Ritikesh yadav c906256bd6 fix changes
2024-04-03 19:35:22 +05:30

75 lines
2.2 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateLeadRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get custom attributes for validator errors.
*
* @return array
*/
public function attributes()
{
return [
'users_id' => 'users',
'products_id' => 'product'
];
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'users_id' => 'nullable',
'lead_owner' => 'required',
'products_id' => 'nullable',
'lead_company' => 'nullable|string|max:255',
'first_name' => 'nullable|string|max:255',
'last_name' => 'nullable|string|max:255',
'title' => 'nullable|string|max:255',
'email' => 'nullable|email',
'phone' => 'nullable|numeric|digits:10',
'mobile' => 'nullable|numeric|digits:10',
'website' => 'nullable|string',
'industry' => 'nullable|string|max:255',
'total_employees' => 'nullable|numeric',
'annual_revenue' => 'nullable|string|max:255',
'street' => 'nullable|string|max:255',
'city' => 'nullable|string|max:255',
'state' => 'nullable|string|max:255',
'zip_code' => 'nullable|numeric|digits:6',
'country' => 'nullable|string|max:255',
'description' => 'nullable|string',
'lead_status' => 'nullable|string',
'lead_source' => 'nullable|string',
];
}
public function messages(){
return [
'required' => 'The :attribute field is required.',
'string' => 'The :attribute field must be string.',
'max' => 'The :attribute field must be only :max characters.',
'digits' => 'The :attribute field must be only :digits digits.',
'numeric' => 'The :attribute field must be numbers.'
];
}
}