mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
section basic
This commit is contained in:
32
app/Models/SecondIcon.php
Normal file
32
app/Models/SecondIcon.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class SecondIcon extends NexusModel
|
||||
{
|
||||
protected $table = 'secondicons';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'class_name', 'image', 'mode',
|
||||
'source', 'medium', 'codec', 'audiocodec', 'standard', 'processing', 'team'
|
||||
];
|
||||
|
||||
public static function formatFormData(array $data): array
|
||||
{
|
||||
foreach (SearchBox::$taxonomies as $torrentField => $table) {
|
||||
$mode = $data['mode'];
|
||||
if (empty($data[$torrentField][$mode])) {
|
||||
unset($data[$torrentField]);
|
||||
} else {
|
||||
$data[$torrentField] = $data[$torrentField][$mode];
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function search_box()
|
||||
{
|
||||
return $this->belongsTo(SearchBox::class, 'mode', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user