Download the PHP package aymanalhattami/laravel-approval without Composer

On this page you can find all versions of the php package aymanalhattami/laravel-approval. 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 laravel-approval

Attach modification approvals to any model to prevent unauthorised updates.

Note: This package is forked from cloudcake/laravel-approval in order to support latest laravel version and to add new features

Getting Started

Install the package via composer

Register the service provider

This package makes use of Laravel's auto-discovery. If you are an using earlier version of Laravel (< 5.4) you will need to manually register the service provider.

Add Approval\ApprovalServiceProvider::class to the providers array in config/app.php.

Publish configuration

php artisan vendor:publish --provider="Approval\ApprovalServiceProvider" --tag="config"

Publish migrations

php artisan vendor:publish --provider="Approval\ApprovalServiceProvider" --tag="migrations"

Run migrations

php artisan migrate

Setting Up

Setup Approval Model(s)

Any model you wish to attach to an approval process simply requires the RequiresApproval trait, for example:

Conditional Approvals

There may be instances where you don't always want your model to go through an approval process, for this reason the the requiresApprovalWhen is available for your convenience and defaults to false so that no unintended approvals are created behind the scenes:

Optional Attributes

Approval models come with a few optional attributes to make your approval process as flexible as possible. The following attributes are define by default with the set defaults, you may alter them per model as you please.

Setup Approver Model(s)

Any other model (not just a user model) can approve models by simply adding the ApprovesChanges trait to it, for example:

Any model with the ApprovesChanges trait inherits the approval access function.

Approver Authorization (Optional)

By default, any model with the ApprovesChanges trait will be able to approve and disapprove modifications. You can customize your authorization to approve/disapprove modifications however you please by adding the authorizedToApprove method on the specific approver model:

Disapprover Authorization (Optional)

Similarly to the approval process, the disapproval authorization method for disapproving modifications follows the same logic:

Usage

Retrieving Pending Modifications

Any model that contains the RequiresApproval trait may have multiple pending modifications, to access these modifications you can call the modifications() method on the approval model:

Retrieving Only Pending Creations

Retrieving Only Pending Changes

Retrieving Modification Creator

For any pending modifications on a model, you may fetch the model that initiated the modification request:

This (modifier) would usually be a user that changed the model and triggered the approval modification, but because Approval caters for more than just users, it's possible that the creator is any other model.

Retrieving A Model's Modifications

Adding a Modification Approval

Adding a Modification Disapproval

Retrieving Modification Approvals

Retrieving Approval Author

Retrieving Approval Reason

Retrieving Modification Disapprovals

Retrieving Disapproval Author

Retrieving disapproval Reason

Retrieving Remaining Required Modification Approvals

Retrieving Remaining Required Modification Disapprovals

Forcing Modification Updates


All versions of laravel-approval with dependencies

PHP Build Version
Package Version
No informations.
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 aymanalhattami/laravel-approval contains the following files

Loading the files please wait ....