1 | <?php |
||
11 | class Issue extends Base |
||
12 | { |
||
13 | protected $organizationPerspective = true; |
||
14 | |||
15 | protected $table = 'code_issues'; |
||
16 | |||
17 | protected $action = false; |
||
18 | |||
19 | protected $target = false; |
||
20 | |||
21 | protected $worker = false; |
||
22 | |||
23 | /** |
||
24 | * The attributes that are mass assignable. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $fillable = [ |
||
29 | 'name', |
||
30 | 'key_name', |
||
31 | 'slug', |
||
32 | 'url', |
||
33 | ]; |
||
34 | |||
35 | public $formFields = [ |
||
36 | ['name' => 'title', 'label' => 'Title', 'type' => 'text'], |
||
37 | ['name' => 'slug', 'label' => 'Slug', 'type' => 'text'], |
||
38 | ['name' => 'body', 'label' => 'Enter your content here', 'type' => 'textarea'], |
||
39 | ['name' => 'publish_on', 'label' => 'Publish Date', 'type' => 'date'], |
||
40 | ['name' => 'published', 'label' => 'Published', 'type' => 'checkbox'], |
||
41 | ['name' => 'category_id', 'label' => 'Category', 'type' => 'select', 'relationship' => 'category'], |
||
42 | ['name' => 'tags', 'label' => 'Tags', 'type' => 'select_multiple', 'relationship' => 'tags'], |
||
43 | ]; |
||
44 | |||
45 | public $indexFields = [ |
||
46 | 'title', |
||
47 | 'category_id', |
||
48 | 'published' |
||
49 | ]; |
||
50 | |||
51 | public $validationRules = [ |
||
52 | 'title' => 'required|max:255', |
||
53 | 'slug' => 'required|max:100', |
||
54 | 'body' => 'required', |
||
55 | 'publish_on' => 'date', |
||
56 | 'published' => 'boolean', |
||
57 | 'category_id' => 'required|int', |
||
58 | ]; |
||
59 | |||
60 | public $validationMessages = [ |
||
61 | 'body.required' => "You need to fill in the post content." |
||
62 | ]; |
||
63 | |||
64 | public $validationAttributes = [ |
||
65 | 'title' => 'Post title' |
||
66 | ]; |
||
67 | |||
68 | public function project() |
||
72 | |||
73 | public function setField($fields, $issueKey) |
||
130 | } |
||
131 |