+ContentRequest

master
Andrey Pokidov 4 years ago
parent 664437d63a
commit cdae11b780

@ -9,7 +9,7 @@ use Artmark\Content\Models\Content;
/**
* Description of ContentForm
*
* @author Andrey Pokidov <andrey.pokidov@gmail.com>
* @author Andrey Pokidov <pokidov@e-traffic.ru>
*/
class ContentForm extends Form
{

@ -0,0 +1,32 @@
<?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);
}
}
Loading…
Cancel
Save