code seef 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:
- echo console log php
- config clear laravel
- exception handling in php
- check type of data in php
- console.log alternative php
- check if string contains specific string php
- count() parameter must be an array or an object that implements countable laravel
- design patterns in php + the right way
- Authorization header (API Key) is missing" }in guzzle
- Search or Filter Data in GridView c#
- Your Composer dependencies require a PHP version ">= 7.2.0".
- codeigniter 3 smtp email send
- count on a string php
- Custom Order By in CakePHP
- datetime to date string php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/
- cache resource laravel
- Allowed memory size of 1610612736 bytes exhausted composer
- create a folder php
- does contains string character php
- clear cache without using composer in laravel 8
- different date format php
- exception in php
- Custom Fields shortcode contact form 7