mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
upload/section add tags
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Http\Middleware\Locale;
|
||||
use App\Repositories\TagRepository;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -288,6 +289,16 @@ class SearchBox extends NexusModel
|
||||
}
|
||||
}
|
||||
|
||||
public function tags(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(Tag::class, 'mode');
|
||||
}
|
||||
|
||||
public function loadTags(): void
|
||||
{
|
||||
$this->setRelation("tags", TagRepository::listAll($this->id));
|
||||
}
|
||||
|
||||
public static function getDefaultSearchMode()
|
||||
{
|
||||
$meiliConf = get_setting("meilisearch");
|
||||
|
||||
Reference in New Issue
Block a user