fixed settings

This commit is contained in:
Edward Yang 2022-06-30 19:03:46 +08:00
parent 1ee55af5a0
commit f80fc4d310
2 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
class Setting extends Model
{
use HasFactory;
protected $table = 'settings';
protected $fillable = ['name', 'value', 'json'];
protected $fillable = ['type', 'space', 'name', 'value', 'json'];
}

View File

@ -11,7 +11,9 @@
namespace Beike\Repositories;
use Beike\Models\Cart;
use Beike\Models\Setting;
use Carbon\Carbon;
class SettingRepo
{
@ -59,7 +61,9 @@ class SettingRepo
'space' => $code,
'name' => $name,
'value' => (string)$value,
'json' => 0
'json' => 0,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];
}
Setting::query()->insert($rows);