Download the PHP package ricardoboss/laravel-roles-migrations without Composer

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

laravel-roles-migrations

Adds migrations for jeremykenedy/laravel-roles.

Overview

This package aims to provide migration functionality for roles and permissions (and their relationships).

  1. Installation
  2. Usage
    1. Creating Migrations
    2. Writing Migrations
    3. Examples

Installation

Simply require this package with composer:

Usage

Creating Migrations

This package adds a new abstract class - RolesMigration - which you can use to write migrations for your roles.

To add a new migration, simply execute

to add a new migration (which can be found in database/migrations/xxx_xx_xx_xxxxxx_my_new_roles_migration.php).

Open the migration. Notice how the class extends the new RolesMigration class instead of the default Migration class from Laravel.

Now comes the interesting part, writing the migrations.

Writing Migrations

A roles migration consists of four protected arrays which define what the migration does:

An example of each migration type and their outcome can be found here:

Examples

Permissions

The slug value is optional. It will be derived from the name if missing.

When the migration is executed, the above configuration will add a new permission to your database. This exact permission will be removed in case of a rollback.

Roles

The slug and description values are optional. If slug is missing, it will be derived from the name. The default value for description is null.

ToAttach & ToDetach

$toAttach and $toDetach have the same structure. They consist of nested arrays which declare what role gets or looses which permissions.

The key of the array must be the slug of a role whereas the value must be an array of permission slugs. You can list as many permissions as you want for each role.

The order in which permissions are attached and detached matters: if you have the same configuration in both $toAttach and $toDetach, the outcome will be that nothing changed since the permissions are first attached and then detached.

Contributing

Feel free to fork the repository and create a pull request. You are encouraged to adhere to the PSR-12 coding style guide.

To-Do List

If you see a missing feature you want or find a bug, please create an issue and describe it.

License

The source code of this package is free software and distributed under the terms of the MIT License.


Thanks to jeremykenedy for creating the laravel-roles package and of course taylorotwell for creating such an amazing framework.


All versions of laravel-roles-migrations with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
laravel/framework Version 6.*|7.*
jeremykenedy/laravel-roles Version 2.*|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 ricardoboss/laravel-roles-migrations contains the following files

Loading the files please wait ....