artisticre
4 months ago
367
2
Laravel

Middleware Based on Role Table

Posted 4 months ago by artisticre

I have this Role table that I want to create middleware based on the role but I can't figure out how. Can someone help me get started for the middleware for role:team?

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRolesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('roles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('roles');
    }
}

Please sign in or create an account to participate in this conversation.