run command in terminal
php artisan make:middleware PermissionCheck
go to app/Http/Middleware and open the PermissionCheck.php file
there is handle(Request $request, Closure $next) method.
we have to write the code in this function.
open Kernel.php which is inside under app/Http folder
add 'permission_check' => \App\Http\Middleware\PermissionCheck::class, inside
use $this->middleware('permission_check'); statement to load middleware.