2017 © Pedro Peláez
 

library user

image

chimerarocks/user

  • Wednesday, November 30, 2016
  • by chimerarocks
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

user

Build Status, (*1)

Installation

1. Install package

composer require chimerarocks/user

2. Add provider

in config/app.php
'providers' => [
    ...
    ChimeraRocks\User\Providers\UserServiceProvider::class,
    Collective\Html\HtmlServiceProvider::class,
],

'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
 ],

3. Publish views and migrations

remove old users migrations!, (*2)

php artisan vendor:publish

4. Refactoring User

  1. remove app/User.php
  2. remove Auth\RegisterController.php or change the namespache of User to ChimeraRocks\User\Models\User

5. Change users provider

config/auth.php

'providers' => [
   'users' => [
       'driver' => 'eloquent',
       'model' => \ChimeraRocks\User\Models\User::class,
   ],
],

6. Add the middleware

on kernel.php

$routeMiddleware = [
    ...
    'authorization' => \ChimeraRocks\User\Middlewares\Authorization::class,
    ...
]

7. Add the routes

on web.php

App::make('chimerarocks_user_route')->auth();

8. Generate schema

php artisan migrate

9. Install Passport

php artisan passport:install

The Versions