Laravel Seeders

1. Make sure you have created a model. For example, we are using model named Listings

$ sail artisan make:model Listing

// ADD HARD CODED SEEDERS DATA
open DatabaseSeeder.php and add the following after \App\Models\User::factory(10)->create();

        Listing::create(
            [
                'title' => 'Laravel Senior Developer',
                'tags' => 'laravel, javascript',
                'company' => 'Acme Corp',
                'location' => 'Boston, MA',
                'email' => '[email protected]',
                'website' => 'https://www.acme.com',
                'description' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam minima et illo reprehenderit quas possimus voluptas repudiandae cum expedita, eveniet aliquid, quam illum quaerat consequatur! Expedita ab consectetur tenetur delensiti?'
            ]
        );

        Listing::create(
            [
                'title' => 'Full-Stack Engineer',
                'tags' => 'laravel, backend ,api',
                'company' => 'Stark Industries',
                'location' => 'New York, NY',
                'email' => '[email protected]',
                'website' => 'https://www.starkindustries.com',
                'description' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam minima et illo reprehenderit quas possimus voluptas repudiandae cum expedita, eveniet aliquid, quam illum quaerat consequatur! Expedita ab consectetur tenetur delensiti?'
            ]
        );


Generate the seeders:


$ sail artisan migrate:refresh --seed



CHECK PHPMYADMIN FOR THE NEW LISTSINGS:
http://localhost:8081/sql.php?db=laragigs&table=listings&pos=0

MYyJ4PuL4pY