This commit is contained in:
ludo
2024-02-19 23:51:32 +01:00
parent 15a6621a56
commit 869b148e20
18 changed files with 440 additions and 85 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Console\Commands;
use App\Models\Shop\Article;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class FixSlug extends Command
{
protected $signature = 'FixSlug';
protected $description = 'Slugify articles';
public function handle()
{
$articles = Article::all();
foreach ($articles as $article) {
$article->slug = null;
$article->update(['name' => $article->name]);
}
return 0;
}
}