temp
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table(app(User::class)->getTable(), function (Blueprint $table) {
|
||||
$table->timestamp('verified_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table(app(User::class)->getTable(), function (Blueprint $table) {
|
||||
$table->dropColumn('verified_at');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -13,11 +13,6 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
$this->call(UsersSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
25
database/seeders/UsersSeeder.php
Normal file
25
database/seeders/UsersSeeder.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UsersSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
User::updateOrCreate(
|
||||
['email' => 'admin@naggadim.ru'],
|
||||
[
|
||||
'name' => 'Dmitry Smertin',
|
||||
'email' => 'admin@naggadim.ru',
|
||||
'password' => bcrypt('password'),
|
||||
'verified_at' => now(),
|
||||
'email_verified_at' => now(),
|
||||
]
|
||||
);
|
||||
|
||||
echo "User \"admin@naggadim.ru\" created\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user