sws/smartauth

Custom authentication package including registration, login, email verification and more.

dev-main 2021-09-29 07:37 UTC

This package is auto-updated.

Last update: 2025-05-29 01:46:48 UTC


README

SWS Auth is a Complete Build of Laravel 8 with Email Registration Verification. Built on Bootstrap 4.

Build Status License: MIT

About

Auth0 Laravel 8 with user authentication and registration with email confirmation. Uses official [Bootstrap 4](https://getbootstrap.com). This also makes full use of Controllers for the routes and templates for the views. Project can be stood up in minutes.

Features

A Laravel 8.x with Bootstrap 4.x project.

Laravel Auth Features
Built on Laravel 8
Built on Bootstrap 4
Uses MySQL Database (can be changed)
Uses Artisan to manage database migration, schema creations, and create/publish page controller templates
Dependencies are managed with COMPOSER
Makes use of Laravel's Soft Delete Structure
Soft Deleted Users Management System

Installation Instructions

  1. run :
composer require sws/smartauth --v.1.1

  1. add sws-auth provider to your config/app.php \SWS\Auth\Providers\AuthServiceProvider::class,
  2. Setup your email configuration to your .env file
  3. From the projects root folder run:
php artisan vendor:publish --tag=sws-auth

Optionally Build Cache

  1. From the projects root folder run php artisan config:cache

Routes

+--------+----------+------------------------+----------------------------+------------------------------------------------------------------+---------------------------------------------+
| Domain | Method   | URI                    | Name                       | Action                                                           | Middleware                                  |
+--------+----------+------------------------+----------------------------+------------------------------------------------------------------+---------------------------------------------+
|        | GET|HEAD | /                      | home                       | Closure                                                          | web                                         |
|        | GET|HEAD | api/user               |                            | Closure                                                          | api                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\Authenticate:sanctum    |
|        | POST     | forgot-password        | auth.forgot.password       | sws\smartauth\Http\Controllers\AuthController@postForgotPassword | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | GET|HEAD | forgot-password        | auth.forgot.password.index | sws\smartauth\Http\Controllers\AuthController@forgotPassword     | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | GET|HEAD | login                  | auth.login.index           | sws\smartauth\Http\Controllers\AuthController@loginIndex         | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | POST     | login                  | auth.login.check           | sws\smartauth\Http\Controllers\AuthController@postLogin          | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | GET|HEAD | logout                 | auth.logout                | sws\smartauth\Http\Controllers\AuthController@logout             | web                                         |
|        | GET|HEAD | register               | auth.register.index        | sws\smartauth\Http\Controllers\AuthController@index              | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | POST     | register               | auth.register.store        | sws\smartauth\Http\Controllers\AuthController@register           | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | GET|HEAD | reset-password/{token} | auth.reset.password.index  | sws\smartauth\Http\Controllers\AuthController@resetPassword      | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | POST     | reset-password/{token} | auth.reset.password        | sws\smartauth\Http\Controllers\AuthController@postResetPassword  | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
|        | GET|HEAD | sanctum/csrf-cookie    |                            | Laravel\Sanctum\Http\Controllers\CsrfCookieController@show       | web                                         |
|        | GET|HEAD | user-verify/{token}    | auth.email.verify          | sws\smartauth\Http\Controllers\AuthController@verifyEmail        | web                                         |
|        |          |                        |                            |                                                                  | App\Http\Middleware\RedirectIfAuthenticated |
+--------+----------+------------------------+----------------------------+------------------------------------------------------------------+---------------------------------------------+

File Tree

sws-auth
├── src
│   ├── config
│   │   └── sws-auth.php
│   ├── database
│   │   └── migrations
│   │       └── create_users_table.php
│   ├── Http
│   │   ├── Controllers
│   │   │   └── AuthController.php
│   │   └── Requests
│   │       └── ResetPasswordRequest.php
│   │       └── StoreUserRequest.php
│   ├── Models
│   │   └── Auth.php
│   ├── Providers
│   │   └── AuthServiceProvider.php
│   ├── Public
│   │   ├── css
│   │   │   └── sws-auth-style.css
│   │   └── js
│   │       └── sws-auth-script.js
│   ├── Resources
│   │   ├── views
│   │   │   └── Auth
│   │   │       ├── passwords
│   │   │       │   ├── forgot.blade.php
│   │   │       │   └── reset.blade.php
│   │   │       ├── login.blade.php
│   │   │       └── register.blade.php
│   │   └── Email
│   │       ├── passwordResetEmail.blade.php
│   │       └── userVerificationEmail.blade.php
│   ├── Routes
│   │   └── web.php
│   ├── Services
│   │   └── AuthService.php
├── vendor
│   ├── composer
│   │   └── installed.json
│   ├── autoload.php
│   └── composer.json
├── composer.json
├── LICENSE
└── README.md

SWS Auth License

sws-auth is licensed under the MIT license. Enjoy!

Contributors

  • Thanks goes to these wonderful people:
  • Please feel free to contribute and make pull requests!