execute seeder laravel
#All of them
php artisan db:seed
#One class
php artisan db:seed --class=UserSeederphp artisan make:seeder NameOfTheSeederphp artisan db:seed --class=UserSeederphp artisan migrate:fresh --seed<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('users')->insert([
'name' => Str::random(10),
'email' => Str::random(10).'@gmail.com',
'password' => Hash::make('password'),
]);
}
}php artisan db:seed
php artisan db:seed --class=UserSeeder
Also in PHP:
- "customer" attribute not getting saved from admin magento 2
- encryption and decryption in codeigniter
- artisan laravel install
- current timestamp with sec in php to strstring
- $this- attribute laravel
- find length of string in php
- best data structure in php for a unique values
- different time formats in php
- datetime php now
- * in array key php
- current date php function
- check if word matches with string
- can we execute core php project code in laravel
- dateFormat php
- count string length in php
- add days and time to date php
- REMOTE_ADDR php get server address not user ip
- check if key exist in array
- catch exception php of spetie
- convert timestamp php
- database seeding in laravel
- PHP Encode image in Base64
- echo now phpmp
- Laravel 8 KET TO LONG ERROR