Files
freeu-project/app/Http/Requests/StoreLeadRequest.php

73 lines
2.1 KiB
PHP
Raw Permalink Normal View History

2024-03-28 14:52:40 +05:30
<?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 [
2024-06-17 12:54:10 +05:30
// 'users_id' => 'required',
2024-03-28 14:52:40 +05:30
'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',
2024-05-31 15:10:50 +05:30
'lead_source' => 'nullable|string',
2024-03-28 14:52:40 +05:30
];
}
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.'
];
}
2024-05-31 15:10:50 +05:30
}