Download the PHP package ibraheem-ghazi/stager without Composer

On this page you can find all versions of the php package ibraheem-ghazi/stager. 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 stager

Laravel Stager State Machine

This is a Laravel 5.6 package for eloquent models. Its purpose is to add state machine functionalty to models

Features

Installation

Configuration

Notes:

this command will auto modify actual model file and add needed use statements and write needed constants from states

//an example of auto-generated data to model

<?php

namespace App;

use \IbraheemGhazi\Stager\Traits\Stager;
use Illuminate\Database\Eloquent\Model;

class Payment extends Model
{
    /**** AUTO-GENERATED STAGER DATA ****/

    use Stager;

    const STATE_PENDING = 1;
    const STATE_PAYMENT_ACCEPTED = 2;
    const STATE_IN_PROGRESS = 3;
    const STATE_ENDED = 4;

    /**** END OF AUTO-GENERATED STAGER DATA ****/
}

Note: you must not edit anything between these comments (or comments it self):

/**** AUTO-GENERATED STAGER DATA ****/

...

/**** END OF AUTO-GENERATED STAGER DATA ****/

the generator will read model file if it has these comments it will replace it's content with new auto generated code otherwise if it can not find these comment it will assume the class does not contains that data

Shared Trait

shared trait used to define a shared properties for all models that use stager, for example if you want to add a relation , it's mainly defined so you can easily override 2 Stager methods for last state changed time :

getStateChangedAt() get last time state has changed

scopeStateChangeWithin($query, $modifier, $interval) a scope to get only rows that changed Within X Days for example

preTransitionNameTransition Function

if a function defined in the model with studly case of transition has prefix pre and suffix Transition it will be executed before transition action if it return TRUE it will complete the transition otherwise it will abort it

example: assume you have a transition named : cancel-order then

where ...$args is array of parameters passed from doCancelOrder

Functions Available

func params return description
getCurrentStateValue - mixed return value of current state/
getCurrentStateName - string return name of current state/
hasValidStateMachine - bool check if this model has valid state machine or not/

Magic Functions Available

each magic function has prefix [is, can, do] with studly case of target either state or transition

Transition Life Cycle

  1. check if can transition from current state
  2. if model define preTransitionNameTransition then it will execute , if it return true the transition continue otherwise it will abort (fail)
  3. trigger beforeTransition event
  4. update the state
  5. execute affection if exists
  6. trigger afterTransition event

All versions of stager with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
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 ibraheem-ghazi/stager contains the following files

Loading the files please wait ....