ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Laravel 11 Tutorial #6 | Ecommerce via Laravel & MongoDB | Create Admin Middleware to Protect Routes

laravel mongodb

mongodb

mongo db

mongodb tutorial

mongoodb laravel tutorial

Laravel MongoDB Tutorial

Overview of MongoDB

install mongodb on windows

setup mongodb on windows

MongoDB CRUD Operations

Insert data into MongoDB with Laravel

get data in laravel from mongodb

MongoDB CRUD

laravel 11

laravel 11 tutorial

laravel 11 ecommerce

laravel 11 mongodb

ecommerce with laravel mongodb

connect laravel with mongodb

admin login page

admin login

Автор: Stack Developers

Загружено: 2024-03-31

Просмотров: 897

Описание: Laravel 11 Tutorial (with MongoDB):    • Laravel 11 Tutorial (with MongoDB)  

This is Part 6 of the Laravel 11 Tutorial in which we are building the e-commerce website with Laravel as the front end and MongoDB as the backend. In this video, we will work on Multi Authentication in which we will use Guards for Admins and default Laravel Auth for Users.

We will follow the below steps to set Guards for the Admin Panel / Admins.

1) Create admins table:-
First of all, we will create an admins table with migration with the below columns:
id, name, type, mobile, email, password, image, status

So, we will run the below artisan command to create a migration file for admins:-
php artisan make:migration create_admins_table

Open the create_admins_table migration file and add all required columns mentioned earlier.

Now we will run below artisan command to create an admins table with the required columns:-
php artisan migrate

2) Create Admin model:-
Now we will create an Admin model with the below artisan command:-
php artisan make:model Admin

We will comment Illuminate\Database\Eloquent\Model and add below MongoDB classes.
use MongoDB\Laravel\Auth\User as Authenticatable;
use Mongodb\Laravel\Eloquent\Model as Model;

We will also update the content of the Admin model file to set the protected guard variable for admin and set other variables as shown in the video.

We will also extend the Admin class to Authenticatable and add its namespace as well.

3) Update auth.php file:-
We will update the auth.php file located at config\auth.php to set guards for admin to assign session in driver and admins in provider as shown in the video.

We will also set providers for admins to assign eloquent in driver and Admin classes in the model.

4) Create Admin Middleware:-
Now we will create an Admin Middleware file by running the below command:-
php artisan make:middleware Admin

5) Update Admin Middleware
Add Auth::guard check in Admin Middleware to protect the admin routes. This check will be false for now as we have not registered the admin guard yet.

6) Update app.php file:-
Now we will update the app.php file located at bootstrap\ folder to register Admin middleware as global as shown in the video. (Major change in Laravel 11 to register Middleware)

Instead of registering middleware at kernel.php, we need to register it at app.php file in Laravel 11.

7) Update web.php file:-
Add the admin middleware group and move the admin dashboard route under it to protect it from unauthorized access.

Now no one can access the admin dashboard without logging into the admin panel. We have used Guards to protect the admin routes including the dashboard route.

In the next video, we will create the admin record with the username and password with which we are going to log into the admin panel.

Thanks for watching :)

►Click here to subscribe for Laravel & other updates -    / stackdevelopers  

Popular Stack Developers Series that can help you:-

►Laravel MongoDB Tutorial:    • Laravel MongoDB Tutorial  

►Laravel 10 Tutorial Playlist:    • Laravel 10 Tutorial: Make Admin Panel / E-...  

►Laravel Multi-Vendor E-commerce Website -    • Laravel Multi Vendor Tutorial  

►React JS Tutorial for Beginners with Laravel -    • React JS Tutorial with Laravel for Beginners  

►Laravel Tutorial for Beginners -    • Laravel Tutorial for Beginners | Advance E...  

►GIT Tutorial for Beginners -    • Git Tutorial for Beginners | Create your F...  

►Laravel API Tutorial -    • Laravel API Tutorial | Create API from Scr...  

►Laravel Interview Questions -    • Laravel Interview Questions & Answers | 20...  

►jQuery Tutorial -    • jQuery Tutorial  

►Laravel Basic E-commerce Series -    • Make Admin Panel / E-commerce Website in L...  

►Laravel Dating Series -    • Make Dating / Social Networking Website in...  

►Join this channel to get the complete source code of all series:
   / @stackdevelopers  

Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates -   / stackdevelopers2  
►Join Facebook Group to resolve your queries -   / stackdevelopers  
►Follow on Instagram -   / stackdevelopers2  
►Follow on GitHub - https://github.com/stackdevelopers

#laravel11 #laravel #mongodb #mongodbtutorial

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Laravel 11 Tutorial #6 | Ecommerce via Laravel & MongoDB | Create Admin Middleware to Protect Routes

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

#7 Laravel 11 Tutorial | E-commerce with Laravel & MongoDB | Insert Record with Seeder in MongoDB

#7 Laravel 11 Tutorial | E-commerce with Laravel & MongoDB | Insert Record with Seeder in MongoDB

ДЕНЬ 1217. ИЗРАИЛЬ ПОБЕДИЛ/ ЦЕНЫ НА НЕФТЬ ЛЕТЯТ ВНИЗ/ ТРАМП УНИЗИЛ МЕДВЕДЕВА/ КОНТРАТАКИ ВСУ

ДЕНЬ 1217. ИЗРАИЛЬ ПОБЕДИЛ/ ЦЕНЫ НА НЕФТЬ ЛЕТЯТ ВНИЗ/ ТРАМП УНИЗИЛ МЕДВЕДЕВА/ КОНТРАТАКИ ВСУ

Не пора ли снимать деньги со вкладов? / Блокировки и цифровой суверенитет || Дмитрий Потапенко*

Не пора ли снимать деньги со вкладов? / Блокировки и цифровой суверенитет || Дмитрий Потапенко*

Игра, опередившая время на десятилетия  | The Movies 2005

Игра, опередившая время на десятилетия | The Movies 2005

Laravel Admin Panel with Admin LTE - Free Package with installation steps

Laravel Admin Panel with Admin LTE - Free Package with installation steps

Похудей на 45 КГ, Выиграй $250,000!

Похудей на 45 КГ, Выиграй $250,000!

Покушение на Зеленского / Предатель в Офисе президента

Покушение на Зеленского / Предатель в Офисе президента

Feeling Good Mix - Emma Péters, Carla Morrison

Feeling Good Mix - Emma Péters, Carla Morrison

Знакомство с WebSocket - от концепции до старта #программирование

Знакомство с WebSocket - от концепции до старта #программирование

Кремль на пути к ядерному террору / Мир на грани / Ядерное сдерживание рушится на глазах /№967/ Швец

Кремль на пути к ядерному террору / Мир на грани / Ядерное сдерживание рушится на глазах /№967/ Швец

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]