2015-07-19 06:49:24 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Seeder;
|
2019-08-29 14:58:35 +00:00
|
|
|
use Carbon\Carbon;
|
2015-07-19 06:49:24 +00:00
|
|
|
|
2018-09-06 15:58:54 +00:00
|
|
|
class DatabaseSeeder extends Seeder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the database seeds.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
// Model::unguard();
|
2015-07-19 06:49:24 +00:00
|
|
|
|
2018-09-06 15:58:54 +00:00
|
|
|
// DB::table('users')->insert([
|
2018-08-06 12:30:51 +00:00
|
|
|
// 'name' => str_random(10),
|
|
|
|
// 'email' => str_random(10).'@gmail.com',
|
|
|
|
// 'password' => bcrypt('secret'),
|
|
|
|
// ]);
|
|
|
|
|
2019-08-29 14:58:35 +00:00
|
|
|
|
|
|
|
// $this->call('CategoryTableSeeder');
|
|
|
|
// $this->call('BookTableSeeder');
|
2019-08-29 15:51:13 +00:00
|
|
|
$this->call('MimetypeTableSeeder');
|
2019-08-29 14:58:35 +00:00
|
|
|
$this->call('AccountsTableSeeder');
|
|
|
|
$this->call('RolesTableSeeder');
|
|
|
|
$this->call('LicencesTableSeeder');
|
|
|
|
$this->call('LanguagesTableSeeder');
|
|
|
|
$this->call('PagesTableSeeder');
|
2019-09-02 14:58:08 +00:00
|
|
|
$this->call('CollectionsTableSeeder');
|
2019-09-03 15:43:56 +00:00
|
|
|
$this->call('ProjectsTableSeeder');
|
2018-09-06 15:58:54 +00:00
|
|
|
$this->command->info('User table seeded!');
|
|
|
|
}
|
2015-07-19 06:49:24 +00:00
|
|
|
}
|
2018-08-06 12:30:51 +00:00
|
|
|
|
2018-09-06 15:58:54 +00:00
|
|
|
class CollectionTableSeeder extends Seeder
|
|
|
|
{
|
2018-08-06 12:30:51 +00:00
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
// DB::table('users')->delete();
|
|
|
|
|
|
|
|
// User::create([
|
2018-09-06 15:58:54 +00:00
|
|
|
// 'name' => str_random(10),
|
|
|
|
// 'email' => 'foo@gmail.com',
|
|
|
|
// 'password' => bcrypt('secret')
|
|
|
|
// ]);
|
|
|
|
DB::table('collections')->insert([
|
|
|
|
[
|
|
|
|
'id' => '0',
|
|
|
|
'number' => null,
|
|
|
|
'name' => 'first collection',
|
|
|
|
'parent_id' => null,
|
|
|
|
'created_at' => new DateTime(),
|
|
|
|
'updated_at' => new DateTime(),
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'id' => '1',
|
|
|
|
'number' => '0',
|
|
|
|
'name' => 'Informatik, Informationswissenschaft, allgemeine Werke',
|
|
|
|
'parent_id' => '0',
|
|
|
|
'created_at' => '2015-06-09 00:17:51',
|
|
|
|
'updated_at' => '2015-06-09 01:01:36',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'id' => '2',
|
|
|
|
'number' => '1',
|
|
|
|
'name' => 'Philosophie und Psychologie',
|
|
|
|
'parent_id' => '0',
|
|
|
|
'created_at' => '2015-06-09 01:07:41',
|
|
|
|
'updated_at' => '2015-06-09 01:07:41',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'id' => '3',
|
|
|
|
'number' => '2',
|
|
|
|
'name' => 'Religion',
|
|
|
|
'parent_id' => '0',
|
|
|
|
'created_at' => '2015-06-09 01:07:50',
|
|
|
|
'updated_at' => '2015-06-09 01:07:50',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'id' => '4',
|
|
|
|
'number' => '3',
|
|
|
|
'name' => 'Sozialwissenschaften',
|
|
|
|
'parent_id' => '0',
|
|
|
|
'created_at' => '2015-06-09 01:07:50',
|
|
|
|
'updated_at' => '2015-06-09 01:07:50',
|
|
|
|
],
|
|
|
|
]);
|
2018-08-06 12:30:51 +00:00
|
|
|
}
|
2019-08-29 15:51:13 +00:00
|
|
|
}
|