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

57 lines
1.4 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 StoreTestimonialRequest 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()
{
return [
'client_name' => 'required',
'client_designation_company_name' => 'required',
'description' => 'required',
];
}
public function messages(){
return [
'required' => 'The :attribute field is required.',
];
}
public function validated()
{
2024-06-12 19:38:09 +05:30
// if($this->client_images === 'male.jpg' || $this->client_images === 'female.png'){
// $image = $this->client_images;
// }
// if($this->client_images === "One"){
// if($this->has('client_images_one')){
// $image = time() . '.' . $this->client_images_one->extension();
// $this->client_images_one->move(public_path('/uploads/testimonials/images'), $image);
// }
// }
2024-06-17 12:54:10 +05:30
return array_merge(parent::validated(), [
'rating' => $this->rating,
// 'client_image' => $image
]);
// return parent::validated();
2024-03-28 14:52:40 +05:30
}
}