Download the PHP package metrixinfo/laravel-permissions without Composer

On this page you can find all versions of the php package metrixinfo/laravel-permissions. 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 laravel-permissions

Fine Grain User and Role Permissions for Laravel

Latest Version on Packagist Total Downloads

Laravel Permissions allows you to create fine grain permissions and assign them to users and roles.

You may assign zero or many roles to a user, and they will inherit the permissions assigned to those roles. You may also assign specific permissions to a specific user.

A user's permissions are cached for increased performance.

Requirements

Installation

You can install the package via composer:

Publish the configuration by running the following artisan command:

Run the migrations to create the required tables.

The migrations will create the following tables:

Foreign Key constraints are enforced to guarantee data integrity. If you will be refreshing your database in your local environment you will need to disable them in the method of your table migration.

database/migrations/02014_10_12_000000_create_users_table.php

Usage

Include the following two traits in your User Model.

Permissions

A permission is described by an 'area' defined by you. Examples of areas could be 'blog.post' and 'blog.comment'. It is up to you to create the permissions your app requires by inserting them into the permissions table.

Each assigned permission can have a combination of these 4 actions:

You can check for permissions in any area of your code that you like. Some preferred locations would be within a Policy or a Gate method.

For a policy it could look something like this to allow the author and someone with a role of "Moderator" to edit a post:

Or it can be used to protect private areas of your site such as to only allow specific users to see the Horizon dashboard.

Console Commands

Console commands are provided to help manage your permissions.

You can flush all the cached permissions:

or only the permissions belonging to a specific user.

You may manage permissions using the acl:permissions artisan command.

You may manage roles using the acl:roles artisan command.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please use the issue tracker.

Credits

This package is inspired by the work done by Harro Verton (WanWizard) for FuelPHP's OrmAuth package.

License

The GNU GPLv3. Please see License File for more information.


All versions of laravel-permissions with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/support 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 metrixinfo/laravel-permissions contains the following files

Loading the files please wait ....