edgji/sylius-quick-start-bundle
Installation
Add the bundle to your composer.json:
composer require edgji/sylius-quick-start-bundle
Enable the bundle in config/bundles.php:
return [
// ...
Edgji\SyliusQuickStartBundle\EdgjiSyliusQuickStartBundle::class => ['all' => true],
];
Configuration Publish the default configuration:
php bin/console edgji:sylius-quick-start:install
This runs migrations, loads fixtures, and sets up a basic Sylius sandbox.
First Use Case
Access the admin panel at /admin (default credentials: admin@example.com / admin). The bundle preconfigures:
Sandbox Setup Use the bundle to bootstrap a Sylius instance for:
# Clone a Sylius repo, install dependencies, then:
composer require edgji/sylius-quick-start-bundle
php bin/console edgji:sylius-quick-start:install --env=dev
Custom Fixtures Override default fixtures by extending the bundle’s configuration:
# config/packages/edgji_sylius_quick_start.yaml
edgji_sylius_quick_start:
fixtures:
products: ['%kernel.project_dir%/config/fixtures/products.yml']
customers: ['%kernel.project_dir%/config/fixtures/customers.yml']
Integration with Custom Plugins Use the sandbox to test plugins before deploying to production:
# Install a plugin (e.g., SyliusLabsMoneyPlugin)
composer require syliuslabs/money-plugin
# Enable and configure it in the sandbox
php bin/console edgji:sylius-quick-start:install --plugin=Sylius\MoneyPlugin\SyliusMoneyPlugin
php bin/console doctrine:database:drop --force --env=dev
php bin/console doctrine:database:create --env=dev
php bin/console edgji:sylius-quick-start:install --env=dev
--debug flag for verbose output:
php bin/console edgji:sylius-quick-start:install --debug
dev vs. test):
# config/packages/dev/edgji_sylius_quick_start.yaml
edgji_sylius_quick_start:
admin_email: dev@example.com
admin_password: devpass
Database Conflicts
php bin/console doctrine:database:drop --force --env=dev
SyliusCoreBundle) without coordination.Fixture Overrides
sylius_fixtures:load). Incorrect YAML structure will break the install:
# Invalid: Missing top-level keys like "Sylius\Bundle\CoreBundle\Fixture\ProductFixture"
products:
- name: "Broken Product"
dump-fixtures to inspect default fixtures:
php bin/console sylius:fixtures:dump
Plugin Compatibility
php bin/console edgji:sylius-quick-start:install --plugin=MyPlugin --no-fixtures
config/packages/dev/monolog.yaml to capture bundle logs:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
php bin/console edgji:sylius-quick-start:install --help
Example output:
Usage:
edgji:sylius-quick-start:install [options]
Options:
--env=ENV The Environment name
--plugin=PLUGIN Install with a specific plugin enabled
--no-fixtures Skip loading default fixtures
--debug Enable verbose output
Custom Installer Logic Extend the bundle’s installer by creating a custom command:
// src/Command/CustomSyliusInstaller.php
namespace App\Command;
use Edgji\SyliusQuickStartBundle\Command\InstallCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CustomSyliusInstaller extends InstallCommand
{
protected function configure(): void
{
$this->setName('app:sylius:install-custom');
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
// Call parent logic
$result = parent::execute($input, $output);
// Add custom steps
$this->addCustomProduct($output);
return $result;
}
private function addCustomProduct(OutputInterface $output): void
{
$output->writeln('Adding custom product...');
// Use Sylius API to create a product
}
}
Configuration Dumping Dump the current configuration to debug issues:
php bin/console debug:config edgji_sylius_quick_start
Event Subscribers
Hook into the bundle’s lifecycle via events (e.g., sylius_quick_start.install.start):
// src/EventListener/SyliusInstallListener.php
namespace App\EventListener;
use Edgji\SyliusQuickStartBundle\Event\InstallEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class SyliusInstallListener implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
InstallEvent::START => 'onInstallStart',
];
}
public function onInstallStart(InstallEvent $event): void
{
$event->getOutput()->writeln('Custom logic on install start!');
}
}
How can I help you explore Laravel packages today?