-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathCountry.php
96 lines (83 loc) · 2.33 KB
/
Country.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* Class Country
* @package App
*/
class Country extends Model
{
/**
* @var array
*/
protected $fillable = ['name','iso_code','id_continent', 'eu','vat','is_active','created_by','updated_by'];
/**
* @var array
*/
protected $fieldspec = [];
/**
* @return array
*/
public function getFieldSpec ()
// set the specifications for this database table
{
// build array of field specifications
$this->fieldspec['id'] = [
'type' => 'integer',
'minvalue' => 0,
'pkey' => 'y',
'required' =>true,
'label' => 'id',
'hidden' => '1',
'display' => '0',
];
$this->fieldspec['name'] = [
'type' => 'string',
'required' => true,
'hidden' => '0',
'label' => 'Name',
'extraMsg' => '',
'display' => '1',
];
$this->fieldspec['iso_code'] = [
'type' => 'string',
'required' => true,
'hidden' => '0',
'label' => 'Iso code',
'extraMsg' => '',
'display' => '1',
];
$this->fieldspec['id_continent'] = [
'type' => 'relation',
'model' => 'article',
'foreign_key' => 'id',
'label_key' => 'title',
'required' => false,
'label' => 'Continet',
'hidden' => '1',
'display' => '0',
];
$this->fieldspec['eu'] = [
'type' => 'boolean',
'required' =>true,
'hidden' => '0',
'label' => "Eu",
'display' => '1'
];
$this->fieldspec['vat'] = [
'type' => 'integer',
'required' => false,
'label' => 'Vat %',
'hidden' => '0',
'display' => '1',
];
$this->fieldspec['is_active'] = [
'type' => 'boolean',
'required' => false,
'hidden' => '0',
'label' => trans('admin.label.active'),
'display' => '1'
];
return $this->fieldspec;
}
}