Auto generated seed file.

@return void
487726
public function run()
    {
        $permissionAccessCms = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'access-cms',
            'display_name' => 'Access CMS',
            'description'  => 'Allow login/access to CMS.',
            'category'     => 'Application',
        ]);

        $permissionViewDrafts = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'view-drafts',
            'display_name' => 'View Drafts',
            'description'  => 'View content in draft mode on the live site.',
            'category'     => 'Application',
        ]);

        $permissionViewApplicationSettings = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'view-application-settings',
            'display_name' => 'View Application Settings',
            'description'  => 'View settings used for configuring the application.',
            'category'     => 'Application',
        ]);

        $permissionEditApplicationSettings = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'edit-application-settings',
            'display_name' => 'Edit Application Settings',
            'description'  => 'Edit settings used for configuring the application.',
            'category'     => 'Application',
        ]);

        /*

        $permissionCreateApplicationSettings = Permission::create([
            'name'         => 'create-application-settings',
            'display_name' => 'Create Application Settings',
            'description'  => 'Create settings used for configuring the application.',
            'category'     => 'Application',
        ]);

        $permissionDeleteApplicationSettings = Permission::create([
            'name'         => 'delete-application-settings',
            'display_name' => 'Delete Application Settings',
            'description'  => 'Delete settings used for configuring the application.',
            'category'     => 'Application',
        ]);

        */

        $permissionManageApplicationUrls = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'manage-application-urls',
            'display_name' => 'Manage Application Urls',
            'description'  => 'Manage urls assoicated with the application.',
            'category'     => 'Application',
        ]);

        $permissionViewUsers = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'view-users',
            'display_name' => 'View Users',
            'description'  => 'View list of users and their details.',
            'category'     => 'Users',
        ]);

        $permissionEditUsers = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'edit-users',
            'display_name' => 'Edit Users',
            'description'  => 'Edit user profile information.',
            'category'     => 'Users',
        ]);

        $permissionCreateUsers = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'create-users',
            'display_name' => 'Create Users',
            'description'  => 'Create new user accounts.',
            'category'     => 'Users',
        ]);

        $permissionDeleteUsers = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'delete-users',
            'display_name' => 'Delete Users',
            'description'  => 'Delete existing user accounts.',
            'category'     => 'Users',
        ]);

        $permissionAssignUserRoles = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'assign-user-roles',
            'display_name' => 'Assign User-roles',
            'description'  => 'Assign roles to users.',
            'category'     => 'Users',
        ]);

        $permissionViewRoles = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'view-roles',
            'display_name' => 'View Roles',
            'description'  => 'View list of roles and their details.',
            'category'     => 'Roles',
        ]);

        $permissionEditRoles = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'edit-roles',
            'display_name' => 'Edit Roles',
            'description'  => 'Edit role information.',
            'category'     => 'Roles',
        ]);

        $permissionCreateRoles = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'create-roles',
            'display_name' => 'Create Roles',
            'description'  => 'Create new roles.',
            'category'     => 'Roles',
        ]);

        $permissionDeleteRoles = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'delete-roles',
            'display_name' => 'Delete Roles',
            'description'  => 'Delete existing roles.',
            'category'     => 'Roles',
        ]);

        $permissionViewPermissions = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'view-permissions',
            'display_name' => 'View Permissions',
            'description'  => 'View list of permissions and their details.',
            'category'     => 'Permissions',
        ]);

        $permissionEditPermissions = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'edit-permissions',
            'display_name' => 'Edit Permissions',
            'description'  => 'Edit permission information.',
            'category'     => 'Permissions',
        ]);

        $permissionCreatePermissions = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'create-permission',
            'display_name' => 'Create Permissions',
            'description'  => 'Create new permission.',
            'category'     => 'Permissions',
        ]);

        $permissionDeletePermissions = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'delete-permission',
            'display_name' => 'Delete Permissions',
            'description'  => 'Delete existing permissions.',
            'category'     => 'Permissions',
        ]);

        $permissionAssignRolePermissions = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'assign-role-permissions',
            'display_name' => 'Assign Role-permissions',
            'description'  => 'Assign permissions to roles.',
            'category'     => 'Permissions',
        ]);

        $permissionManageOwnRolePermissions = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'manage-own-permissions',
            'display_name' => 'Manage Own Permissions',
            'description'  => 'Manage roles and permissions for own account.',
            'category'     => 'Roles',
        ]);

        $permissionViewPages = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'view-pages',
            'display_name' => 'View Pages',
            'description'  => 'View list of pages and their contents.',
            'category'     => 'Pages',
        ]);

        $permissionEditPages = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'edit-pages',
            'display_name' => 'Edit Pages',
            'description'  => 'Edit page content.',
            'category'     => 'Pages',
        ]);

        $permissionCreatePages = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'create-pages',
            'display_name' => 'Create Pages',
            'description'  => 'Create new pages.',
            'category'     => 'Pages',
        ]);

        $permissionDeletePages = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'delete-pages',
            'display_name' => 'Delete Pages',
            'description'  => 'Delete existing pages.',
            'category'     => 'Pages',
        ]);

        $permissionManageContentTypes = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'manage-content-types',
            'display_name' => 'Manage Content Types',
            'description'  => 'Manage types to build content from.',
            'category'     => 'Pages',
        ]);

        $permissionAdvancedPages = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'advanced-pages',
            'display_name' => 'Pages (advanced options)',
            'description'  => 'Access advanced page options.',
            'category'     => 'Pages',
        ]);

        $permissionAttachBlocks = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'attach-blocks',
            'display_name' => 'Attach Blocks',
            'description'  => 'Attach new block types to pages.',
            'category'     => 'Blocks',
        ]);

        $permissionDetachBlocks = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'detach-blocks',
            'display_name' => 'Detach Blocks',
            'description'  => 'Detach existing block types from pages.',
            'category'     => 'Blocks',
        ]);

        $permissionManageBlockTypes = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'manage-block-types',
            'display_name' => 'Manage Block Types',
            'description'  => 'Manage types to build blocks from.',
            'category'     => 'Blocks',
        ]);

        $permissionManageFields = Permission::withoutGlobalScopes()->firstOrCreate([
            'name'         => 'manage-fields',
            'display_name' => 'Manage Fields',
            'description'  => 'Manage fields association with page/block content.',
            'category'     => 'Fields',
        ]);

        if ($developer = Role::withoutGlobalScopes()->where('name', 'developer')->first()) {
            $developer->attachPermissions([
                //$permissionCreateApplicationSettings,
                //$permissionDeleteApplicationSettings,
                $permissionManageApplicationUrls,
                $permissionManageContentTypes,
                $permissionAdvancedPages,
                $permissionManageBlockTypes,
                $permissionManageFields,
                $permissionViewDrafts,
                $permissionAttachBlocks,
                $permissionDetachBlocks,
                $permissionViewRoles,
                $permissionEditRoles,
                $permissionCreateRoles,
                $permissionDeleteRoles,
                $permissionManageOwnRolePermissions,
                $permissionAssignRolePermissions,
                $permissionViewPermissions,
                $permissionEditPermissions,
                $permissionCreatePermissions,
                $permissionDeletePermissions,
            ]);
        }

        if ($superAdmin = Role::withoutGlobalScopes()->where('name', 'super-admin')->first()) {
            $superAdmin->attachPermissions([
                $permissionAccessCms,
                $permissionViewDrafts,
                $permissionViewApplicationSettings,
                $permissionEditApplicationSettings,
                $permissionViewUsers,
                $permissionEditUsers,
                $permissionCreateUsers,
                $permissionDeleteUsers,
                $permissionAssignUserRoles,
                $permissionViewPages,
                $permissionEditPages,
                $permissionCreatePages,
                $permissionDeletePages,
            ]);
        }

        if ($admin = Role::withoutGlobalScopes()->where('name', 'admin')->first()) {
            $admin->attachPermissions([
                $permissionAccessCms,
                $permissionViewDrafts,
                $permissionViewApplicationSettings,
                $permissionEditApplicationSettings,
                $permissionViewUsers,
                $permissionEditUsers,
                $permissionCreateUsers,
                $permissionDeleteUsers,
                $permissionAssignUserRoles,
                $permissionViewPages,
                $permissionEditPages,
                $permissionCreatePages,
                $permissionDeletePages,
            ]);
        }
    }
