Refactor article getter for descriptions & tags, minor fixes on tags

This commit is contained in:
Ludovic CANDELLIER
2022-06-22 22:28:18 +02:00
parent 6b1cc0f045
commit e9ab7173f8
12 changed files with 148 additions and 37 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Shop\Tag;
use App\Repositories\Shop\TagGroups;
class addTagGroup extends Command
{
protected $signature = 'addTagGroup';
protected $description = 'Migrations of tags';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$tags = Tag::withTrashed()->get();
foreach ($tags as $tag) {
$tag->update(['group' => TagGroups::getName($tag->tag_group_id)]);
}
}
}