Download the PHP package kettasoft/gatekeeper without Composer

On this page you can find all versions of the php package kettasoft/gatekeeper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gatekeeper

Gatekeeper

This package provides a comprehensive system for managing roles and permissions in Laravel applications. It allows for easy creation and management of roles, assigning permissions to specific roles, and controlling access to different parts of the application based on a user's assigned roles and permissions.

Total Downloads Latest Stable Version License PHP Version Require

Installation

You can install the package using composer:

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework, you must install the service provider:

publish the config/gatekeeper.php config

WARNING

If this command did not publish any files, chances are, the Laratrust service provider hasn't been registered. Try clearing your configuration cache

Run the setup command:

IMPORTANT: Before running the command go to your config/gatekeeper.php file and change the values according to your needs.

This command will generate the migrations, create the Role and Permission models

Dump the autoloader:

Run the migrations:

Roles & Permissions

Setting things up

Let's start by creating the following Roles:

Role Assignment & Removal:

Removal

User Permissions Assignment & Removal

You can give single permissions to a user, so in order to do it you only have to make:

Assignment

Middleware

Configuration

The middleware are registered automatically as role, permission. If you want to change or customize them, go to your config/gatekeeper.php and set the middleware.register value to false and add the following to the routeMiddleware array in app/Http/Kernel.php:

Concepts

You can use a middleware to filter routes and route groups by permission, role:

If you use the pipe symbol it will be an OR operation:

To emulate AND functionality you can do:

Using Different Guards

If you want to use a different guard for the user check you can specify it as an option:

Middleware Return

The middleware supports two types of returns in case the check fails. You can configure the return type and the value in the config/gatekeeper.php file.

Abort

By default the middleware aborts with a code 403 but you can customize it by changing the gatekeeper.middleware.handlers.abort.code value.

Redirect

To make a redirection in case the middleware check fails, you will need to change the middleware.handling value to redirect and the gatekeeper.middleware.handlers.redirect.url to the route you need to be redirected. Leaving the configuration like this:


All versions of gatekeeper with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kettasoft/gatekeeper contains the following files

Loading the files please wait ....