45 lines
803 B
PHP
Executable File
45 lines
803 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Requests\Dashboard\Page;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class Store extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
if ($this->isMethod('get')) {
|
|
return [];
|
|
}
|
|
|
|
return [
|
|
'name' => 'required|array',
|
|
'name.*' => 'required|string',
|
|
'body' => 'required|array',
|
|
'body.*' => 'required|string',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getName(): array
|
|
{
|
|
return $this->get('name');
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getBody(): array
|
|
{
|
|
return $this->get('body');
|
|
}
|
|
|
|
}
|