restore composer.json, add mysqli extension
This commit is contained in:
52
app/Http/Requests/Dashboard/UsefulInfoItemRequest/Update.php
Executable file
52
app/Http/Requests/Dashboard/UsefulInfoItemRequest/Update.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Dashboard\UsefulInfoItemRequest;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class Update extends FormRequest
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name_uz' => 'required|string',
|
||||
'name_ru' => 'required|string',
|
||||
'description_uz' => 'nullable|string',
|
||||
'description_ru' => 'nullable|string',
|
||||
'video_url' => 'nullable|string',
|
||||
'link_url' => 'nullable|string',
|
||||
'file' => 'nullable|file|mimes:pdf,doc,docx,xls,xlsx,ppt,pptx',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getName(): array|null
|
||||
{
|
||||
if ($this->has('name_uz') && $this->has('name_ru')) {
|
||||
return [
|
||||
'uz' => $this->get('name_uz'),
|
||||
'ru' => $this->get('name_ru')
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getDescription(): array|null
|
||||
{
|
||||
if ($this->get('description_uz') !== null && $this->get('description_ru') !== null) {
|
||||
return [
|
||||
'uz' => $this->get('description_uz'),
|
||||
'ru' => $this->get('description_ru')
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user