diff --git a/src/Forms/ContentForm.php b/src/Forms/ContentForm.php index 5e2e85d..0d78ca3 100644 --- a/src/Forms/ContentForm.php +++ b/src/Forms/ContentForm.php @@ -9,7 +9,7 @@ use Artmark\Content\Models\Content; /** * Description of ContentForm * - * @author Andrey Pokidov + * @author Andrey Pokidov */ class ContentForm extends Form { diff --git a/src/Requests/ContentRequest.php b/src/Requests/ContentRequest.php new file mode 100644 index 0000000..d75fff8 --- /dev/null +++ b/src/Requests/ContentRequest.php @@ -0,0 +1,32 @@ + + */ +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); + } +}