How to use Middleware in laravel for content restriction based on user role.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bootstrap
config
database
public
resources
routes
storage
tests
.env.example
.gitattributes
.gitignore
README.md
artisan
composer.json
composer.lock
package.json
phpunit.xml
server.php
webpack.mix.js
yarn.lock

README.md

Prerequisites

  • After cloning this repository, go to the root folder, run the following command/s,
        composer install
        composer update
  • Rename .env.example to .env and provide your database details there.
  • It needs a database table to store registered users. Run php artisan migrate to import the tables.
  • Run
    php artisan key:generate

Reference Post

https://justlaravel.com/middleware-laravel-content-restriction-user-role/

Demo and Code Explanation Video

https://www.youtube.com/watch?v=DkMmy-KRRTE&list=PLJKqSeQP_mlKUcBB8IC1LSWcIUYGldNuE

Working Demo

http://demos.justlaravel.com/middleware-laravel-content-restriction-user-role