Todo excelente, no había encontrado un curso de Spatie actualizado como este , sin embargo en este ultimo video tengo ese problema del middleware, segun la documentacion de laravel 11 , use el siguiente codigo: pero no logro que funcione: public static function middleware(): array { return [ 'auth', new Middleware('can:Create User', only: ['index']), new Middleware('can:Edit User', only: ['edit', 'update']), new Middleware('can:Delete User', only: ['destroy']), ]; }
@Ketimun16864 ай бұрын
problem " public function __construct() { $this->middleware('can:permissions_create_update_delete')->only('create', 'store', 'edit', 'update', 'destroy'); }", message error "Call to undefined method App\Http\Controllers\PermissionController::middleware()"
@khiarmohamed13253 ай бұрын
hy , you can call the controller like this :\Illuminate\Routing\Controller to resolve the prb, but i need to know if the only and except is worked for you