28 lines
479 B
PHP
28 lines
479 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class Config extends Model
|
|
{
|
|
protected $table = 'admin_config';
|
|
|
|
public function getRouteKeyName()
|
|
{
|
|
return 'name';
|
|
}
|
|
|
|
protected function setValueAttribute($value)
|
|
{
|
|
switch (strtolower($value)) {
|
|
case 'on':
|
|
$value = 1;
|
|
break;
|
|
case 'off':
|
|
$value = 0;
|
|
break;
|
|
}
|
|
|
|
$this->attributes['value'] = $value;
|
|
}
|
|
}
|