init section

This commit is contained in:
xiaomlove
2022-09-06 20:45:29 +08:00
parent fb329f72cc
commit f68b88f754
16 changed files with 496 additions and 5 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Models;
class TorrentCustomField extends NexusModel
{
protected $table = 'torrents_custom_fields';
protected $fillable = [
'name', 'label', 'type', 'required', 'is_single_row', 'options', 'help'
];
public static function getCheckboxOptions(): array
{
$result = [];
$records = self::query()->get();
foreach ($records as $value) {
$result[$value->id] = sprintf('%s[%s]', $value->name, $value->label);
}
return $result;
}
}