73 lines
2.1 KiB
PHP
73 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreLeadRequest 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' => 'required',
|
|
'lead_owner' => 'required',
|
|
'products_id' => 'required',
|
|
'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',
|
|
];
|
|
}
|
|
|
|
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.'
|
|
];
|
|
}
|
|
}
|