Download the PHP package waiyanhein/lara-role-manager without Composer

On this page you can find all versions of the php package waiyanhein/lara-role-manager. 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 lara-role-manager

Package to manage user roles for Laravel application

Having to write code for managing user roles each time you create a new Laravel project is a repeating project. Sometimes, you will try to copy the existing code form the other projects, such as Role model class. You will need to create a model class for role, plus, migration file for it. Then you also have to define the relationship between user and role. Then you will have to write methods for related logic for example, checking if the user belongs to a role. This package includes all the necessary common logic and components fo handling user roles for Laravel application.

installation

Then you need to register Waiyanhein\LaraRoleManager\LaraRoleManagerServiceProvider provider in the config/app.php file.

Publishing config file to define roles

Then roles.php file will be published under the app/config folder. You can define the roles in the following format.

[ 1 => 'Superadmin', 2 => 'Manager', 3 => 'Staff' ] The array key is the unique code and the value is the title to be displayed to the end users.

Migrating the table

Usages

You will need to place the Waiyanhein\LaraRoleManager\Traits\RoleManager trait into the user model class.

Seeding data (Optional)

If you are seeding the roles into the database, you can seed the data from the config/roles.php calling the following method in your seeder class.

Methods

Then you can use the following methods based on your need.

Waiyanhein\LaraRoleManager\Models\Role class

Waiyanhein\LaraRoleManager\Traits\RoleManager trait

You embed this trait into your user model class so that your user model class can leverage all the features of this trait.

Note

This package already has a factory class for Role model if you are going to write tests. You do not need to create new factory class for Role model.


All versions of lara-role-manager with dependencies

PHP Build Version
Package Version
No informations.
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 waiyanhein/lara-role-manager contains the following files

Loading the files please wait ....