Refactor article getter for descriptions & tags, minor fixes on tags
This commit is contained in:
26
app/Console/Commands/addTagGroup.php
Normal file
26
app/Console/Commands/addTagGroup.php
Normal 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)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user