CreateRequest::authorize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace WITR\Http\Requests\Admin\AlbumReview;
2
3
use WITR\Http\Requests\Request;
4
5 View Code Duplication
class CreateRequest extends Request {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
7
	/**
8
	 * Determine if the user is authorized to make this request.
9
	 *
10
	 * @return bool
11
	 */
12
	public function authorize()
13
	{
14
		return true;
15
	}
16
17
	/**
18
	 * Get the validation rules that apply to the request.
19
	 *
20
	 * @return array
21
	 */
22
	public function rules()
23
	{
24
		return [
25
			'band_name' => 'required',
26
			'album_name' => 'required',
27
			'review' => 'required',
28
			'img_name' => 'required|image'
29
		];
30
	}
31
32
	public function messages() 
33
	{
34
		return [
35
			'img_name.required' => 'The album cover is required.',
36
			'img_name.image' => 'The album cover should be an image.',
37
			'band_name.required' => 'The artist field is required',
38
			'album_name.required' => 'The album field is required',
39
		];
40
	}
41
42
}
43