36 lines
826 B
PHP
36 lines
826 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use Illuminate\Support\Str;
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
use App\Models\User;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed the application's database.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
// \App\Models\User::factory(10)->create();
|
|
|
|
\App\Models\User::factory()->create([
|
|
'name' => Str::random(10),
|
|
'email' => Str::random(10).'@gmail.com',
|
|
'password' => Hash::make('password')
|
|
]);
|
|
// $user=new User;
|
|
// $user->name=Str::random(10);
|
|
// $user->email=Str::random(10).'@gmail.com';
|
|
// $user->password=Hash::make('password');
|
|
// $user->save();
|
|
}
|
|
}
|