Download the PHP package oltrematica/laravel-role-lite without Composer

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

GitHub Tests Action Status GitHub PhpStan Action Status Latest Version on Packagist Total Downloads

Laravel Role Lite

A lightweight role management package for Laravel applications.

Laravel Role Lite is a lightweight package for managing user roles in Laravel applications. It provides a simple and intuitive API for defining roles, assigning them to users throughout your application with minimal configuration.

Prerequisites

Installation

After installing the package, publish migrations:

Run the migrations to create the necessary database tables:

Configuration

The package comes with a default configuration file that you can modify according to your needs. The configuration file is located at config/oltrematica-role-lite.php. Maybe you can be satisfied with the default configuration, but if you want to change it, you can publish the configuration file using the following command:

Table Names

You can customize the table names used by the package:

Model Names

You can specify a custom User model:

Usage

I suggest you to use Enum for roles, but you can use string too.

Assigning Roles

Assign multiple roles

Checking Roles

Check if a user has a specific role:

Check if a user has any of the given roles

Check if a user has all the given roles

Check if a user has no roles

Check if a user has at least one role

Events

The package fires events when roles are assigned or removed from users. You can listen to these events in your application to perform additional actions.

Code Quality

The project includes automated tests and tools for code quality control.

Rector

Rector is a tool for automating code refactoring and migrations. It can be run using the following command:

PhpStan

PhpStan is a tool for static analysis of PHP code. It can be run using the following command:

Pint

Pint is a tool for formatting PHP code. It can be run using the following command:

Automated Tests

The project includes automated tests and tools for code quality control.

Contributing

Feel free to contribute to this package by submitting issues or pull requests. We welcome any improvements or bug fixes you may have.


All versions of laravel-role-lite with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^10.0|^11.0|^12.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 oltrematica/laravel-role-lite contains the following files

Loading the files please wait ....