composer require fluffy-factory/user-stats
Add mixin Class use UserStats
in your User entity
class User
{
### ADD THIS ###
use UserStats;
...
}
Make a database schema update
php bin/console d:s:u --force
Create routes file config/routes/fluffy_user_stats.yaml
with the below config:
fluffy_user_stats:
resource: "@UserStatsBundle/Controller/UserStatsController.php"
type: annotation
# prefix: /admin
Add custom actions in your entity configuration
actions:
- { name: 'fluffy_user_stats', type: 'route', label: false, icon: 'user', css_class: 'btn btn-primary' }