acacha / users by acacha

User managment with Laravel and adminlte-laravel
35
2
3
Package Data
Maintainer Username: acacha
Maintainer Contact: sergiturbadenas@gmail.com (Sergi Tur Badenas)
Package Create Date: 2016-12-05
Package Last Update: 2017-12-18
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-19 15:12:43
Package Statistics
Total Downloads: 35
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 3
Total Forks: 0
Total Open Issues: 23

users

Latest Version on Packagist Total Downloads Monthly Downloads Daily Downloads Software License Build Status Coverage Status Quality Score Total Downloads StyleCI Code Coverage Dependency StatusDependency Status Node.js

Acacha users is a Laravel package that add Users managment support yo your Laravel app.

Installation

Via Composer please first create a new fresh Laravel Project:

laravel new laravel_with_users
cd laravel_with_users

Install adminlte-laravel template with:

adminlte-laravel install

Then install this Laravel Package using:

composer require acacha/users

Now install Javascript Vue components using:

npm install --save acacha-users

Modify your app.js Bundle to use acacha-users Vue components adding:

//Acacha Users management components
require('users-bootstrap');

Just after Vue installation. Now compile with:

npm install
npm run dev

Install also Spatie Laravel Permission Package:

composer require spatie/laravel-permission
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="config"
php artisan migrate

Configure App\User adding the following traits:

class User extends Authenticatable
{
    use Notifiable, HasRoles, HasApiTokens, ExposePermissions, RevisionableTrait,HasUserMigrations;

Also install spatie/laravel-menu usign wizard:

php artisan adminlte:menu

Use llum boot to run migrations and other common firt execution tasks:

llum boot

Finally assure Laravel Passport (https://laravel.com/docs/5.5/passport) is installed and configured. Composer package is a dependency so no need to install explicitly but be sure to add CreateFreshApiToken midleware to Http/Kernel.php file

protected $middlewareGroups = [
        'web' => [
        ...
        \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
        ],

And change auth configuration to use passport:

'guards' => [
        ...
        'api' => [
            'driver' => 'passport',
            'provider' => 'users',
        ],
    ],

Installation on development

Via Composer please first create a new fresh Laravel Project:

laravel new laravel_with_users
cd laravel_with_users

Install adminlte-laravel template with:

adminlte-laravel install

Install Studio (https://github.com/franzliedke/studio) on your system or use Composer path repositories (https://getcomposer.org/doc/05-repositories.md#path)

With Composer Path repositories add in composer.json file just before require section

"repositories": [
        {
            "type": "path",
            "url": "./users"
        },
        {
            "type": "path",
            "url": "./users-ebre-escool-migration"
        }
    ],

Create folders users and users-ebre-escool-migration with packages (you can clone it):

https://github.com/acacha/users
https://github.com/acacha/users-ebre-escool-migration

Then install this Laravel Package using:

composer require acacha/stateful-eloquent:dev-master
composer require acacha/users:dev-master
composer require scool/ebre_escool_model:dev-master
composer require acacha/users-ebre-escool-migration:dev-master

Now is time to configure npm dependencies. Modify file webpack.mix.js adding:

  .js .....
  .sourceMaps()
  .webpackConfig({
    resolve: {
      modules: [
        path.resolve(__dirname, './users/resources/assets/js'),
        path.resolve(__dirname, './users-ebre-escool-migration/resources/assets/js'),
        path.resolve(__dirname, 'node_modules')
      ]
    }
  })

Compile Javascript bundle with Laravel Mix/webpack:

npm install
npm run dev

Requirements

  • Laravel
  • Spatie Laravel permission package
  • Acacha AdminLTE Laravel template
  • Javascript npm packages
    • Vue
    • Axios
    • adminlte-vue
    • vuetable-2
    • password-generator
    • vue-events (TODO migrate to Vuex Store!)
    • vue-scrollto

Vuetable-2 problem with transform-runtime (see also http://acacha.org/mediawiki/Vuetable2):

npm install --save-dev babel-plugin-transform-runtime babel-preset-stage-2

Tests

Add the suites to phpunit.xml file:

<testsuite name="Users">
    <directory suffix="Test.php">./users/tests/Feature</directory>
</testsuite>
<testsuite name="UsersEbreEscoolMigration">
    <directory suffix="Test.php">./users-ebre-escool-migration/tests/Feature</directory>
</testsuite>

And run phpunit.

Usage

$skeleton = new Acacha\Users();
echo $skeleton->echoPhrase('Hello, League!');

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email sergiturbadenas@gmail.com instead of using the issue tracker.

Credits

TODO Javascript/Npm dependencies

  • adminlte-vue
  • password-generator https://www.npmjs.com/package/password-generator

License

The MIT License (MIT). Please see License File for more information.