Download the PHP package silvanite/brandenburg without Composer

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

Brandenburg

Laravel Authorization Package

Latest Version on Packagist Build Status

A opinionated Authorization package to closely integrate with standard Laravel Gates. It differs from other authorization packages by using hard-coded permissions defined within gate policies, rather than duplicating them within the Database.

TLDR; This package provides Users with Roles which are granted access to permissions (Laravel Gates).

Package maintenance

Unfortunately I am no longer actively working in the Laravel ecosystem and as such am unable to maintian this package. If anyone would like to take over the maintenance of the package please get in touch (open an issue or contact me on Twitter).

Version compatibility

Laravel Brandenburg
<=5.7.x 1.1.x
>=5.8.x 1.2.x
^6.0 1.3.x
^7.0 1.4.x
^8.0 1.5.x

Installation

This package uses auto-loading in Laravel 5.5 of both the service provider and the BrandenburgPolicy Facade

For Laravel 5.1 - 5.4 load the Service Provider and Facade.

Three additional tables are required to enable User Roles. These will be installed automatically when you run the migrations. See the migration in this repository's source code for details about the tables created.

If you are not going to use Brandenburg's default migrations, you should change the ignoreMigrations option in the configuration file. You may export the default migrations using:

Usage

This package provides two traits. The main trait is intended for your user model which enabled model relationships.

The second Trait ValidatesPermissions can optionally be used in your AuthServiceProvider when writing Gates. It can be used to stop users from getting locked out or to make some permissions optional by allowing access to a permission if no user in the system has been given access to it.

Creating Roles

Use the Silvanite\Brandenburg\Role model to create and manage user roles.

Creating Permissions

All Gates defined within your application will automatically be available as Permissions, there is no need/way to create these specifically in the database. Please see the Laravel Gates documentation for additional information.

Managing Roles and Permissions

All permissions are assigned by providing the key defined by your Gate. They can be granted and revoked.

A couple of additional helper methods provide a convenient way to manage permissions.

You can see which permissions a given role has by accessing the permissions attribute.

Assigning/Removing Roles

Roles can be assigned/removed directly from the User model (provided the HasRoles trait is used). You can either pass in the Role model or the slug of the role.

There is also a helper method to sync roles (or you can simply use the eloquent relationship itself).

Validating Access Rights

Within your Gate definition you can validate if a given user has access to a specific permission, which will be based on the user Role(s).

Outside of your Gate definitions you should use the standard Laravel Gate methods and helpers to check if a user has access rights. See the Laravel Documentation for more details.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Run the tests: ./vendor/bin/phpunit
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request

Support

If you require any support please contact me on Twitter or open an issue on this repository.

License

GPL


All versions of brandenburg with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
laravel/framework 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 silvanite/brandenburg contains the following files

Loading the files please wait ....