If you've installed EasyAdminPlus
v1.x and you want to upgrade to 2.x, follow this quick guide.
// composer.json
{
"require": {
// ...
"wandi/easyadmin-plus-bundle": "^2.0",
// ...
}
}
> composer update wandi/easyadmin-plus-bundle
EasyAdminPlusBundle
1.x implementeded entity/action role permissions
thanks to the role
attribute.
# config/packages/entities/{entity}.yaml
easy_admin:
entities:
Product:
class: App\Entity\Product
list:
role: ['ROLE_EASY_ADMIN_SUPER']
# ...
Sadly EasyAdminBundle
introduced this feature with to the item_permission
attribute.
# config/packages/entities/{entity}.yaml
easy_admin:
entities:
Product:
class: App\Entity\Product
list:
item_permission: ['ROLE_EASY_ADMIN_SUPER']
# ...
Search in all your EasyAdmin
configuration files (config/packages/easy_admin/
directory) for role:
occurrences and just replace them by item_permission:
EasyAdminBundle
2.x upgraded Bootstrap
to version 4 and deleted the vertical form_theme
.
# config/packages/entities/{entity}.yaml
easy_admin:
entities:
Article:
class: App\Entity\Article
list:
fields:
- { type: 'group', css_class: 'col-sm-6', label: 'Infos', icon: 'info-circle' }
- { property: title, css_class: 'col-sm-6', label: 'Title' }
- { property: slug, css_class: 'col-sm-6', label: 'Slug' }
- { type: 'group', label: 'NB', icon: 'bar-chart' }
- { property: nbLikes, css_class: 'col-sm-4', label: 'NB Likes', type_options: { disabled: true } }
- { property: nbComments, css_class: 'col-sm-4', label: 'NB Comments', type_options: { disabled: true } }
- { property: nbShares, css_class: 'col-sm-4', label: 'NB Shares', type_options: { disabled: true } }
# ...
# config/packages/entities/{entity}.yaml
easy_admin:
entities:
Article:
class: App\Entity\Article
list:
fields:
- { type: 'group', columns: 6, label: 'Infos', icon: 'info-circle' }
- { property: title, columns: 6, label: 'Title' }
- { property: slug, columns: 6, label: 'Slug' }
- { type: 'group', label: 'NB', icon: 'bar-chart' }
- { property: nbLikes, columns: 4, label: 'NB Likes', type_options: { disabled: true } }
- { property: nbComments, columns: 4, label: 'NB Comments', type_options: { disabled: true } }
- { property: nbShares, columns: 4, label: 'NB Shares', type_options: { disabled: true } }
# ...
Search in all your EasyAdmin
configuration files (config/packages/easy_admin/
directory) for css_class: 'col-sm-(\d?)'
occurrences and just replace them by columns: $1
If you used the vertical form_theme
, simply remove it, you can still use flex grid with the columns
attribute (see above)
# config/packages/easy_admin/design.yaml
easy_admin:
# ...
design:
form_theme:
- 'vertical'
# ...
# config/packages/easy_admin/design.yaml
easy_admin:
# ...
design:
form_theme:
#- 'vertical'
# other form_themes...
# ...
And that's it!
Next chapter: Chapter 1 - Authentication