factoring and seeding in laravel
php artisan make:seeder NameOfTheSeeder<?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:
- Illuminate\Http\Request vs \Illuminate\Support\Facades\Request
- The key "initial" is not recognized and ignored.
- check if character in string php
- check if array contains key php
- How to calculate the difference between two dates
- date format php l with capital
- disable admin bar wordpress
- check if key array php
- doubles tennis random function php
- check if substring is present php
- base 64 encode decode not same php
- check if key_exists php
- api newslater with php
- datetime format
- check if contains ph
- Get the full url of the page in php
- check array in array key
- change php version ubuntu
- chow to check which php version running wordpress
- ajax call php
- check if string contains substring php
- count characters php
- error show all php
- filteredduplicata php