+ContentRequest

This commit is contained in:
Andrey Pokidov
2020-03-30 19:27:07 +07:00
parent 664437d63a
commit cdae11b780
2 changed files with 33 additions and 1 deletions

View File

@@ -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
{

View File

@@ -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);
}
}