Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvaro-canepa/2defa70766a8429c931804fc9f3f5a33 to your computer and use it in GitHub Desktop.
Save alvaro-canepa/2defa70766a8429c931804fc9f3f5a33 to your computer and use it in GitHub Desktop.
PHP OctoberCMS plugin seeder for PHPStorm file template
<?php
#if (${NAMESPACE}) namespace ${NAMESPACE};
#end
use October\Rain\Database\Updates\Seeder;
use Symfony\Component\Console\Helper\ProgressBar;
/**
* Class ${NAME}
*
* @package ${NAMESPACE}
* @mixin \Illuminate\Database\Seeder
*
*/
class ${NAME} extends Seeder
{
/**
* @var \Symfony\Component\Console\Helper\ProgressBar
*/
protected ${DS}bar;
public function run()
{
ProgressBar::setFormatDefinition('custom', ' %current%/%max% [%bar%] %percent:3s%% -- %message%');
${DS}this->bar = new ProgressBar(${DS}this->command->getOutput(), 'REPLACE WITH COUNTER');
${DS}this->bar->setFormat('custom');
${DS}this->bar->setMessage('Starting seed migration');
${DS}this->bar->start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment