Package Data | |
---|---|
Maintainer Username: | nlocascio |
Maintainer Contact: | nlocascio@gmail.com (Nick LoCascio) |
Package Create Date: | 2016-08-24 |
Package Last Update: | 2017-10-27 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-20 03:02:33 |
Package Statistics | |
---|---|
Total Downloads: | 9 |
Monthly Downloads: | 1 |
Daily Downloads: | 1 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
This package is a Laravel User Provider which authenticates user logins through MINDBODY. It exposes two auth drivers: one for authenticating Client credentials, and one for authenticating Staff credentials.
This package requires:
Install the package through Composer:
composer require nlocascio/mindbody-laravel-auth
This package requires nlocascio/mindbody-laravel
to communicate with the MINDBODY API. You must configure that package first before proceeding.
In config/app.php
, append to the providers
key before App\Providers\AuthServiceProvider::class
is declared:
Nlocascio\MindbodyAuth\MindbodyAuthServiceProvider::class
In your app's config/auth.php
, add the following to the providers
key:
'mindbody_clients' => [
'driver' => 'mindbody_client',
'model' => App\User::class
],
'mindbody_staff' => [
'driver' => 'mindbody_staff',
'model' => App\User::class
]
Note that your model
can point to any Eloquent model which implements Illuminate\Contracts\Auth\Authenticatable
. Depending on the needs of your application, you may prefer to have different models for different types of users; however, using the default App/User.php
will work for many cases.
In your app's config/auth.php
, add the following to the guards
key:
'mindbody_client' => [
'driver' => 'session',
'provider' => 'mindbody_client'
],
'mindbody_staff' => [
'driver' => 'session',
'provider' => 'mindbody_staff'
]
Now that you've registered and configured the guards, you may use them in your application by using the auth:mindbody_client
or auth:mindbody_staff
middleware.
You can set one of these guards to be the default authentication guard in config/auth.php
under the defaults
key:
'defaults' => [
'guard' => 'mindbody_client', // or 'mindbody_staff'
'passwords' => 'users',
],