abschlussprojekt-device-man.../device-app/database/seeders/DatabaseSeeder.php
2023-03-29 22:32:49 +02:00

74 lines
1.9 KiB
PHP

<?php
namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Models\Device;
use App\Models\User;
use Illuminate\Database\Seeder;
use App\Models\OwnerTransaction;
use App\Models\LocationTransaction;
use App\Models\PurchasingInformation;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// \App\Models\User::factory(10)->create();
// \App\Models\User::factory()->create([
// 'name' => 'Test User',
// 'email' => 'test@example.com',
// ]);
Device::factory(1)->create([
'device_id' => '1'
]);
User::create([
'rz_username' => 'admin',
'full_name' => 'Admin',
'organisation_unit' => '11111111',
'has_admin_privileges' => true,
'hashed_password' => bcrypt('vollgeheim')
]);
User::create([
'rz_username' => 'user',
'full_name' => 'User',
'organisation_unit' => '66666666',
'has_admin_privileges' => false,
'hashed_password' => bcrypt('test123')
]);
PurchasingInformation::create([
'purchasing_information_id' => '1',
'price' => '1',
'timestamp_warranty_end' => '1',
'timestamp_purchase' => '1',
'cost_centre' => '1',
'seller' => '1',
'device_id' => '1',
]);
LocationTransaction::create([
'location_transaction_id' => '1',
'room_code' => '1',
'timestamp_located_since' => '1',
'device_id' => '1',
]);
OwnerTransaction::create([
'owner_transaction_id' => '1',
'rz_username' => '1',
'timestamp_owner_since' => '1',
'device_id' => '1',
]);
}
}