db seed particular table laravel
#All of them
php artisan db:seed
#One class
php artisan db:seed --class=UserSeeder<?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'),
]);
}
}
Also in PHP:
- composer create project laravel
- apt install php7.4-mbstring php7.4-zip php7.4-xml
- codeigniter db insert return id
- add date + 1 PHP
- create array and remove duplicates php
- add bootstrap class to checkout fields woocommerce
- check if a string is url or not php
- datetime with current date pho
- array with files content in a folder
- base64 to image
- @lang laravel blade
- array sort unique laravel
- date and tome php
- create laravel project using cmd
- find location from an ip address PHP
- check if string container string phph
- drupal 8 enable twig debug
- curl in php
- adding 2 in date() php
- configure laravel on windows
- delete duplicate elements array php
- capitalized string in php
- blade Keep input values after failed validation
- What is a Regular Expression in php