command to create seed file in 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:
- cviebrock/eloquent-sluggable
- PHP DateTime ->format
- create seede for table in laravel
- date U
- check if array has a key php
- What was the old name of PHP?
- convert any uppercase to capitalize in php
- create a folder in php
- error reporting php all
- Does ,date('Y-m-d H:i:s') grab local pc or server pc time
- display current data php
- echo require php
- clear all cache files in laravel
- deprcation problem phpmyadmin ubuntu
- duplicate values in array php
- failed to open stream: no such file or directory php
- composer uninstall package
- find str in str php
- bu7scador con laravel
- clean url laravel CACHE
- convert unix timestamp to datetime php twig
- data seeder in laravel
- browser cache laravel
- console log php