Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Latest commit

 

History

History
26 lines (16 loc) · 695 Bytes

README.md

File metadata and controls

26 lines (16 loc) · 695 Bytes

Laravel Paywall

Contracts

There are three main concepts: Events, Authorizer and Rule. Probably the best way of understading them is by checking the already implemented ones.

Events

Represents a association between an User and a Subject.

Authorizer

Must implement the allows method. This method must return a boolean whether the user can or cannot access a determined subject, overriding the rules.

Rules

Must implement the allows method. Normally it will verify the events between User and Subject.

Default usage

@paywall
  This content is blocked after reading 3 different contents.
@else
  If the content is blocked, this is shown.
@endpaywall