Giter Site home page Giter Site logo

sagarmaheshwary / laravel-multiauth Goto Github PK

View Code? Open in Web Editor NEW
42.0 3.0 30.0 287 KB

Laravel application with multiple authentication guards.

License: MIT License

PHP 84.08% Vue 0.44% HTML 15.48%
laravel laravel5 mysql admin authentication multiple-authentication guards

laravel-multiauth's Introduction

Laravel Application with Multiple Authentication

Laravel application with admin guard. You can even use this application for your projects if you need multiple guards.

Getting this app up and running

  • Make sure you already have xampp installed (easy to use).

  • Clone this repository to your local machine or just download the zip from the above green button.

  • Install Composer first, then run this command in your command-line (you should be inside your project directory).

  composer install
  • Rename .env.example to .env and add your database.

  • Generate application key.

    php artisan key:generate
  • Create tables.
    php artisan migrate
  • Start the development server.
    php artisan serve
  • Create a default admin.
    php artisan db:seed

Default Admin Credentials.

Tutorial Links

Usage

  • Flash Messages: use status key for success messages and error key for error messages.
  • Guards: web (default) and admin (custom).
  • Auth middleware for admin guard: auth:admin for authenticated users using admin guard.
  • Guest middleware for admin guard: guest:admin for unauthenticated users using admin guard.
  • This application has a custom middleware EnsureCustomGuardIsVerified that can be used for verifying emails of custom guards. This middleware is registered in the application as guard.verified and takes two arguments first guard name and second route name that will be used for redirecting unverified users. Example: guard.verified:admin,admin.verification.notice or guard.verified:customer,customers.verify-notice.
  • Don't use @auth or @guest directives for default guard, use Auth::guard('web')->check() with @if instead.
  • Admin and Default routes are seperated and all the admin routes are prefixed by admin.

laravel-multiauth's People

Contributors

dependabot[bot] avatar sagarmaheshwary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-multiauth's Issues

register admin didn't work

There is not found for controller for \app\Http\Controllers\Admin\Auth\RegisterController.php
when i try to create it and change "return Admin::create([" that make users not in admin table

Admin Login

What is the route/URL for the admin login page? I'm unable to open it.
As I'm a newbie, summarize the working flow for the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.