Download the PHP package leoche/laravel-lpermissions without Composer

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

Laravel Source License

Laravel LPermissions adds roles and permissions to Auth Laravel 5.3. Protect your routes and your views.

Table of Contents

Requirements

Installation

1. Require the package in your composer.json and update your dependency with composer update:

2. Add the package to your application service providers in config/app.php.

3. Publish the package migrations to your application and run these with php artisan migrate.

4. Add the middleware to your app/Http/Kernel.php.

5. Add the HasRole trait to your User model.

Methods Usage

Roles

Creating roles

Assign or Remove a role

Assign or remove an inherit role to a role

Assign or remove a permission to a role or a user

Notes : LPermissions parse permissions path as:

Given Path Parsed path
home/ home
/blog/:slug blog/:slug
blog/:alpha/ blog/:alpha
/blog/:number/comments/ blog/:number/comments
Given keys Regex
* (.*?)
:number (\d*?)
:alpha ([A-z]*?)
:alphanum ([A-z0-9]*?)
:slug ([A-z0-9-_]*?)

Routes Usage

You just have to specifythe middleware to the group route. It will check for permission and abort 401 if unauthorised

Blades Usage

In your blades view you can use directives to show something (eg: links, infos) only if the user has the permission or the role

Example

Users Table

id username role_id
1 Mike 0
2 Lisa 1
3 John 2

Roles Table

id inherit_id name
1 1 Admin
2 0 Member

Permissions Table

id route method user_id role_id
1 /admin/* * 0 1
2 /account/* GET 0 2
3 /secret GET 1 0

Route web.php

Everyone can see the homepage

Only mike can view /secret

Lisa can do anything in /admin/* and view account pages (inherit from members)

John can only view accounts pages

Todo


All versions of laravel-lpermissions with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version 5.3
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 leoche/laravel-lpermissions contains the following files

Loading the files please wait ....