478460
public function createImage($seed = '', $file = '')
    {
        $svg = $this->generateSVGImage($seed, true);
        if ($file) {
            file_put_contents($file, $svg);
        } else {
            header("Content-type: image/svg+xml");
            echo $svg;
        }
    }
201766
protected function registerSeeder()
    {
        $this->app['generate.seeder'] = $this->app->share(function($app)
        {
            $generator = $this->app->make('Way\Generators\Generator');

            return new SeederGeneratorCommand($generator);
        });

        $this->commands('generate.seeder');
    }
1299791
public function generate($seeder)
    {
        $generator = new Generator(
            $this->setting->getSeederDirectory(),
            "{$seeder}_seeder"
        );

        if ($generator->fileExists()) {
            echo "\033[0;31mThe seeder already exists.\033[00m";

            exit(1);
        }

        $num = (int)  $this->arg->options()->get('--seed', 5);

        $generator->write('seed', [
            'num' => $num,
            'name' => $seeder
        ]);

        echo "\033[0;32mThe seeder has been created.\033[00m\n";

        exit(0);
    }
775410
final protected function runDatabaseMigrationsAndSeeders()
    {
        // Ask to migrate the database,
        // if we've copied any migration files to the application.
        if (!empty($this->migrations) && $this->getCommand()->confirm('Do you wish to migrate your database?', true)) {
            try {
                $this->getCommand()->call('migrate');
            } catch (Exception $e) {
                $this->getCommand()->error(sprintf('Could not migrate your database. Reason: %s', $e->getMessage()));
            }
        }

        // Before we ask user to seed the database
        // we need to have look in the $seeders array
        // to remove folders from the array
        $seeders = [];
        foreach ($this->seeders as $seeder) {
            if (is_dir(base_path($seeder))) {
                continue;
            }
            $seeders[] = $seeder;
        }

        // Ask to seed the database,
        // if we've copied any migration files to the application.
        if (!empty($seeders) && $this->getCommand()->confirm('Do you wish to seed your database?', true)) {
            // Load seeders directory so new seeders are available
            load_directory($this->getInstaller()->getBasePath('database/seeds/'));

            // Run package seeders
            foreach ($seeders as $seeder) {
                try {
                    $seederFilename = substr($seeder, strrpos($seeder, '/') + 1);
                    $this->getCommand()->call('db:seed', [
                        '--class' => substr($seederFilename, 0, strrpos($seederFilename, '.')),
                    ]);
                } catch (Exception $e) {
                    $this->getCommand()->error(sprintf('Could not seed database. Reason: %s', $e->getMessage()));
                }
            }
        }
    }
