Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Symfony Demo Bundle Laravel Package

danielm/symfony-demo-bundle

Demo Symfony bundle showing common bundle features: console command, services/contracts, events/subscriber, Twig extension, controllers with JSON/HTML routes, config with env vars, translations and public assets. Useful as a Symfony Flex recipe/demo reference.

View on GitHub
Deep Wiki
Context7

🚀 Symfony Bundle Demo

Build Status Build Status Build Status

See my blog post about this:

https://danielmg.org/php/2023/02/extending-symfony-bundle-flex-recipes-and-private-repositories.html

About

This project is part of my Post series about how to build a Symfony Flex Recipes repository (private or not).

This bundle is a demo that shows a couple of things yo can do on a Symfony bundle, such as:

Includes

  • Console Command: bin/console demo:command
  • DemoServiceInterface & DemoService: Example of some kind of Contract/Adapter-like patter of a service
  • Events: Custom event UnnecessaryEvent and simple EventSubscriber DemoSubscriber
  • DemoTwigExtension: Adds a twig function demoFcn()
  • Controller:
    • Route /{a}/{b} -> Simple endpoint that returns a Json response with some values and adds a + b
    • Route /view -> Simple endpoint that renders a Twig template and returns HTML
    • Route /dispatch/{md5_hash} -> Simple endpoint to test dispatching our UnnecessaryEvent
  • Configuration
    • Using Bundle config parameters
    • Using Custom Env variables DEMO_SAMPLE_ENV
  • Usage of Translations and public assets.

Install

Using Symfony Recipe

composer require danielm/symfony-demo-bundle

Manually

Same composer command as using the Recipe, you will also need to create/edit some files manually (that's what a Symfony recipe does for you)

...

Composer scripts

Coding Standards (follows symfony's default rules)

# Displays errors
composer run cs:check
# Makes changes
composer run cs:fix

Testing

composer run test

PHP code analysis

composer run stan

Todo

  • Validators examples
  • Serialization examples
  • Test Event & dispatcher
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui