<?php

namespace App\Console\Commands;

use App\Models\Shop\Article;
use Illuminate\Console\Command;

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;
    }
}
