Download the PHP package chiiya/filament-access-control without Composer

On this page you can find all versions of the php package chiiya/filament-access-control. 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 filament-access-control

filament-access-control

Filament Access Control

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

Opinionated setup for managing admin users, roles and permissions within Laravel Filament

Features

Installation

  1. Install the package via composer:

  2. Update your Filament Panel ServiceProvider and register the plugin:

You may remove any calls to login() or other methods that configure the authentication process, since the plugin takes care of that.

  1. Publish the migrations and config, then run the migrations. Make sure you also publish and run the spatie/laravel-permission migrations if you haven't done so yet.

  2. To seed the necessary base data (role & permissions), run php artisan filament-access-control:install or call the Chiiya\FilamentAccessControl\Database\Seeders\FilamentAccessControlSeeder seeder in your database seeder.

  3. Create an admin user using php artisan filament-access-control:user. If you create users programmatically (e.g. in your database seeder), make sure to assign them the super-admin role if you want them to be able to access the role and user management.

Optionally, you can publish the translations with:

Optionally, you can publish the views with:

Usage

Authorizing Resources, Pages & Actions

Authorizing Resources

To authorize access to resources, use policies as described in the Filament documentation.

Authorizing Pages

This package comes with a simple trait that you can use to authorize access to custom pages based on a permission.

Authorizing Actions

One way to authorize actions is to use the visible() method:

Localizing Role & Permission Names

Roles and permissions should have names that make them easy to use in code (e.g. admin-users.update). For the admin you may however wish to localize them or make them more readable. You can do so by simply adding a JSON translation entry for the given role or permission name (e.g. lang/en.json):

Feature: Account Expiry

With the optional account expiry feature, all accounts require an expiration date. When accounts are expired, they can no longer log in. To enable the account expiry feature, enable the feature flag in the config file:

You will also need to add the EnsureAccountIsNotExpired middleware to your filament auth middleware config in your panel service provider:

Feature: Two-Factor Authentication

With the optional two-factor authentication feature, users must enter a verification code sent via email upon login. To enable the two-factor authentication feature, enable the feature flag in the config file:

Custom User Model

To use your own custom user model for the admin (instead of Chiiya\FilamentAccessControl\Models\FilamentUser), point the value of user_model in the filament-access-control config file to your own model.

Please make sure that your model either extends the FilamentUser base case or implements the Chiiya\FilamentAccessControl\Contracts\AccessControlUser interface.

Extending Resources

To extend the resources used for managing admin users, roles and permissions, you can adjust the resources config value:

The easiest way to extend the resources is to create your own resource classes that extend the default ones, and overwrite the following methods:

Screenshots

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-access-control with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3
filament/filament Version ^3.0
illuminate/contracts Version ^8.0|^9.0|^10.0|^11.0
spatie/laravel-package-tools Version ^1.11
spatie/laravel-permission Version ^5.5|^6.4
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 chiiya/filament-access-control contains the following files

Loading the files please wait ....