Answers for "create fake data laravel"

PHP
0

create fake data laravel

// php artisan make:seeder NameOfTheSeeder

<?php

namespace Database\Seeders;

use App\Models\ModelName;
use Illuminate\Database\Seeder;

class ModelNameSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        ModelName::factory()->count(50)->create();
    }
}
Posted by: Guest on June-24-2021

Browse Popular Code Answers by Language