You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
711 B
PHP
33 lines
711 B
PHP
<?php
|
|
|
|
namespace Artmark\Content\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
use Artmark\Content\Models\Content;
|
|
|
|
/**
|
|
* Description of ContentRequest
|
|
*
|
|
* @author Andrey Pokidov <pokidov@e-traffic.ru>
|
|
*/
|
|
class ContentRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Merges rules
|
|
* @param array $extraRules
|
|
* @return array
|
|
*/
|
|
public function appendContentRules(array $extraRules)
|
|
{
|
|
$contentRules = [
|
|
'title' => 'required|string|max:' . Content::MAXIMAL_TITLE_LENGTH,
|
|
'keywords' => 'string',
|
|
'description' => 'string',
|
|
'body' => 'string',
|
|
];
|
|
|
|
return array_merge($contentRules, $extraRules);
|
|
}
|
|
}
|