Download the PHP package pierresilva/laravel-sentinel without Composer

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

Sentinel

Sentinel brings a simple and light-weight role-based permissions system to Laravel's built in Auth system.

Sentinel brings support for the following ACL structure:

Permissions are then inherited to the user through the user's assigned roles.

Quick Installation

Begin by installing the package through Composer. The best way to do this is through your terminal via Composer itself:

Once this operation is complete, simply add the service provider to your project's config/app.php file and run the provided migrations against your database.

Service Provider

Facade

Then open the Kernel.php file in app\Http\Kernel.php and add this to user it as middleware :

routeMiddleware

Migrations

You'll need to run the provided migrations against your database. Publish the migration files using the vendor:publish Artisan command and run migrate:

Usage

Sentinel package comes bundled with a SentinelTrait file to be used within your User's Model file. This trait file provides all the necessary functions to tie your users in with roles and permissions.

Example User Model

SentinelTrait

The following methods will become available from your User model.

isRole($roleSlug)

Checks if the user is under the given role.

You may also use magic methods:

can($permission)

Checks if the user has the given permission(s). You may pass either a string or an array of permissions to check for. In the case of an array, ALL permissions must be accountable for in order for this to return true.

or

assignRole($roleId)

Assign the given role to the user.

Revokes the given role from the user.

revokeAllRoles()

Revokes all roles from the user.

syncRoles([$roleIds])

Syncs the given roles with the user. This will revoke any roles not supplied.

Role Permissions

The bundled Role model has easy to use methods to manage and assign permissions.

can($permission)

Checks if the role has the given permission(s). You may pass either a string or an array of permissions to check for. In the case of an array, ALL permissions must be accounted for in order for this to return true.

getPermissions()

Retrieves an array of assigned permission slugs for the role.

assignPermission($permissionId)

Assigns the given permission to the role.

revokePermission($permissionId)

Revokes the given permission from the role.

revokeAllPermissions()

Revokes all permissions from the role.

syncPermissions([$permissionIds])

Syncs the given permissions with the role. This will revoke any permissions not supplied.

Facade Reference

Sentinel package comes with a handy Facade to make checking for roles and permissions easy within your code.

Sentinel::can($permissions)

Checks if the current user can perform the provided permissions.

Parameters

Sentinel::canAtLeast($permissions)

Checks if the current user can at least perform one of the provided permissions.

Parameters

Sentinel::isRole($role)

Checks if the current user has the given role.

Parameters

Template Helpers

Sentinel comes bundled with custom template methods to easily check for permissions and roles from within your view files for both Blade.

can($permissions)

Blade


All versions of laravel-sentinel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
illuminate/database Version 5.3.*
illuminate/support Version 5.3.*
illuminate/filesystem Version 5.3.*
illuminate/config 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 pierresilva/laravel-sentinel contains the following files

Loading the files please wait ....