- added nearly all migration files
- added nearly all database seed files
This commit is contained in:
parent
489546ef6e
commit
7641c1dfdf
40 changed files with 1168 additions and 915 deletions
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
|
@ -19,43 +20,20 @@ class DatabaseSeeder extends Seeder
|
|||
// 'password' => bcrypt('secret'),
|
||||
// ]);
|
||||
|
||||
$this->call('StudentTableSeeder');
|
||||
$this->call('CategoryTableSeeder');
|
||||
$this->call('ShelfTableSeeder');
|
||||
$this->call('BookTableSeeder');
|
||||
$this->call('PeriodeTableSeeder');
|
||||
$this->call('UserTableSeeder');
|
||||
$this->call('CollectionTableSeeder');
|
||||
$this->call('DocumentTableSeeder');
|
||||
|
||||
// $this->call('CategoryTableSeeder');
|
||||
// $this->call('BookTableSeeder');
|
||||
// $this->call('PeriodeTableSeeder');
|
||||
$this->call('AccountsTableSeeder');
|
||||
$this->call('RolesTableSeeder');
|
||||
$this->call('LicencesTableSeeder');
|
||||
$this->call('LanguagesTableSeeder');
|
||||
$this->call('PagesTableSeeder');
|
||||
$this->command->info('User table seeded!');
|
||||
}
|
||||
}
|
||||
|
||||
class UserTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
// DB::table('users')->delete();
|
||||
|
||||
// User::create([
|
||||
// 'name' => str_random(10),
|
||||
// 'email' => 'foo@gmail.com',
|
||||
// 'password' => bcrypt('secret')
|
||||
// ]);
|
||||
DB::table('users')->insert([
|
||||
[
|
||||
'name' => "user1",
|
||||
'email' => "user1" . '@gmail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
],
|
||||
[
|
||||
'name' => "admin",
|
||||
'email' => 'arno.kaimbacher@hotmail.de',
|
||||
'password' => bcrypt('admin007'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class PeriodeTableSeeder extends Seeder
|
||||
{
|
||||
|
@ -71,8 +49,7 @@ class PeriodeTableSeeder extends Seeder
|
|||
DB::table('periodes')->insert([
|
||||
'id' => '1',
|
||||
'days' => '100',
|
||||
'created_at' => '2015-06-09 02:59:49',
|
||||
'updated_at' => '2015-06-10 08:14:27',
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -117,151 +94,6 @@ class CategoryTableSeeder extends Seeder
|
|||
}
|
||||
}
|
||||
|
||||
class BookTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
// DB::table('users')->delete();
|
||||
|
||||
// User::create([
|
||||
// 'name' => str_random(10),
|
||||
// 'email' => 'foo@gmail.com',
|
||||
// 'password' => bcrypt('secret')
|
||||
// ]);
|
||||
DB::table('books')->insert([
|
||||
[
|
||||
// 'id' => '1',
|
||||
'title' => 'Laravel 5',
|
||||
'author' => 'Arno Kaimbacher',
|
||||
'year' => '2017',
|
||||
'stock' => '9',
|
||||
'category_id' => '4',
|
||||
'shelf_id' => '1',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
'year_id' => '0',
|
||||
],
|
||||
[
|
||||
// 'id' => '2',
|
||||
'title' => 'Angular.Js',
|
||||
'author' => 'Mark Zuckerberg',
|
||||
'year' => '2014',
|
||||
'stock' => '5',
|
||||
'category_id' => '4',
|
||||
'shelf_id' => '3',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
'year_id' => '0',
|
||||
],
|
||||
[
|
||||
// 'id' => '3',
|
||||
'title' => 'OOP with PHP',
|
||||
'author' => 'Richard Stallman',
|
||||
'year' => '1999',
|
||||
'stock' => '7',
|
||||
'category_id' => '1',
|
||||
'shelf_id' => '2',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
'year_id' => '0',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class ShelfTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
DB::table('shelves')->insert([
|
||||
[
|
||||
'id' => '1',
|
||||
'shelf' => 'A',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '2',
|
||||
'shelf' => 'B',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '3',
|
||||
'shelf' => 'C',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '4',
|
||||
'shelf' => 'D',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '5',
|
||||
'shelf' => 'E',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class StudentTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
DB::table('students')->insert([
|
||||
[
|
||||
'id' => '1',
|
||||
'name' => 'Arno Kaimbacher',
|
||||
'registered_at' => '1432080000',
|
||||
'borrow' => '1',
|
||||
'status' => '1',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '2',
|
||||
'name' => 'Chelsea Islan',
|
||||
'registered_at' => '1433948676',
|
||||
'borrow' => '1',
|
||||
'status' => '1',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '3',
|
||||
'name' => 'John Mayer',
|
||||
'registered_at' => '1434734048',
|
||||
'borrow' => '0',
|
||||
'status' => '1',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '4',
|
||||
'name' => 'Emma Watson',
|
||||
'registered_at' => '1434734067',
|
||||
'borrow' => '1',
|
||||
'status' => '1',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
[
|
||||
'id' => '5',
|
||||
'name' => 'Scarlet Johansson',
|
||||
'registered_at' => '1434734082',
|
||||
'borrow' => '0',
|
||||
'status' => '1',
|
||||
'created_at' => '2015-06-09 00:17:51',
|
||||
'updated_at' => '2015-06-09 01:01:36',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class CollectionTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue