2017 © Pedro Peláez
 

library stinter

A plan/subscription auditor for Laravel.

image

henriale/stinter

A plan/subscription auditor for Laravel.

  • Tuesday, April 12, 2016
  • by henriale
  • Repository
  • 1 Watchers
  • 2 Stars
  • 124 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

stinter

A plan/resource auditor for Laravel., (*1)

Installing

1 - Firstly, place the package into your project using composer:, (*2)

$ composer require henriale/stinter
$ composer composer update

2 - Then, create a /config/stinters.php file or just publish it with the following command:, (*3)

$ php artisan vendor:publish --provider="Henriale\Stinter\StintServiceProvider"

Getting Started

1 - Create a restriction/stint class to control your resources:, (*4)

$ php artisan make:stint CreateProduct

2 - Make some validation with it, (*5)

class CreateProduct extends Stinter
{
  protected $basicPlanLimitation = 10;

  public function check(Authenticatable $user)
  {
      if ($user->products()->count() >= $this->basicPlanLimitation) {
        // user has too many products
        return false;
      }

      //user still can have more products
      return true;
  }
}

3 - Now, register in /config/stinters.php so the auditor can check it when triggered, (*6)

return [
    \App\Stinters\CreateProduct::class
];

4 - Finally, use \Gate class passing the stint FQN to handle its permission:, (*7)


can(\App\Stinters\CreateProduct::class)) {
  echo 'yes, he is able';
}
?>





@can(\App\Stinters\CreateProduct::class)
  // can
@else
  // cannot
@endcan

The Versions

12/04 2016

v1.x-dev

1.9999999.9999999.9999999-dev

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

12/04 2016

dev-master

9999999-dev

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

12/04 2016

v1.0.1

1.0.1.0

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

12/04 2016

v1.0.2

1.0.2.0

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

12/04 2016

v1.0.0

1.0.0.0

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

25/03 2016

v0.5.4

0.5.4.0

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

25/03 2016

v0.5.1

0.5.1.0

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

25/03 2016

v0.5

0.5.0.0

A plan/subscription auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor

25/03 2016

v0.1

0.1.0.0

A plan/subscription resource auditor for Laravel.

  Sources   Download

MIT

The Requires

 

by Alexandre Araujo

laravel subscription checker plan auditor