This commit is contained in:
f4ilji
2024-11-07 16:11:35 +05:00
parent f01fecf1e6
commit fbea6ecd48
29 changed files with 578 additions and 89 deletions
+1
View File
@@ -19,6 +19,7 @@ class UserFactory extends Factory
{
return [
'name' => fake()->name(),
'slug' => fake()->slug(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('slug')->unique()->nullable()->after('name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('slug');
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('library_news', function (Blueprint $table) {
$table->string('slug')->unique()->after('title');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('library_news', function (Blueprint $table) {
$table->dropColumn('slug');
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('virtual_exhibitions', function (Blueprint $table) {
$table->string('slug')->unique()->after('title');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('virtual_exhibitions', function (Blueprint $table) {
$table->dropColumn('slug');
});
}
};
+1
View File
@@ -28,6 +28,7 @@ class DatabaseSeeder extends Seeder
User::create([
'name' => 'Failj',
'email' => 'Failj@bk.ru',
'slug' => 'failj',
'password' => "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi",
]);
User::factory()->count(50)->has(UserDetail::factory())->create();