wip
This commit is contained in:
1 parent
5f95289079
commit
60249dffd9
37 files changed
+412
-458
No files matched your search
@@ -19,8 +19,7 @@ class KontoFactory extends Factory
|
||||
return [
|
||||
'title' => fake()->randomElement(['Architekt:in', 'Ziviltechniker:in']),
|
||||
'gender' => fake()->randomElement(['Frau', 'Herr']),
|
||||
'first_name' => fake()->firstName(),
|
||||
'last_name' => fake()->lastName(),
|
||||
'name' => fake()->name(),
|
||||
'company' => fake()->Company(),
|
||||
'email' => fake()->email(),
|
||||
'address' => fake()->Address(),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Konto;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -24,7 +25,9 @@ class UserFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'gender' => fake()->randomElement(['Frau', 'Herr']),
|
||||
'name' => fake()->name(),
|
||||
'konto_id' => Konto::all()->random()->id,
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
|
||||
@@ -15,8 +15,7 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('gender')->nullable();
|
||||
$table->string('first_name');
|
||||
$table->string('last_name');
|
||||
$table->string('name');
|
||||
$table->string('company');
|
||||
$table->string('email')->nullable();
|
||||
$table->string('address')->nullable();
|
||||
|
||||
@@ -14,6 +14,7 @@ return new class extends Migration
|
||||
Schema::create('plans', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('payment')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->integer('number_user')->default(1);
|
||||
$table->integer('number_gutachter')->default(1);
|
||||
@@ -27,6 +28,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('konto_options');
|
||||
Schema::dropIfExists('plans');
|
||||
}
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
<?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('payments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('payments');
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
<?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('titels', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('titels');
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
<?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('genders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('genders');
|
||||
}
|
||||
};
|
||||
@@ -4,6 +4,7 @@ namespace Database\Seeders;
|
||||
|
||||
use App\Models\Gutachter;
|
||||
use App\Models\Konto;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
@@ -17,11 +18,13 @@ class DatabaseSeeder extends Seeder
|
||||
|
||||
// Gutachter::factory()->create(30);
|
||||
|
||||
// $this->call([
|
||||
// OrientierungenSeeder::class,
|
||||
// KontoOptionSeeder::class,
|
||||
// RolesAndPermissionsSeeder::class,
|
||||
// ]);
|
||||
$this->call([
|
||||
OrientierungenSeeder::class,
|
||||
PlansSeeder::class,
|
||||
RolesAndPermissionsSeeder::class,
|
||||
]);
|
||||
|
||||
User::factory()->count(100)->create();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class KontoOptionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$sql = "INSERT INTO `payments` (`id`, `name`)
|
||||
VALUES
|
||||
('1', 'Pro Gutachten'),
|
||||
('2', 'Monatlich'),
|
||||
('3', 'Jährlich');
|
||||
";
|
||||
DB::unprepared($sql);
|
||||
|
||||
$sql = "INSERT INTO `plans` (`id`, `name`, `description`, `number_user`, `number_gutachter`, `payment_id`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
('1', 'Basic', 'Basis Version für einen Benutzer und einem Gutacher.', '1', '1', '1', NULL, NULL),
|
||||
('2', 'Erweitert', 'Premium Version für 3 Benutzer und 3 Gutacher.', '3', '3', '2', NULL, NULL),
|
||||
('3', 'Premium', 'Premium Version für fünf Benutzer und fünf Gutacher. \nUnbegrenzte Anzahl der Gutachten.', '5', '5', '3', NULL, NULL);
|
||||
";
|
||||
DB::unprepared($sql);
|
||||
}
|
||||
}
|
||||
@@ -12,10 +12,10 @@ class KontoSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$sql = "INSERT INTO `kontos` (`id`, `konto_title`, `konto_gender`, `konto_first_name`, `konto_last_name`, `konto_company`, `konto_email`, `konto_address`, `konto_location`, `konto_plz`, `konto_country`, `konto_phone`, `konto_uid_number`, `konto_agb_akzeptiert`, `konto_option_id`, `konto_gutachten_zahl`, `konto_gutachten_zeit`, `konto_gutachten_abgeschlossen`, `created_at`, `updated_at`)
|
||||
$sql = "INSERT INTO `kontos` (`id`, `title`, `gender`, `name`, `company`, `email`, `address`, `location`, `plz`, `country`, `phone`, `uid_number`, `agb_akzeptiert`, `option_id`, `gutachten_zahl`, `gutachten_zeit`, `gutachten_abgeschlossen`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
('1', 'Architekt', 'Herr', 'Hanno', 'Vogl-Fernheim', 'Architekt Vogl-Fernheim', 'office@vogl-fernheim.eu', 'Richardsweg 1', 'Innsbruck', '6020', 'Österreich', '+43 0512 560303', 'ATU 61718733', '1', '1', '1', NULL, '1', NULL, NULL),
|
||||
('2', 'Staatl. bef. u. beeideter Ziviltechniker', 'Herr', 'Christoph', 'Falkner', 'Christoph Falkner', 'christophfalkner@me.com', 'Adele-Obermayr-Straße 2', 'Innsbruck', '6020', 'Österreich', '+43 650 92210248', 'ATU56874500', '1', '1', '1', NULL, '1', NULL, NULL);
|
||||
('1', 'Architekt', 'Herr', 'Hanno Vogl-Fernheim', 'Architekt Vogl-Fernheim', 'office@vogl-fernheim.eu', 'Richardsweg 1', 'Innsbruck', '6020', 'Österreich', '+43 0512 560303', 'ATU 61718733', '1', '1', '1', NULL, '1', NULL, NULL),
|
||||
('2', 'Staatl. bef. u. beeideter Ziviltechniker', 'Herr', 'Christoph Falkner', 'Ziviltechniker Christoph Falkner', 'christophfalkner@me.com', 'Adele-Obermayr-Straße 2', 'Innsbruck', '6020', 'Österreich', '+43 650 92210248', 'ATU56874500', '1', '1', '1', NULL, '1', NULL, NULL);
|
||||
";
|
||||
DB::unprepared($sql);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class PlansSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$sql = "INSERT INTO `plans` (`id`, `name`, `payment`, `description`, `number_user`, `number_gutachter`, `payment_id`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
('1', 'Basic', 'Pro Gutachten', 'Basis Version für einen Benutzer und einem Gutacher.', '1', '1', '1', NULL, NULL),
|
||||
('2', 'Erweitert', 'Monatlich', 'Premium Version für 3 Benutzer und 3 Gutacher.', '3', '3', '2', NULL, NULL),
|
||||
('3', 'Premium', 'Jährlich', 'Premium Version für fünf Benutzer und fünf Gutacher. \nUnbegrenzte Anzahl der Gutachten.', '5', '5', '3', NULL, NULL);
|
||||
";
|
||||
DB::unprepared($sql);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user