Download the PHP package ngarak-dev/permissions-ui-wrapper without Composer

On this page you can find all versions of the php package ngarak-dev/permissions-ui-wrapper. 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 permissions-ui-wrapper

Permissions UI Wrapper

A UI wrapper for Spatie Laravel-Permission with Bootstrap, Tailwind CSS, and Livewire support.

Features

Installation

You can install the package via composer:

The package automatically:

Manual Installation

If you prefer manual installation, you can use the provided artisan commands:

These commands will automatically publish Spatie Permission package migrations before installing the package's own migrations, ensuring proper setup sequence.

You can use the --force flag with either command to overwrite existing files.

Publishing All Components

If you want to make all components available in your application for customization, you can use the publish-all command:

This will publish:

Customizing the View Namespace

By default, the package uses permission-wrapper as the namespace for views. You can change this in the config:

After changing this, you should re-publish the views to the new namespace location:

This will publish the views to resources/views/your-custom-namespace/.

Template Namespace Consistency

All templates in the package use the configurable namespace for includes and extends:

This ensures that all view resolution is consistent with your configured namespace, even for deeply nested includes and components.

Setting up Super User

After installation, you should set up a super user who can manage permissions and roles:

The new command allows:

Using Seeders and Factories

The package provides seeders and factories to quickly set up roles and permissions for testing or initial production setup:

Once published, you can use the seeders in your application:

Seeders include:

You can configure the seeder behavior in the permissions-ui.php config file under the seeder section:

Configuration

If you want to manually publish the configuration:

Views and Routes

The permissions-ui:install command automatically:

  1. Copies all view files to resources/views/permission-wrapper/ in your application
  2. Publishes routes to routes/permission-wrapper.php
  3. Adds an include statement to your application's routes/web.php file

This approach allows you to customize views and routes directly in your application without modifying the package files.

If you prefer to manually publish the views:

Customizing Views

All published views are in the resources/views/permission-wrapper directory, organized by UI framework (bootstrap/tailwind) and feature type. You can modify these views directly without affecting the package.

Customizing Routes

After installation, you'll find a permission-wrapper.php file in your routes directory. You can modify these routes as needed. To prevent the package from loading its internal routes, set the following in your config:

Livewire Components

This package includes Livewire components for reactive permission management - with livewire make sure to change and use tailwind in permission-ui.php:

Installation with Livewire

You can choose to install Livewire components during the installation process:

If you install with the --with-livewire-only option, only Livewire routes and views will be published.

Accessing Livewire Components

After installation, the Livewire components are accessible at:

The prefix can be customized in the configuration file.

Running Migrations

Run migrations to add permission groups:

Spatie Laravel-Permission Integration

This package provides a user interface for the Spatie Laravel-Permission package. Here's a comprehensive guide to working with the underlying Spatie features.

Basic Setup

Ensure your User model implements the HasRoles trait:

Working with Permissions

Checking Permissions

Using Middleware

This package automatically registers Spatie's middleware. Use them in your routes:

Blade Directives

Use Spatie's Blade directives in your views:

Working with Roles

Assigning Roles

Revoking Roles

Syncing Roles

Checking Roles

Permission Groups

This package extends Spatie's permissions with a grouping feature. The groups are defined in the configuration:

You can assign a permission to a group when creating or editing it through the UI, which helps organize permissions logically.

Super Admin Role

By default, this package looks for a role specified in the config (permissions_manager_role) to grant full access to the permissions management UI:

Users with this role will have full access to create, edit, and delete roles and permissions.

Caching

Spatie Laravel-Permission uses caching to speed up permission checks. The cache is automatically reset when:

If you need to manually clear the cache:

Database Seeding

This package provides predefined seeders that can be published and customized. To seed a production environment with initial permissions and roles:

The seeder will create common permissions, roles, and assign them appropriately.

Multiple Guards

Spatie Laravel-Permission supports multiple authentication guards. This UI package primarily works with the 'web' guard, but the underlying Spatie functionality supports custom guards:

UUID Support

If your application uses UUIDs instead of auto-incrementing IDs, make the following changes after installing:

  1. Publish the migrations with php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="migrations"
  2. Modify the published migrations to use UUID columns
  3. Update your model implementations

Usage

Select UI Framework

Choose between Bootstrap and Tailwind UI in the config:

Permission Groups

Organize permissions into logical groups:

Routes

The package registers the following routes by default:

Authorization

By default, only users with the role specified in permissions_manager_role config (default: 'super-admin') can access these routes. You can customize this in the configuration file.

Testing

License

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


All versions of permissions-ui-wrapper with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
spatie/laravel-permission Version ^6.17
livewire/livewire Version ^3.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 ngarak-dev/permissions-ui-wrapper contains the following files

Loading the files please wait ....