bitfumes / laravel-breezer
Full API authentication in laravel with social login
Installs: 3 401
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- doctrine/dbal: ^3.6
- intervention/image: ^2.7
- laravel/sanctum: ^3.2
- laravel/socialite: ^5.6
Requires (Dev)
- fakerphp/faker: ^1.21
- illuminate/support: ^9.0|^10.0
- orchestra/testbench: ^7.0|^8.0
- phpunit/phpunit: ^10.0
README
Install
composer require bitfumes/laravel-breezer
Steps to follow
Steps 1
-
Add
Breezer
trait to your user model. -
Add Contract
MustVerifyEmail
to your authenticatable model if you want to enable email verification.
use Bitfumes\Breezer\Traits\Breezer; use Illuminate\Contracts\Auth\MustVerifyEmail; class User extends Authenticatable implements MustVerifyEmail { use Notifiable, Breezer; ... }
Step 2
Now publish two new migrations
- To add avatar field to your use model.
- To add social login profile.
php artisan vendor:publish --tag=breezer:migrations
Step 3
After getting migrations in your laravel application, its time to have these tables in your database.
php artisan migrate
Step 4
Set your frontend URL on your .env file FRONT_URL
Set frontend Verify Email URL on your .env file BREEZER_VERIFY_URL
Set frontend password reset URL on your .env file BREEZER_RESET_URL
Step 5
Because every user need to verify its email and to send email we are going to use laravel queue.
Now add queue driver on your .env
file
That's it, now enjoy api auth with JWT
QUEUE_DRIVER=database
Testing
Run the tests with:
vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email sarthak@bitfumes.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.