48 lines
1.0 KiB
PHP
Executable File
48 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Requests\Dashboard\Partner;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class Update extends FormRequest
|
|
{
|
|
/**
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'name_uz' => 'required|string',
|
|
'name_ru' => 'required|string',
|
|
'image' => 'nullable|image',
|
|
'status' => 'required|in:published,new,soon',
|
|
'video_url' => 'nullable|url',
|
|
'description_uz' => 'required|string',
|
|
'description_ru' => 'required|string',
|
|
'position' => 'required|integer',
|
|
'with_price' => 'nullable|boolean',
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getName(): array
|
|
{
|
|
return [
|
|
'uz' => $this->get('name_uz'),
|
|
'ru' => $this->get('name_ru')
|
|
];
|
|
}
|
|
|
|
public function getDescription(): array|null
|
|
{
|
|
return [
|
|
'uz' => $this->get('description_uz'),
|
|
'ru' => $this->get('description_ru')
|
|
];
|
|
}
|
|
}
|