+ContentRequest
parent
664437d63a
commit
cdae11b780
@ -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…
Reference in New Issue