TemplateDetail   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 1
c 3
b 1
f 0
lcom 0
cbo 1
dl 0
loc 49
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A parent() 0 4 1
1
<?php namespace App\LaravelRestCms\Template;
2
3
use App\LaravelRestCms\BaseModel;
4
5
class TemplateDetail extends BaseModel {
6
7
	public static $searchCols = ['name', 'description', 'var'];
8
9
	/**
10
	 * The database table used by the model.
11
	 *
12
	 * @var string
13
	 */
14
	protected $table = 'template_detail';
15
16
	/**
17
	 * The attributes that are mass assignable.
18
	 *
19
	 * @var array
20
	 */
21
	protected $fillable = [];
22
23
	/**
24
	 * The attributes excluded from the model's JSON form.
25
	 *
26
	 * @var array
27
	 */
28
	protected $hidden = [];
29
30
	public static $types = [
31
		'wysiwyg' => 'HTML Editor',
32
		'image_picker' => 'Image Picker',
33
		'date_picker' => 'Date Picker',
34
		'select' => 'Select',
35
		'select_multiple' => 'Select Multiple',
36
		'text' => 'Text',
37
		'textarea' => 'Textarea',
38
		'repeater' => 'Repeating Group',
39
		'picker' => 'Picker',
40
		'info' => 'Info Box (Backend Only)',
41
	];
42
43
	/**
44
	 * Joins the parent table
45
	 * 
46
	 * @return \Illuminate\Database\Eloquent\Relations\hasOne
47
	 */
48
	public function parent()
49
	{
50
		return $this->hasMany(TemplateDetail::class, 'id', 'parent_id');
51
	}
52
53
}
54