38404
public function generateFiles()
    {
        foreach ($this->getFiles() as $stub => $file) {
            $path = $this->module->getModulePath($this->getName()) . $file;

            if (!$this->filesystem->isDirectory($dir = dirname($path))) {
                $this->filesystem->makeDirectory($dir, 0775, true);
            }

            $this->filesystem->put($path, $this->getStubContents($stub));
        }
    }
982632
protected function _generateFiles() {
        $this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", false);
        $this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", false);
        
        $this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", true);
        $this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", true);

        foreach ($this->extendableFiles as $extendableFile)
            $this->files[] = $extendableFile;
    }
1025105
protected function _generateFiles() {
        if ($this->feature && !$this->isSelectedFeature($this->feature)) {
            $this->logFile->log(null, "did not add runtime information because \"$this->feature\" is not selected");
            return;
        }
        
        $this->files[] = fphp\File\TemplateFile::fromSpecification(
            fphp\Specification\TemplateSpecification::fromArrayAndSettings(
                array(
                    "source" => "Runtime.php.template",
                    "target" => $this->target,
                    "rules" => array(
                        array("assign" => "class", "to" => $this->class),
                        array("assign" => "getter", "to" => $this->getter),
                        array("assign" => "selectedFeatures", "to" => $this->encodeFeatureNames($this->selectedArtifacts)),
                        array("assign" => "deselectedFeatures", "to" => $this->encodeFeatureNames($this->deselectedArtifacts))
                    )
                ), Settings::inDirectory(__DIR__))
        );
    }
