kolimpri / auth
Kolimpri Auth provides a starter scaffolding for Laravel SaaS applications.
Requires
- php: >=5.5.9
- erusev/parsedown: ~1.0
- guzzlehttp/guzzle: ~6.0
This package is not auto-updated.
Last update: 2024-10-30 20:05:23 UTC
README
Introduction
Kolimpri Auth is an experimental project based on Laravel Spark with the purpose of provide an auth module for Laravel 5.1 applications.
Installation (as with Laravel Spark)
First, install the Auth installer and make sure that the global Composer bin
directory is within your system's $PATH
:
composer global require "kolimpri/auth-installer=~1.0"
Next, create a new Laravel application and install Auth:
laravel new application
cd application
auth install
After installing Auth, be sure to migrate your database, install the NPM dependencies, and run the gulp
command.
You may also wish to review the AuthServiceProvider
class that was installed in your application. This provider is the central location for customizing your Auth installation.
Teams
To enable teams, simply use the CanJoinTeams
trait on your User
model. The trait has already been imported in the top of the file, so you only need to add it to the model itself:
class User extends Model implements TwoFactorAuthenticatableContract, BillableContract, CanResetPasswordContract { use Billable, CanJoinTeams, CanResetPassword, TwoFactorAuthenticatable; }
Once teams are enabled, a team name will be required during registration, and a Teams
tab will be available in the user settings dashboard.
Roles
Team roles may be defined in the customizeRoles
method of the AuthServiceProvider
.
Customizing Auth Views
You may publish Auth's common Blade views by using the vendor:publish
command:
php artisan vendor:publish --tag=auth-basics
All published views will be placed in resources/views/vendor/auth
.
If you would like to publish every Auth view, you may use the auth-full
tag:
php artisan vendor:publish --tag=auth-full
Customizing Auth JavaScript
The resources/assets/js/Auth/components.js
file contains the statements to load some common Auth Vue components. Vue is the JavaScript framework used by the Auth registration and settings screens.
You are free to change any of these require statements to load your own Vue component for a given screen. Most likely, you will want to copy the original component as a starting point for your customization.
Credits
Laravel Spark, Taylor Otwell - Original Code