Image for post
Image for post

In the previous tutorial, we talked about guards and create an admin guard with complete login functionality. Now we will learn about middleware and customize the Authenticate and RedirectIfAuthenticated middleware for our admin guard. We will also use login throttling and lastly password reset.


Whenever you want to use middleware like auth and guest for admin guard then you can use a colon between them e.g “auth:guard”. Now Open your LoginController and add:

This will specifically look for the admin guard and nothing else so guest means that the admin is not logged in and it doesn’t care if…

Image for post
Image for post

In this tutorial, we will build a multiple guards authentication allowing users and admins to login separately. This will be 2 parts series because we do have quite a bit of work to do and I will be explaining all the things that you need to know about custom authentication. Let’s get started.

What we will be doing

  • Custom Guard, Model and Migration for Admin.
  • Routes, Views, and Controllers for Admin.
  • Manual Authentication.
  • Middleware.
  • Login Throttling.
  • Password Reset.


Let’s start by creating a new laravel project with composer:

composer create-project laravel/laravel multiauth

First thing we will do is add the database credentials to the .env…

Image for post
Image for post

In the previous tutorial, we had implemented authentication, email verification and password reset. We also learned about implementing manual authentication, middleware, and used mailtrap for sending reset and verification emails. Now what we want to do is create a new column “user_id” and relate it to users table with a foreign key so a user can only access his/her todos and not other todos. We will implement one to many and one to many (inverse) relationship. …

Image for post
Image for post

In the previous tutorial, we talked about Database Migrations, Config, and Todos CRUD with Eloquent Models. This tutorial is all about Authentication. We will create a full Authentication System with Email Verification and Password Reset.


Laravel comes with a complete authentication system right out of the box, where users can register/login, reset their passwords , etc. There are some things to consider when implementing authentication with laravel. Laravel includes a User model which will be used for default authentication driver for users. We already have all the controllers in app/Http/Controllers/Auth and laravel also includes migrations for users and password_resets table…

Image for post
Image for post

In the previous tuturial, We talked about laravel framework, How to install it, An introduction to MVC architecture, Created routes, controllers. and views. In this tutorial, we will talk about Models, Database Migrations and make CRUD (CRUD means Create, Read, Update, and Delete from a database) operations on todos table with MySQL.

.ENV File

Before creating migrations, We will need to setup our database, assuming you know how to create a database using phpmyadmin. After creating the database, we will add the database credentials in our application. Laravel has a .env environment file which will have all the sensitive data like database…

Image for post
Image for post

In this series, We will make a basic (but rich in functionality) todo application with Laravel 5.8. The main purpose of this series is to get started with Laravel. You will be learning all the basic and important parts of this framework. Let’s get started.

What You Will Learn In This Series

  • Installing and Setting up Laravel Locally.
  • Models, Views, and Controllers (MVC).
  • Database, Migrations, and Eloquent ORM.
  • Authentication, Email Verification, and Password Reset.
  • Eloquent Relationships and Image Upload.


Laravel is the most popular PHP framework built by Taylor Otwell and community. It uses MVC architecture pattern. It provides a lot of features like a complete Authentication…

Image for post
Image for post

Introduction and Setup

We are building Facebook login app with Laravel using Socialite package. I will be explaining all the things but it would be good if the reader knows at least the basics of Laravel. Let’s start by creating a project (make sure you have composer and xampp installed):

composer create-project laravel/laravel facebook-login

Socialite is a Laravel package that handles 0Auth logins. Socialite supports authentication with Facebook, Twitter, LinkedIn, Google, GitHub, GitLab and Bitbucket. There are socialite adapters for other platforms. Let’s install it:

composer require laravel/socialite


Create a database in MySQL and add the credentials in the .env file. Open the…

Image for post
Image for post

In this tutorial, we will implement Push Notifications feature in our Laravel app using WebPush. We will use Vanilla Javascript with no frameworks or libraries. Push Notification is a feature of Service Workers. A Service Worker is a script inside the web browser that runs in the background. There are a lot of features like caching , background syncing but this tutorial is only about Push Notifications. We will also implement push notifications for guest users.

Note: Service Workers use HTTPS unless you are using localhost.

Getting Started

Let’s create a new laravel project with composer:

composer create-project laravel/laravel webpush

Before migrating…

Sagar Maheshwary

Laravel expert but also know javascript/nodejs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store