> ## Documentation Index
> Fetch the complete documentation index at: https://docs.larafast.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Categories

> How to manage Categories in Larafast Directories Project

Directories project has a 2 ways to manage categories.

### From Seeder Files

For initial setup, you can add categories in `database/seeders/CategorySeeder.php` file and run the seeder to add them to the database.

If you already run `php artisan migrate --seed` command, you can manage categories from the admin panel.

If you want to refresh the categories, you can run `php artisan migrate:fresh --seed`

<Warning>
  This command will reset the database and add the categories from the seeder file.
</Warning>

```php database/seeders/CategorySeeder.php theme={null}
<?php
...
class CategorySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $categories = [
            ['icon' => '🤖', 'title' => 'Artificial intelligence'],
            ['icon' => '📈', 'title' => 'Productivity'],
            ['icon' => '📣', 'title' => 'Marketing'],
            ['icon' => '💻', 'title' => 'Developer tools'],
            ['icon' => '🎨', 'title' => 'Design'],
            ['icon' => '🔍', 'title' => 'SEO'],
            ...
        ];

        foreach ($categories as $category) {
            \App\Models\Category::create($category);
        }
    }
}
```

### From Admin Panel

In the admin panel `/admin/categories` you can manage categories. You can add, edit, delete, and add new categories from the admin panel.

<Frame>
  <img src="https://mintcdn.com/larafast/p7p6xbnL6MINm0mR/images/directories/categories.jpg?fit=max&auto=format&n=p7p6xbnL6MINm0mR&q=85&s=b2359b84e5743ef554b5e593575a2572" width="1264" height="862" data-path="images/directories/categories.jpg" />
</Frame>
