Download the PHP package beatswitch/lock-laravel without Composer

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

Lock - Laravel 5 Driver

Build Status Code Climate Test Coverage Packagist Version Total Downloads

I'm sad to say that Lock is currently not maintained. I won't be able to offer support or accept new contributions for the current time being. Other priorities are keeping me from putting the work into Lock that it deserves. Eventually I'll try to pick up work again but unfortunately I cannot say when. My thanks goes out to all the contributors and users.

-- Dries

This package is a Laravel 5 driver for Lock. Check the documentation of Lock for more info. It requires at least PHP 5.6.

Table of Contents

Installation

Install this package through Composer.

Register the service provider in your app.php config file.

Register the facades in your app.php config file.

Publish the configuration file. After publishing you can edit the configuration options at config/lock.php.

If you're using the database driver you should run the package's migrations. This will create the database table where all permissions will be stored.

Please read the main Lock documentation for setting up the caller contract on your User model and for more in-depth documentation on how Lock works.

Also make sure to set the BeatSwitch\Lock\LockAware trait on your User model. That way your authenticated user will receive a Lock instance of itself so you can call permissions directly from your user object. If no user is authenticated, a SimpleCaller object will be bootstrapped which has the guest role. That way you can still use the Lock facade. If you want the LockAware trait to work on the User model you'll need to activate it with a middleware. Register the middleware below after the StartSession middleware.

Usage

Setting roles and aliases

You can register roles and aliases beforehand through the permissions callback in the config file. Here you can say which actions should be grouped under an alias or set which roles should inherit permissions from each other.

Setting permissions with the array driver

If you're using the array driver you can set all your permissions beforehand in the same permissions callback from above.

Using the database driver

Enable the database driver by switching the driver type in the config file. The database driver will use your default database connection to store permissions to your database. You can choose which table to store the permissions into by changing the setting in the config file.

Now that you have your database driver set up, you're ready to create a UI for your permissions and use the lock manager instance in your application to change permissions for callers or roles.

Using the facades

This package ships with two facades: the Lock facade which holds the BeatSwitch\Lock\Lock instance for your current authenticated user (or the guest user if no user is authenticated) and the LockManager class which can be used to bootstrap new lock instances for callers or roles.

Checking permissions for the current user is easy.

Use the manager to set permissions.

Using dependency injection

You can use Laravel's IoC container to insert an instance of the current user's lock instance or the lock manager instance into your classes or controllers.

Maintainer

Lock is currently unmaintained.

This package is currently maintained by Dries Vints.
If you have any questions please don't hesitate to ask them in an issue.

Contributing

Please see the contributing file for details.

Changelog

You can see a list of changes for each release in the changelog file.

License

The MIT License. Please see the license file for more information.


All versions of lock-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
beatswitch/lock Version ^0.2.0
illuminate/auth Version >=5.3.0
illuminate/database Version >=5.3.0
illuminate/support Version >=5.3.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 beatswitch/lock-laravel contains the following files

Loading the files please wait ....