Looking to hire Laravel developers? Try LaraJobs

laravel-abilities maintained by iutrace

Description
Easily add abilities business logic to your models
Last update
2022/02/04 22:33 (dev-master)
License
Downloads
10

Comments
comments powered by Disqus

Laravel Abilities

A convenient way to encapsulate model conditions business logic

Laravel Gates are an excellent way to separate logic of access and permissions from models, but if we need to separate only models conditions not related to users (ex: if is valid to Publish a Post at certain state regardless of user)

This package adds a layer on top of laravel Gates, so first "ability" validity is checked then user access and permission is checked though normal laravel Gates if present.

Also, this package adds abilities and policies attributes to your models through HasHabilities trait, useful if you need available "actions" at frontend.

Installation

$ composer require iutrace/laravel-abilities

Usage