Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
whytievanie committed Dec 16, 2019
2 parents c4bc0a7 + 2a5398a commit 60819ad
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 1 deletion.
2 changes: 2 additions & 0 deletions database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public function run()
$this->call(suppliesSeeder::class);
$this->call(LeaseTypeTableSeeder::class);
$this->call(LeasesuppliesTableSeeder::class);
$this->call(leases::class);
$this->call(invoice::class);
}
}
24 changes: 24 additions & 0 deletions database/seeds/invoice.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use Illuminate\Database\Seeder;

class invoice extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = \Faker\Factory::create();

for($i = 0; $i < 500; $i++){
\App\invoice::insert([
'lease_id' => $faker->numberBetween(1, 61),
'name' => \Illuminate\Support\Str::random(10),
'price' => $faker->numberBetween(5, 150)
]);
}
}
}
41 changes: 41 additions & 0 deletions database/seeds/leases.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

use Illuminate\Database\Seeder;

class leases extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = \Faker\Factory::create();
$customers = \App\User::where('role_id', 5)->get();

\App\lease::insert([
'lease_type_id' => 1,
'customer_id' => 21,
'finance_id' => 3,
'startdate' => $faker->date(),
'enddate' => $faker->date(),
'connectioncosts' => 300,
'noticeperiod' => $faker->date()
]);

for($i = 0; $i < 150; $i++){
\App\lease::insert([
'lease_type_id' => $faker->numberBetween(1, 2),
'customer_id' => $faker->numberBetween( 5, 150),
'finance_id' => 3,
'startdate' => $faker->date(),
'enddate' => $faker->date(),
'connectioncosts' => 300,
'noticeperiod' => $faker->date()
]);
}

}

}
11 changes: 10 additions & 1 deletion database/seeds/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,22 @@ public function run()
]);


\App\User::insert([
'email'=> 'customer@gmail.com',
'name'=> 'headmaintenancemail',
'password'=> Hash::make('customer123'),
'notes' => '',
'role_id' => 5
]);


for( $i =0; $i < 150; $i++){
\App\User::insert([
'email' => \Illuminate\Support\Str::random(10).'@gmail.com',
'name' => \Illuminate\Support\Str::random(10),
'password'=> Hash::make('barroc123'),
'notes' => '',
'role_id' => 6
'role_id' => 5
]);
}

Expand Down
1 change: 1 addition & 0 deletions resources/views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<li><a class="nav-link" href="{{ route ('bkrcheck.create') }}">BKR Pagina</a></li>
<li><a class="nav-link" href="{{ route ('lease.create') }}">Contract aanmaken</a></li>
<li><a class="nav-link"href="{{route('lease.index')}}">Contract bekijken</a></li>
<li><a class="nav-link" href="https://www.bkr.nl/">BKR Documentatie</a></li>

{{-- CEO --}}
@elseif(Auth::user()->role_id == 5)
Expand Down

0 comments on commit 60819ad

Please sign in to comment.