samyasm / digitalblogbundle
Blog bundle for symfony ^4.4
Installs: 50
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Language:Twig
Type:symfony-bundle
pkg:composer/samyasm/digitalblogbundle
Requires
- php: >=7.2
 - ext-curl: *
 - ext-json: *
 - doctrine/common: ^2.1|^3.3
 - doctrine/doctrine-bundle: ^2.1
 - doctrine/orm: ^2.7
 - knplabs/knp-paginator-bundle: ^5.1
 - nelmio/api-doc-bundle: ^3.0
 - sensio/framework-extra-bundle: ^5.6
 - symfony/console: 4.4.*
 - symfony/dotenv: 4.4.*
 - symfony/flex: ^1.3.1
 - symfony/framework-bundle: 4.4.*
 - symfony/http-foundation: ^4.4|^5.4
 - symfony/http-kernel: ^4.4
 - symfony/monolog-bundle: ^3.6|^3.7
 - symfony/security-bundle: 4.4.*
 - symfony/swiftmailer-bundle: ^3.4
 - symfony/templating: ^3.4|^4.0|^5.0
 - symfony/translation: ^4.4|^5.0
 - symfony/validator: 4.4.*
 - symfony/yaml: ^3.4|^4.0|^5.0
 - twig/twig: ^1.41|^2.10|^3.0
 
README
This bundle is made to facilitate basic blog integration inside symfony 4 apps
It requires
"php": ">=7.2",
"ext-curl": "*",
"ext-json": "*",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/orm": "^2.7",
"nelmio/api-doc-bundle": "^3.0",
"symfony/security-bundle": "4.4.*",
"symfony/swiftmailer-bundle": "^3.4",
"symfony/translation": "4.4.*",
"symfony/validator": "4.4.*",
"symfony/yaml": "4.4.*",
"twig/twig": "^2.12|^3.0"
Installation
composer require samyasm/digitalblogbundle
Configurations
Routing
Open config/routes.yaml and add this to configure routing to blog
digital_blog:
  resource: '@DigitalBlogBundle/Resources/config/routes.yaml'
  prefix: /blog/ 
  #You can set any prefix you want :-)
Bundle configuration
create the file config/packages/digital_blog.yaml and put this content
digital_blog:
  
  assets:
    logo: 'assets-front/assets/img/logo.png'
    hero_bg: 'assets-app/images/banner.jpg'
    
  theme:
    color_primary: '#7083ff'
    color_secondary: '#f5ec78'
    
  routing:
    #You can put what you want
    prefix: '/my-blog'
  
  store:
    author_image_store: 'uploads/author/'
    article_image_store: 'uploads/article/'
    category_image_store: 'uploads/category/'
Make sure all these directories have write access
Open the file config/packages/security.yaml and add this content
security:
    encoders:
        # ...
        
        #Add encoder for Author entity, considered as users in administration
        
        Dhi\BlogBundle\Entity\Author:
            algorithm: sha512
            cost: 12
Make sure to have Dhi\BlogBundle\DigitalBlogBundle::class => ['all' => true], into config/bundles.php and add this content
Env
SESSION_LIFE_TIME=3600
#in Kb
MAX_FILE_SIZE=4048
SESSION_DIGITAL_BLOG_TOKEN=auth_blog_token
DIGITAL_BLOG_EMAIL_SENDER=support@dhi-academy.com
DIGITAL_BLOG_EMAIL_FROM=Support
DIGITAL_BLOG_ADMIN_EMAIL=example@example.com
DIGITAL_BLOG_ADMIN_PASSWORD=password
DIGITAL_BLOG_ADMIN_NAME=admin
Update schema
php bin/console doctrine:schema:update --force
Install first super admin
php bin/console digital:blog:setup