Initial commit
This commit is contained in:
1
database/.gitignore
vendored
Normal file
1
database/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.sqlite*
|
||||
44
database/factories/UserFactory.php
Normal file
44
database/factories/UserFactory.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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::create('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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::create('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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::create('personal_access_tokens', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('tokenable');
|
||||
$table->text('name');
|
||||
$table->string('token', 64)->unique();
|
||||
$table->text('abilities')->nullable();
|
||||
$table->timestamp('last_used_at')->nullable();
|
||||
$table->timestamp('expires_at')->nullable()->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('personal_access_tokens');
|
||||
}
|
||||
};
|
||||
42
database/migrations/2026_02_18_190451_tablaletrehoz.php
Normal file
42
database/migrations/2026_02_18_190451_tablaletrehoz.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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::create('polo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger("id")->primary();
|
||||
$table->string("anyag", 40);
|
||||
$table->enum("polomeret", ["S", "M", "L", "XL", "XXL"]);
|
||||
$table->integer("ar");
|
||||
$table->text("cimke");
|
||||
$table->decimal("atmero", 5, 2);
|
||||
});
|
||||
|
||||
Schema::create('vasarlo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger("id")->primary();
|
||||
$table->string("nev", 100);
|
||||
$table->enum("meret", ["S", "M", "L", "XL", "XXL"]);
|
||||
$table->boolean("neme")->nullable();
|
||||
$table->integer("penz");
|
||||
$table->string("torzsvasarloSzam")->unique();
|
||||
$table->foreignId("poloId")->references("id")->on("polo");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists("vasarlo");
|
||||
Schema::dropIfExists("polo");
|
||||
}
|
||||
};
|
||||
25
database/seeders/DatabaseSeeder.php
Normal file
25
database/seeders/DatabaseSeeder.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
use WithoutModelEvents;
|
||||
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
}
|
||||
}
|
||||
120
database/seeders/adatSeeder.php
Normal file
120
database/seeders/adatSeeder.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class adatSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
DB::table('polo')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'anyag' => 'Pamut',
|
||||
'polomeret' => 'S',
|
||||
'ar' => 5000,
|
||||
'cimke' => 'Kényelmes pamut póló',
|
||||
'atmero' => 38.50
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'anyag' => 'Pamut',
|
||||
'polomeret' => 'M',
|
||||
'ar' => 5500,
|
||||
'cimke' => 'Klasszikus pamut póló',
|
||||
'atmero' => 40.00
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'anyag' => 'Pamut',
|
||||
'polomeret' => 'L',
|
||||
'ar' => 6000,
|
||||
'cimke' => 'Laza pamut póló',
|
||||
'atmero' => 42.00
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'anyag' => 'Pamut-Poliészter',
|
||||
'polomeret' => 'XL',
|
||||
'ar' => 6500,
|
||||
'cimke' => 'Sportos póló kevert anyagból',
|
||||
'atmero' => 44.50
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'anyag' => 'Pamut-Poliészter',
|
||||
'polomeret' => 'XXL',
|
||||
'ar' => 7000,
|
||||
'cimke' => 'Bő póló nagyobb méretben',
|
||||
'atmero' => 46.00
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'anyag' => 'Pamut',
|
||||
'polomeret' => 'M',
|
||||
'ar' => 5800,
|
||||
'cimke' => 'Divatos pamut póló',
|
||||
'atmero' => 41.00
|
||||
],
|
||||
]);
|
||||
|
||||
DB::table('vasarlo')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'nev' => 'Kovács Péter',
|
||||
'meret' => 'S',
|
||||
'neme' => 1,
|
||||
'penz' => 10000,
|
||||
'torzsvasarloSzam' => 'TVS001',
|
||||
'poloId' => 1
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'nev' => 'Nagy Anna',
|
||||
'meret' => 'M',
|
||||
'neme' => 0,
|
||||
'penz' => 12000,
|
||||
'torzsvasarloSzam' => 'TVS002',
|
||||
'poloId' => 2
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'nev' => 'Tóth László',
|
||||
'meret' => 'L',
|
||||
'neme' => 1,
|
||||
'penz' => 8000,
|
||||
'torzsvasarloSzam' => 'TVS003',
|
||||
'poloId' => 3
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'nev' => 'Horváth Éva',
|
||||
'meret' => 'XL',
|
||||
'neme' => 0,
|
||||
'penz' => 15000,
|
||||
'torzsvasarloSzam' => 'TVS004',
|
||||
'poloId' => 4
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'nev' => 'Szabó Gábor',
|
||||
'meret' => 'XXL',
|
||||
'neme' => 1,
|
||||
'penz' => 5000,
|
||||
'torzsvasarloSzam' => 'TVS005',
|
||||
'poloId' => 5
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'nev' => 'Kiss Zsófia',
|
||||
'meret' => 'M',
|
||||
'neme' => 0,
|
||||
'penz' => 11000,
|
||||
'torzsvasarloSzam' => 'TVS006',
|
||||
'poloId' => 6
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user