Code Duplication    Length = 20-20 lines in 2 locations

src/Requests/StoreBlogPost.php 1 location

@@ 32-51 (lines=20) @@
29
        ];
30
    }
31
32
    public function messages()
33
    {
34
        $messages = [
35
            'title.required' => 'Er, you forgot to add a title!',
36
            'title.min' => 'Don\'t be stingy - make the title LONGER THAN 3 CHARACTERS!',
37
            'content.required' => 'No body, no article.'
38
        ];
39
40
        if ('PATCH' === $this->method()){
41
42
            $messages = [
43
                'title.required' => 'Empty Title not allowed on PATCH',
44
                'title.min' => 'Don\'t be stingy - make the title LONGER THAN 3 CHARACTERS!',
45
                'content.required' => 'No body, no article.'
46
            ];
47
48
        }
49
50
        return $messages;
51
    }
52
}
53

src/Requests/UpdateBlogPost.php 1 location

@@ 38-57 (lines=20) @@
35
            ];
36
    }
37
38
    public function messages()
39
    {
40
        $messages = [
41
            'title.required' => 'Er, you forgot to add a title!',
42
            'title.min' => 'Don\'t be stingy - make the title LONGER THAN 3 CHARACTERS!',
43
            'content.required' => 'No body, no article.'
44
        ];
45
46
        if ('PATCH' === $this->method()){
47
48
            $messages = [
49
                'title.required' => 'Empty Title not allowed on PATCH',
50
                'title.min' => 'Don\'t be stingy - make the title LONGER THAN 3 CHARACTERS!',
51
                'content.required' => 'No body, no article.'
52
            ];
53
54
        }
55
56
        return $messages;
57
    }
58
}
59