129589
protected function _generateFiles() {
        if ($this->feature && !$this->isSelectedFeature($this->feature)) {
            $this->logFile->log(null, "did not add aspect kernel because \"$this->feature\" is not selected");
            return;
        }

        parent::_generateFiles();
        $this->files = array_merge($this->files,
                                   $this->aspectKernel->generateFiles($this->class, $this->target));
    }
155312
function Generate()
    {
        if ($this->cacher->MustUseCache())
        {
            $this->xml = $this->cacher->GetFromCache();
            return;
        }
        $this->AddAllPages();
        $this->xml = $this->sitemap->SaveXml();
        if ($this->cacher->MustStoreToCache())
        {
            $this->cacher->StoreToCache($this->xml);
        }
    }
697925
public function run()
    {
        Model::unguard();
        try {
            foreach ($this->seederClasses as $seederClass) {
                $this->parentSeeder->call($seederClass);
            }
        } finally {
            Model::reguard();
        }
    }
371661
private function seed()
    {
        $action = $this->arg->getParameter('action');

        if (!in_array($action, ['all', 'table'])) {
            $this->throwFailsCommand('This action is not exists', 'help seed');
        }

        if ($action == 'all') {
            if ($this->arg->getParameter('target') != null) {
                $this->throwFailsAction('Bad command usage', 'help seed');
            }
        }

        // Set command for understand
        $command = $action;

        $this->command->call(
            $command,
            'seeder',
            $this->arg->getParameter('target')
        );
    }
72168
public function generate()
    {
        $name = $this->getName();

        if ($this->module->has($name)) {
            if ($this->force) {
                $this->module->delete($name);
            } else {
                $this->console->error("Module [{$name}] already exist!");

                return;
            }
        }

        $this->generateFolders();

        $this->generateFiles();

        if (!$this->plain) {
            $this->generateResources();
        }

        $this->console->info("Module [{$name}] created successfully.");
    }
624362
final public function generate() {
        $options = array_merge($this->options, (array) 'generate');
        Generator::call($this->called, $this->args, $options);
    }
805901
public function run()
    {
        $this->seed('CategoriesTableSeeder');
        $this->seed('UsersTableSeeder');
        $this->seed('PostsTableSeeder');
        $this->seed('PagesTableSeeder');
        $this->seed('SettingsTableSeeder');
        $this->seed('TranslationsTableSeeder');
    }
562102
public function run()
    {
        // php artisan db:seed --class="PermissionsTableSeeder"
        $permissions = [
            [
                'name' => 'manage_users',
            ],
            [
                'name' => 'manage_pages',
            ],
            [
                'name' => 'access_admin',
            ],
        ];

        // Only add new
        $allPermissions = Permission::all()->pluck('name')->toArray();

        foreach ($permissions as $permission) {
            if (! in_array($permission['name'], $allPermissions)) {
                Permission::create($permission);
            }
        }
    }
1279849
private function seedUserTables()
    {
        if (Status::count() === 0) {
            $this->comment('Seeding user_statuses...');
            $this->call('db:seed', ['--class' => 'UserStatus']);
        } else {
            $this->comment('Table user_statuses is not empty.  Skipping seed...');
        }

        if (Role::count() === 0) {
            $this->comment('Seeding rbac_roles...');
            $this->call('db:seed', ['--class' => 'UserRoles']);
        } else {
            $this->comment('Table rbac_roles is not empty.  Skipping seed...');
        }
    }