create laravel seeder example
#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:
- conole.log in php
- M-d h:i:a
- docker lumen phpunit the request php extension dom is missing
- check if string contains only one word
- convert time() to date php
- $heure = date('H'); php 5
- can we execute core php project code in laravel
- create a directory in php
- new project installation in laravel
- create model in laravel command line
- find string exist in string php
- array key exists php child child nodes
- add unique value in array php
- DateTime and Timestamps
- Woocommerce Get Related Products by Same Sub Category with no Repeate Same Product
- code php ajout heure
- error reporting on in php
- Failed at the dev script npm run dev
- carbon date from format
- add seconds to datetime php
- base64 to image
- Web servers supported by php
- displaying errors in laravel
- add 1 day current fasy php