Category: Symfony

  • New Symfony Project

    When I start symfony projects I like to have certain things installed to start with – heres the command I run to get things setup.

    symfony new project-name --webapp

    I always start with the webapp project just because everything is always web facing I work on

    composer require template
    composer require profiler --dev
    composer require debug
    composer require symfony/asset
    composer require maker --dev
    composer require symfony/orm-pack --with-all-dependencies
    composer require form validator
    composer require symfony/mailer
    composer require symfony/apache-pack
    composer require gedmo/doctrine-extensions --update-with-dependencies 
    composer require stof/doctrine-extensions-bundle
    composer require symfony/http-client

    after setting up the .env file for a database

    php bin/console doctrine:database:create
    php bin/console make:entity
    php bin/console make:migration
    php bin/console doctrine:migrations:migrate

    then creating users

    composer require security
    php bin/console make:user
    Edit the user entity php bin/console make:entity User
    php bin/console make:migration
    php bin/console doctrine:migrations:migrate
    php bin/console make:controller SecurityController (do not add anything to controller)
    php bin/console make:auth (1, LoginFormAuthenticator, SecurityController, yes logout)
    composer require symfony/expression-language
    composer require symfonycasts/verify-email-bundle
    php bin/console make:registration-form