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

Easyadmin Plus Bundle Laravel Package

2lenet/easyadmin-plus-bundle

View on GitHub
Deep Wiki
Context7

Generator

EasyAdminPlus is packaged with a generator which create the default EasyAdmin configuration file based on your Entities reflection.

Intro

:exclamation: The purpose of this generator is not to write all the configuration for you but to get rid of the tedious writing time of the settings if you've many entities.

Up to you to enrich these settings by yourself after the complete generation.

Generator tries to guess to correct type based on several reflection processes:

  • PHP typehinting
  • Doctrine types
  • Annotations
  • Asserts

Configuration

# config/packages/lle_easyadmin_plus.yaml
lle_easy_admin_plus:
   generator:
   # The level of indentation of the Yaml Dumper
   dump_indentation: 4
   # The level where you switch to inline YAML
   dump_inline: 6
   # the name of the Backend
   name_backend: Back Office
   # name of your custom translation domain
   translation_domain:
   # list of bundles whose entities will not be generated by the generator
   bundles_filter:
       - LleEasyAdminPlusBundle
       - ...
   # list of available actions by methods
   methods:
       list:
           - new
           - show
           - edit
           - delete
           - ...
       show:
           - edit
           - delete
       edit: []
       new: []
   # list of icons assigned to each action
   icons:
       actions:
           - {new: add}
           - {show: search}
           - {edit: edit}
           - {delete: trash}
           - ...
   fields:
       methods:
           - new
           - show
       labels: ~
   # array
   sort:
       #list of methods where sorting is available
       methods:
           - list
       properties:
           - { name: 'position', order: 'ASC' , edit_in_place: true}
           - { name: 'id', order: 'DESC' }
   # list og web assets to load in the backend pages
   assets:
       # JavaScript files
       js:
           - /bundles/cksourceckfinder/ckfinder/ckfinder.js
           - ...
       # CSS files
       css:
           - ...       

All the settings are optional.

Entities used for the example

  • Comment

  • Post

  • Tags

Commands

Generate configuration files

php bin/console lle:easy-admin-plus:generator:generate

At first launch, the command will create the easy_admin folder, in it will be generated:

  • Generated Post entity configuration file
# config/packages/easy_admin/entities/app_post.yaml
easy_admin:
   entities:
       app_post:
           class: App\Entity\Post
           disabled_actions: []
           list:
               title: 'List post'
               actions:
                   - { name: new, label: new, icon: add }
                   - { name: show, label: show, icon: search }
                   - { name: edit, label: edit, icon: edit }
                   - { name: delete, label: delete, icon: trash }
               fields:
                   - { property: id, label: id }
                   - { property: title, label: title }
                   - { property: slug, label: slug }
                   - { property: summary, label: summary }
                   - { property: publishedAt, label: publishedAt }
                   - { property: author, label: author }
                   - { property: tags, label: tags }
               sort:
                   - id
                   - DESC
           show:
               title: 'Fiche post'
               actions:
                   - { name: edit, label: edit, icon: edit }
                   - { name: delete, label: delete, icon: trash }
               fields:
                   - { property: id, label: id }
                   - { property: title, label: title }
                   - { property: slug, label: slug }
                   - { property: summary, label: summary }
                   - { property: content, label: content, type: raw }
                   - { property: publishedAt, label: publishedAt }
                   - { property: author, label: author }
                   - { property: comments, label: comments }
                   - { property: tags, label: tags }
           edit:
               title: 'Edit post'
               actions: []
               fields:
                   - { property: title, label: title }
                   - { property: slug, label: slug }
                   - { property: summary, label: summary }
                   - { property: content, label: content, help: 'The number of characters must be greater than 10.' }
                   - { property: publishedAt, label: publishedAt }
                   - { property: author, label: author, type: easyadmin_autocomplete }
                   - { property: comments, label: comments, type: easyadmin_autocomplete, type_options: { by_reference: false } }
                   - { property: tags, label: tags, type: easyadmin_autocomplete, help: 'The number of elements must be less than or equal to 4.' }
           new:
               title: 'Add post'
               actions: []
               fields:
                   - { property: title, label: title }
                   - { property: slug, label: slug }
                   - { property: summary, label: summary }
                   - { property: content, label: content, help: 'The number of characters must be greater than 10.' }
                   - { property: publishedAt, label: publishedAt }
                   - { property: author, label: author, type: easyadmin_autocomplete }
                   - { property: comments, label: comments, type: easyadmin_autocomplete, type_options: { by_reference: false } }
                   - { property: tags, label: tags, type: easyadmin_autocomplete, help: 'The number of elements must be less than or equal to 4.' }

Generate the configuration file for one or more specific entities

php bin/console lle:easy-admin-plus:generator:entity entity_1 entity_2 ...

If the entities passed as parameters are linked to other entities, we will propose to regenerate their configuration file.

Type Guessing

  • Doctrine match *
  • EA match *

Supported 3rd party vendors

  • VichUploaderBundle
  • StofDoctrineExtensionsBundle

Next chapter: Chapter 3 - Translation Action

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