Laravel 5.7.*: Middleware, Authentication, Authorization Explained
Laravel 5.7.*: Middleware, Authentication, Authorization Explained


This book is no longer available for sale.

Laravel 5.7.*: Middleware, Authentication, Authorization Explained

This book is 100% complete

About the Book

In Laravel implementing authentication is very simple. In fact, almost everything is configured for you out of the box.

Only two commands can take care of scaffolding your entire authentication system in Laravel 5.7. However, that is not enough for a learner to manage any complicated web application. Here you will learn all the lessons regarding Middleware, Authentication and Authorizations to master Laravel.

You will learn how at its core, Laravel's authentication facilities are made up of "guards" and "providers", and how they work at tandem to make your application smooth. Besides, you will have a clear conception about model relations, Eloquent ORM, resourceful controllers, partial views and usages of Faker objects.

While learning Authentication, you also understand the role of Middleware. Understanding how it provides a convenient mechanism for filtering HTTP requests entering your application is also very important. For example, Laravel includes a middleware that verifies the user of your application is authenticated. If the user is not authenticated, the middleware will redirect the user to the login screen. However, if the user is authenticated, the middleware will allow the request to proceed further into the application.

How this user-friendly and elegant mechanism works, is explained in great detail, keeping in mind that the reader could be at the beginner's stage.

About the Author

Sanjib Sinha
Sanjib Sinha

Sanjib Sinha is an author of six books (published by Apress/Springer); he won Microsoft's Community Contributor Award in 2011.

Table of Contents

1. Why Laravel

2. How Authentication, Middleware and Authorization work together

3. Laravel Top Ten Commands we need for Authentication

4. Authenticating Our Companies Management Application

4.1 How Company Projects and Tasks Management Application Works

5. How Migrations work in Laravel and Help us to Authenticate

5.1 Where to find the tables

6. Eloquent Relationship and Model Relations to Authenticate an App

6.1 Eloquent Relationship and Model Relations to Authenticate an App

7. Why Resourceful Controller is Important for Authentication

8. Seeding, Factories, and Faker we Need to Test the Application

9. Middleware, Authentication and Authorization in One Place

9.1. How Model-View-Controller works in Authentication

9.2. Home Page, Redirection and Authentication

9.3. Role of a User and Authorization

9.4. Forms and HTML: Insert, Edit sections for Authorized Users

10. Implementing Authorization Using Gates and Policies

10.1 How Authorization Works

10.2 How Policies Work

10.3 Why Policies are Needed

Your Task as a Reader

Last but not Least

Authors have earned$8,090,825writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. Free App. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub