hieu-le / taki
Adding additional functions to Laravel authentication and supports social login management
Requires
- php: >=5.4.0
- laravel/framework: ^5.1
- laravel/socialite: ^2.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- mockery/mockery: dev-master
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-11-05 20:44:23 UTC
README
A collection of useful traits to make Laravel 5.1 authentication system more flexible.
Why?
Laravel 5.1 already has a cute authentication system. However, user can make it more beautiful by some traits in this package:
- Allow user to log in by username, email or both
- Allow user to set their password before creating a new account with Social service providers (facebook, google, ...)
- Allow user to set their username before creating a new account with Social service providers (facebook, google, ...)
- More configurable options for redirecting paths
- Full test suite
Installation
First, you have to require this package via composer
composer require "hieu-le/taki"
Now, register the service provider by adding this line into your providers
array inside the config/app.php
file:
HieuLe\Taki\TakiServiceProvider::class,
Register an alias by adding this line into your aliases
array inside the config/app.php
file:
'Taki' => HieuLe\Taki\TakiFacade::class,
If you use traditional RDBMS, this package is shipped with a built in migration file for the users
table, please remove the Laravel's one at database/migrations/xxxx_xx_xx_xxxxxx_create_user_table.php
and run this command
php artisan vendor:publish --provider="HieuLe\Taki\TakiServiceProvider"
Edit the new migration file and run php artisan migrate
when you're ready.
Usage
This package helps you by implementing some methods in your authentication controller. This is the list of them, you have to create the others by yourself (most of them is just GET method which simply returns a view).
For password recovery and password reset, the built in trait of Laravel is good enough to me. Therefore, I do not create any modification to it at least in the first release of this package.
Now, use the HieuLe\Taki\Traits\TakiTrait
in your authentication controller, register routes and implement views.
Configurations
When running the vendor:publish
command above, a new file named taki.php
is created in your config
folder. If you want to modify any option of this package, edit this file.
Controller properties and methods
Properties
Taki looks at some properties in your controller and allows you to customize its behavior via these properties:
Methods
Implementing this methods allows you to gain more control over your authentication flow:
License
This package is release under the MIT license, feel free to use it in your work.