1 | <?php |
||
27 | class Settings extends Model |
||
28 | { |
||
29 | const ENABLE = 1; |
||
30 | const DISABLE = 0; |
||
31 | |||
32 | /** |
||
33 | * Indicates if the model should be timestamped. |
||
34 | * |
||
35 | * @var bool |
||
36 | */ |
||
37 | public $timestamps = false; |
||
38 | |||
39 | /** |
||
40 | * The database table used by the model. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $table = 'settings'; |
||
45 | |||
46 | /** |
||
47 | * The attributes that are mass assignable. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $fillable = ['key', 'name', 'value']; |
||
52 | |||
53 | /** |
||
54 | * Collection of all settings |
||
55 | * |
||
56 | * @var \Illuminate\Database\Eloquent\Collection |
||
57 | */ |
||
58 | protected $settings = null; |
||
59 | |||
60 | /** |
||
61 | * Load all settings |
||
62 | * |
||
63 | * @return \Illuminate\Database\Eloquent\Collection|boolean |
||
64 | */ |
||
65 | 53 | protected function loadSettings() |
|
80 | |||
81 | /** |
||
82 | * Returns a setting value |
||
83 | * |
||
84 | * @param $name |
||
85 | * @param mixed|null $default |
||
86 | * @return mixed |
||
87 | */ |
||
88 | 53 | public function get($name, $default = null) |
|
100 | |||
101 | /** |
||
102 | * Whether or not the public projects enabled |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | 53 | public function isPublicProjectsEnabled() |
|
110 | } |
||
111 |