Rework frontend
This commit is contained in:
@@ -13,16 +13,20 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('slides', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->text('content');
|
||||
$table->string('image');
|
||||
$table->string('title')->nullable();
|
||||
$table->text('content')->nullable();
|
||||
$table->text('image')->nullable();
|
||||
$table->string('link');
|
||||
$table->string('link_text');
|
||||
$table->text('settings')->nullable();
|
||||
$table->string('color_theme');
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamp('start_time')->nullable(); // Дата и время начала действия слайда
|
||||
$table->timestamp('end_time')->nullable(); // Дата и время окончания действия слайда
|
||||
$table->integer('sort')->nullable();
|
||||
$table->foreignId('slider_id')->references('id')->on('sliders')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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('sliders', function (Blueprint $table) {
|
||||
$table->string('slug')->unique()->after('title');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('sliders', function (Blueprint $table) {
|
||||
$table->dropColumn('slug');
|
||||
});
|
||||
}
|
||||
};
|
||||
+28
@@ -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('user_details', function (Blueprint $table) {
|
||||
$table->dropColumn('participationScienceProjects');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('user_details', function (Blueprint $table) {
|
||||
$table->text('participationScienceProjects')->nullable(); // Участие в научных проектах
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -25,71 +25,71 @@ class DatabaseSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
$faker = Factory::create();
|
||||
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();
|
||||
// EventCategory::factory()->count(10)->create();
|
||||
// Category::factory()->count(80)->create();
|
||||
// Post::factory()->count(1000)->create();
|
||||
// Event::factory()->count(200)->create();
|
||||
// Faculty::factory()->count(6)->create();
|
||||
// Department::factory()->count(12)->create();
|
||||
//
|
||||
// for ($i = 0; $i < 20; $i++) {
|
||||
// DB::table('workers_departments')->insert([
|
||||
// 'user_id' => User::inRandomOrder()->first()->id,
|
||||
// 'department_id' => Department::inRandomOrder()->first()->id,
|
||||
// 'position' => $faker->word,
|
||||
// 'created_at' => now(),
|
||||
// 'updated_at' => now(),
|
||||
// ]);
|
||||
// }
|
||||
//
|
||||
// for ($i = 0; $i < 20; $i++) {
|
||||
// DB::table('workers_faculties')->insert([
|
||||
// 'user_id' => User::inRandomOrder()->first()->id,
|
||||
// 'faculty_id' => Faculty::inRandomOrder()->first()->id,
|
||||
// 'position' => $faker->word,
|
||||
// 'created_at' => now(),
|
||||
// 'updated_at' => now(),
|
||||
// ]);
|
||||
// }
|
||||
//
|
||||
// for ($i = 0; $i < 30; $i++) {
|
||||
// DB::table('teachers_departments')->insert([
|
||||
// 'user_id' => User::inRandomOrder()->first()->id,
|
||||
// 'department_id' => Department::inRandomOrder()->first()->id,
|
||||
// 'teaching_position' => $faker->word,
|
||||
// 'created_at' => now(),
|
||||
// 'updated_at' => now(),
|
||||
// ]);
|
||||
// }
|
||||
// $this->call([RolesSeeder::class]);
|
||||
// $users = [
|
||||
// [
|
||||
// 'name' => 'Admin',
|
||||
// 'email' => 'Admin@mail.ru',
|
||||
// 'password' => 'R177p900',
|
||||
// 'role' => 'admin',
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'John',
|
||||
// 'email' => 'Test@mail.ru',
|
||||
// 'password' => 'R177p900',
|
||||
// 'role' => 'user',
|
||||
// ]
|
||||
// ];
|
||||
// foreach ($users as $user) {
|
||||
// $created_user = User::create([
|
||||
// 'name' => $user['name'],
|
||||
// 'email' => $user['email'],
|
||||
// 'password' => Hash::make($user['password']),
|
||||
// ]);
|
||||
// $created_user->assignRole($user['role']);
|
||||
// }
|
||||
// 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();
|
||||
EventCategory::factory()->count(10)->create();
|
||||
Category::factory()->count(80)->create();
|
||||
Post::factory()->count(1000)->create();
|
||||
Event::factory()->count(200)->create();
|
||||
Faculty::factory()->count(6)->create();
|
||||
Department::factory()->count(12)->create();
|
||||
|
||||
for ($i = 0; $i < 20; $i++) {
|
||||
DB::table('workers_departments')->insert([
|
||||
'user_id' => User::inRandomOrder()->first()->id,
|
||||
'department_id' => Department::inRandomOrder()->first()->id,
|
||||
'position' => $faker->word,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 20; $i++) {
|
||||
DB::table('workers_faculties')->insert([
|
||||
'user_id' => User::inRandomOrder()->first()->id,
|
||||
'faculty_id' => Faculty::inRandomOrder()->first()->id,
|
||||
'position' => $faker->word,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 30; $i++) {
|
||||
DB::table('teachers_departments')->insert([
|
||||
'user_id' => User::inRandomOrder()->first()->id,
|
||||
'department_id' => Department::inRandomOrder()->first()->id,
|
||||
'teaching_position' => $faker->word,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
$this->call([RolesSeeder::class]);
|
||||
$users = [
|
||||
[
|
||||
'name' => 'Admin',
|
||||
'email' => 'Admin@mail.ru',
|
||||
'password' => 'R177p900',
|
||||
'role' => 'admin',
|
||||
],
|
||||
[
|
||||
'name' => 'John',
|
||||
'email' => 'Test@mail.ru',
|
||||
'password' => 'R177p900',
|
||||
'role' => 'user',
|
||||
]
|
||||
];
|
||||
foreach ($users as $user) {
|
||||
$created_user = User::create([
|
||||
'name' => $user['name'],
|
||||
'email' => $user['email'],
|
||||
'password' => Hash::make($user['password']),
|
||||
]);
|
||||
$created_user->assignRole($user['role']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user