mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
init section
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user