Skip to content

Instantly share code, notes, and snippets.

@pedroufv
Last active January 30, 2018 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedroufv/75183686a03b2e495a1622ddd8abcc90 to your computer and use it in GitHub Desktop.
Save pedroufv/75183686a03b2e495a1622ddd8abcc90 to your computer and use it in GitHub Desktop.
AdminiController verificando permissão larapacks/authorization
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Route;
class AdminController extends Controller
{
public function __construct()
{
$this->middleware('auth');
$this->middleware('permission:'.Route::currentRouteName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment