+ContentRequest
This commit is contained in:
@@ -9,7 +9,7 @@ use Artmark\Content\Models\Content;
|
|||||||
/**
|
/**
|
||||||
* Description of ContentForm
|
* Description of ContentForm
|
||||||
*
|
*
|
||||||
* @author Andrey Pokidov <andrey.pokidov@gmail.com>
|
* @author Andrey Pokidov <pokidov@e-traffic.ru>
|
||||||
*/
|
*/
|
||||||
class ContentForm extends Form
|
class ContentForm extends Form
|
||||||
{
|
{
|
||||||
|
32
src/Requests/ContentRequest.php
Normal file
32
src/Requests/ContentRequest.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user