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

Userbundle Laravel Package

alpixel/userbundle

View on GitHub
Deep Wiki
Context7

AlpixelUserBundle

SensioLabsInsight Build Status StyleCI Scrutinizer Code Quality Latest Stable Version

The AlpixelUserBundle is an integration of FOSUserBundle + Sonata admin for ALPIXEL projects.

It comes bundled with 2 main entity :

  • An abstract BaseUser which should be used to create your main user entity in the project
  • An admin entity extending the BaseUser to create administrator
  • Fixtures for the admin entity

Installation

  • Install the package
composer require 'alpixel/userbundle:~2.0'
  • Update AppKernel.php

    <?php
    // app/AppKernel.php

    // ...
    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = array(
                // ...

                new Alpixel\Bundle\UserBundle\AlpixelUserBundle(),
            );

            // ...
        }

        // ...
    }
  • Update DB Schema
php app/console doctrine:schema:update
  • Create a User entity in your AppBundle extending the BaseUser
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Alpixel\Bundle\UserBundle\Entity\User as BaseUser;


/**
 * @ORM\Entity
 * @ORM\Table(name="account_user")
 */
class User extends BaseUser
{

    /**
     * @var integer
     *
     * @ORM\Column(name="user_id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

}
  • Add the routing
admin:
    resource: '@AlpixelUserBundle/Resources/config/routing.yml'
  • Change security.yml (optionnal)

If you have more than an admin firewall, you should copy the security.yml of the bundle and paste it in your main security.yml to edit it.

  • Customize login page

For every firewall you have to specify a template for the login page. The admin login template is always provided. Otherwise, it should be defined using the alpixel_user.firewall_templates parameters :

alpixel_user:
    firewall_templates:
        admin:
            login_template: 'AlpixelUserBundle:admin:pages/back_login.html.twig'

You can also simply change the color and the background image of the admin page by overriding these parameters

alpixel_user:
    default_login_background_image: '../../bundles/alpixeluser/img/background.jpg'
    default_login_background_color: '#ff656c'
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.
yandex/translate-api
voku/simple_html_dom
league/flysystem-vfs
bkwld/upchuck
filament/spatie-laravel-tags-plugin
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php