aboutsummaryrefslogtreecommitdiff
path: root/database/seeders/BookmarkCategoriesTableSeeder.php
blob: 5c8ea2f37e9bff670f7e0bb49d9d13b61a08fac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

namespace Database\Seeders;

use App\Models\BookmarkCategory;
use App\Models\BookmarkSite;
use Illuminate\Database\Seeder;

class BookmarkCategoriesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void {
//        BookmarkCategory::factory()->count(5)->create()->each(function ($category) {
//            $category->sites()->saveMany(BookmarkSite::factory()->count(3)->make());
//        });
        $category = new BookmarkCategory([
            'name' => 'cool people',
        ]);
        $category->save();
        $site = new BookmarkSite([
            'name' => 'campos',
            'description' => 'Cool brazilian dude, does programming and stuff',
            'url' => 'https://campos02.me/',
            'category' => 1,
        ]);
        $site->save();
    }
}