adamhut/approvable

A Simple package to put a approval or denial to model

0.1.0 2019-03-01 19:35 UTC

This package is auto-updated.

Last update: 2024-04-19 02:17:57 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Installation

You can install the package via composer:

composer require adamhut/approvable

Usage

php artisan vendor:publish --provider="Adamhut\Approvable\ApprovableServiceProvider" --tag="migrations"

php artisan migrate

First, add the Adamhut\Approvable\Traits\Approvable trait to your User model(s):

use Illuminate\Foundation\Auth\User as Authenticatable;
use Adamhut\Approvable\Traits\Approvable;

class User extends Authenticatable
{
    use Approvable;

    // ...
}

$user->isPending(); //true
$user->isApproved() //false
$user->isDenied();  //false

$user->approve();

$user->isApproved() //true
$user->isPending(); //false
$user->isDenied(); //false

$user->deny();
$user->isDenied()   //true
$user->isApproved() //false
$user->isPending(); //false

Command

We alse provide a summery command

php artisan approval:summary

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email adamhut@gmail.com instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.