Download the PHP package alextigaer/team-auth without Composer
On this page you can find all versions of the php package alextigaer/team-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alextigaer/team-auth
More information about alextigaer/team-auth
Files in alextigaer/team-auth
Package team-auth
Short Description A simple multi-auth package for laravel 5.*
License MIT
Homepage https://github.com/alextigaer/team-auth
Informations about the package team-auth
TeamAuth
A simple multi-auth package for Laravel 5.5/6
Table of Contents
- Installation
- Basic usage
- Options
- --r
- --controllers
- --views
- --model
- --config-auth
- --migrations
- --m
- --seeder
- --s
- --routes-web
- Config
- Usage examples
- Contributing
- License
Installation
Basic usage
To create a new role, just run the command:
This command will:
- Create 5 controllers inside the App\Http\Controllers\RoleName directory:
- ForgotPasswordController
- LoginController
- RegisterController
- ResetPasswordController
- RoleNameController
- Create 5 (+ 1 if the layouts\app.blade.php file is missing) views inside the resources\views\role_name directory:
- passwords\email.blade.php
- passwords\reset.blade.php
- dashboard.blade.php
- login.blade.php
- register.blade.php
- Create RoleName's model inside models' directory
- Edit config\auth.php file to add the guard, the provider and the password resets for the role
- Create 2 migrations:
- create_role_names_table
- create_role_names_password_resets_table
- Create RoleNameSeeder and update DatabaseSeeder to call the generated seeder
- Edit routes\web.php file to add the routes for the role
Options
If you want, you can use these options to customize the creation:
--r (default=y)
This option allows to choose if the users will be able to register to this role. Choosing the 'n' value, the RegisterController file and the register blade file won't be created and the register routes won't be added to the routes\web file.
Possible values: y (default), n
Description:
Usage:
--controllers (default=y)
This option allows to choose if the controllers should be created.
Possible values: y (default), n
Description:
Usage:
--views (default=y)
This option allows to choose if the views should be created.
Possible values: y (default), n
Description:
Usage:
--model (default=y)
This option allows to choose if the model should be created.
Possible values: y (default), n
Description:
Usage:
--config-auth (default=y)
This option allows to choose if the config\auth file should be edited.
Possible values: y (default), n
Description:
Usage:
--migrations (default=y)
This option allows to choose if the migrations should be created.
Possible values: y (default), n
Description:
Usage:
--m (default=n)
This option allows to choose if the migrate should be run.
Possible values: y, n (default)
Description:
Usage:
--seeder (default=y)
This option allows to choose if the seeder should be created.
Possible values: y (default), n
Description:
Usage:
--s (default=n)
This option allows to choose if the db:seed should be run.
Possible values: y, n (default)
Description:
Usage:
--routes-web (default=y)
This option allows to choose if the routes\web file should be edited.
Possible values: y (default), n
Description:
Usage:
Config
This package has its own configuration file. Inside that file, you'll find:
- An entry to specify where your models are
- The default values for the options. These values will be overwritten if you use the options by command line
Usage examples
1) Create a role called 'Admin' without creating the seeder, but running the migrations:
2) Create a role called 'Mod' preventing the users to register to this role:
3) Create a role called 'SuperUser' creating only the model:
Contributing
Feel free to suggest anything! Use pulls or contact me :)
License
TeamAuth is licensed under the MIT license. Made with love, let's share it! :)