GithubHelp home page GithubHelp logo

approval's Introduction

Approval

Build status

Content approval system for Laravel. Works just like Laravel's own soft deleting system.

Requirements

PHP >= 5.5

Installation

Step 1: Add the following line to your composer.json's require array.

"hkan/approval": "dev-master"

Step 2: Add is_approved column to your desired models' tables (Recommended migration line)

$table->boolean('is_approved')->default(false);

Step 3: Copy the following line to the providers array of app/config/app.php

'Hkan\Approval\ApprovalServiceProvider'

Step 4: Add the trait to your model(s).

use \Hkan\Approval\Traits\ApprovalTrait;

Usage

Approve and unapprove posts

$post->approve()
$post->unapprove()

Approved and unapproved posts

Post::all() // Only approved posts
Post::onlyUnapproved()->get() // Only unapproved posts
Post::withUnapproved()->get() // Both approved and unapproved posts

Contribution

Issues, pull requests and feature requests are welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.