Installation
composer require birko/minishop-bundle
Add to config/bundles.php:
Birko\MiniShopBundle\BirkoMiniShopBundle::class => ['all' => true],
First Use Case
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
/admin) to configure products, categories, and orders.Key Configuration
Check config/packages/birko_minishop.yaml for:
Product Management
Product entity (src/Entity/Product) for CRUD operations.$product = new Product();
$product->setName('Laptop');
$product->setPrice(999.99);
$product->setCategory($categoryEntity);
$em->persist($product);
$em->flush();
Order Processing
Order entity (src/Entity/Order) for custom logic.OrderService for workflows:
$order = $orderService->createOrder($cartId, $user);
$orderService->processPayment($order);
Frontend Integration
src/Twig/) for dynamic content:
{{ minishop_cart_total() }}
src/Event/):
$dispatcher->addListener(OrderEvents::ORDER_CREATED, function (OrderEvent $event) {
// Custom logic on order creation
});
API Endpoints
# config/routes.yaml
minishop_api:
resource: "@BirkoMiniShopBundle/Resources/config/routing/api.yaml"
prefix: /api
MiniShopManager for core functionality:
public function __construct(private MiniShopManager $miniShop) {}
ProductUpdatedEvent or OrderStatusChangedEvent.birko_minishop:
currency: 'USD'
tax_rate: 0.08
Doctrine Migrations
ColumnNotFoundException.php bin/console doctrine:schema:update --force
Caching Issues
php bin/console cache:clear
MiniShopCache service for manual cache invalidation:
$this->miniShop->getCache()->invalidate('product_list');
Payment Gateways
config/packages/birko_minishop.yaml.payment_gateways:
stripe:
test_mode: true
Admin Panel Permissions
ROLE_MINISHOP_ADMIN:
# config/packages/security.yaml
role_hierarchy:
ROLE_ADMIN: ROLE_MINISHOP_ADMIN
APP_DEBUG=true in .env for detailed logs.var/log/dev.log for event dispatching issues.php bin/console doctrine:query:sql "SELECT * FROM product"
Custom Fields
Product entity with traits or use Doctrine extensions:
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @Gedmo\Slug(fields={"name"})
*/
private $slug;
Payment Methods
PaymentGatewayInterface for new gateways:
class PayPalGateway implements PaymentGatewayInterface {
public function processPayment(Order $order, array $data): bool { ... }
}
Theming
templates/birko_minishop/:
{# templates/birko_minishop/product/show.html.twig #}
{% extends 'birko_minishop/base.html.twig' %}
API Extensions
src/Resources/config/routing/api.yaml:
minishop_custom_api:
path: /api/custom
methods: GET
defaults: { _controller: 'App\Controller\CustomApiController::index' }
How can I help you explore Laravel packages today?