Skip to content

A Simple package to put a approval or denial to model

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

adamhut/approvable

Repository files navigation

Simple flag a model as approve or deny

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.

About

A Simple package to put a approval or denial to model

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages