Download the PHP package rappasoft/vault without Composer

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

This package is no longer maintained. Please use the full boilerplate instead.

Vault (Laravel 5 Package)

Project Status Build Status Scrutinizer Code Quality Total Downloads License

Vault is a simple yet powerful access control system for the new Laravel 5 Framework. It comes with a backend user interface to manage users, roles, and permissions as well as the relationships between them.

Be advised while this package works fully, it is still in development and the code base changes often. A 1.0 tag will be created when the package is stable for release.

Examples: Vault User Index Vault Create Role Vault Edit User Vault Role Index

Documentation

Prerequisites

Setup

In the require key of composer.json file add the following

"rappasoft/vault": "dev-master"

Run the Composer update command

$ composer update

In your config/app.php add the following to your $providers and $aliases array

The Vault Facade is loaded by the service provider by default.

Run the vendor:publish command

$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider"

This will publish the following files to your application:

  • app/config/vault.php config file
  • Vault Migration File
  • Vault Seed File (Will add the seed call to the end of your DatabaseSeeder.php class)
  • public/js/vault/*
  • public/css/vault/*

You can also publish individual assets by tag if need be:

$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="config"
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="migration"
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="seeder"
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="assets"

You can also publish views, see configuration below.

Run the dumpautoload command

$ composer dumpautoload -o

Run the migration command

$ php artisan migrate

Add the UserHasRole trait to your User model:

Run the seed command

$ php artisan db:seed --class="VaultTableSeeder"

Add the route middleware to your app/Http/Kernel.php file:

That's it! You should now be able to navigate to http://localhost/access/users to see the users index.

Configuration

Configuration File

Vault Views

By default the package works without publishing its views. But if you wanted to publish the vault views to your application to take full control, run the vault:views command:

$ php artisan vault:views

Vault Routes

If you do not want vault to use its default routes file you can duplicate it and set the vault.general.use_vault_routes configuration to false and it will not load by default.

Utilizing the status property

If would would like to enable enabled/disabled users you can simply do a check wherever you are logging in your user:

Applying the Route Middleware

Laravel 5 is trying to steer away from the filters.php file and more towards using middleware. Here is an example right from the vault routes file of a group of routes that requires the Administrator role:

The above code checks to see if the currently authenticated user has the role Administrator, if not redirects to / with a session variable that has a key of message and value of You do not have access to do that.

The following middleware ships with the vault package:

  • vault.routeNeedsRole
  • vault.routeNeedsPermission
  • vault.routeNeedsRoleOrPermission

Route Parameters

  • middleware => The middleware name, you can change them in your app/Http/Kernel.php file.
  • role => A string of one role or an array of roles by name.
  • permission => A string of one permission or an array of permissions by name.
  • needsAll => A boolean, false by default, that states whether or not all of the specified roles/permissions are required to authenticate.
  • with => Sends a session flash on failure. Array with 2 items, first is session key, second is value.
  • redirect => Redirect to a url if authentication fails.
  • redirectRoute => Redirect to a route if authentication fails.
  • redirectAction => Redirect to an action if authentication fails.

If no redirect is specified a response('Unauthorized', 401); will be thrown.

Create Your Own Middleware

If you would like to create your own middleware, the following methods are available.

Vault:: by default uses the currently authenticated user. You can also do:

VaultRoute trait

If you would like to take advantage of the methods used by Vault's route handler, you can use it:

use Rappasoft\Vault\Traits\VaultRoute

Which will give you methods in your middleware to grab route assets. You can then add methods to your middleware to grab assets that vault doesn't grab by default and take advantage of them.

Blade Extensions

Vault comes with @blade extensions to help you show and hide data by role or permission without clogging up your code with unwanted if statements:

Currently each call only supports one role or permission, however they can be nested.

If you want to show or hide a specific section you can do so in your layout files the same way:

License

Vault is free software distributed under the terms of the MIT license.

Additional information

Any issues, please report here.


All versions of vault with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version ~5.0
illuminate/html Version 5.*
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 rappasoft/vault contains the following files

Loading the files please wait ....