2017 © Pedro Peláez
 

library users

User managment with Laravel and adminlte-laravel

image

acacha/users

User managment with Laravel and adminlte-laravel

  • Monday, December 18, 2017
  • by acacha
  • Repository
  • 1 Watchers
  • 1 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 23 Open issues
  • 1 Versions
  • 47 % Grown

The README.md

users

Latest Version on Packagist Total Downloads Monthly Downloads Daily Downloads ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads] StyleCI Code Coverage Dependency StatusDependency Status Node.js, (*1)

Acacha users is a Laravel package that add Users managment support yo your Laravel app., (*2)

Installation

Via Composer please first create a new fresh Laravel Project:, (*3)

``` bash laravel new laravel_with_users cd laravel_with_users, (*4)


Install adminlte-laravel template with: ``` bash adminlte-laravel install

Then install this Laravel Package using:, (*5)

``` bash composer require acacha/users, (*6)


Now install Javascript Vue components using:

npm install --save acacha-users, (*7)


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

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


Just after Vue installation. Now compile with:

npm install npm run dev, (*9)


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, (*10)


Configure **App\User** adding the following traits:

class User extends Authenticatable { use Notifiable, HasRoles, HasApiTokens, ExposePermissions, RevisionableTrait,HasUserMigrations;, (*11)


Also install spatie/laravel-menu usign wizard:

php artisan adminlte:menu, (*12)


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

llum boot, (*13)


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, ],, (*14)


And change auth configuration to use passport:

'guards' => [ ... 'api' => [ 'driver' => 'passport', 'provider' => 'users', ], ],, (*15)

### Installation on development

Via Composer please first create a new fresh Laravel Project:

``` bash
laravel new laravel_with_users
cd laravel_with_users

Install adminlte-laravel template with:, (*16)

``` bash adminlte-laravel install, (*17)


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" } ],, (*18)


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, (*19)


Then install this Laravel Package using: ``` bash 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:, (*20)

  .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:, (*21)

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):, (*22)

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

Tests

Add the suites to phpunit.xml file:, (*23)

<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., (*24)

Usage

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


## Change log Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Testing ``` bash $ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*26)

Security

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

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., (*28)

The Versions