PHPackages                             sqweb/laravel\_sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sqweb/laravel\_sdk

Abandoned → [mltpss/laravel-sdk](/?search=mltpss%2Flaravel-sdk)Library[Authentication &amp; Authorization](/categories/authentication)

sqweb/laravel\_sdk
==================

Multipass package for Laravel users

v1.3.4(8y ago)0380[1 issues](https://github.com/SQweb-team/SQweb-SDK-Laravel/issues)GPL-3.0-onlyPHPPHP &gt;= 5.5.9

Since Apr 7Pushed 8y agoCompare

[ Source](https://github.com/SQweb-team/SQweb-SDK-Laravel)[ Packagist](https://packagist.org/packages/sqweb/laravel_sdk)[ RSS](/packages/sqweb-laravel-sdk/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (4)Versions (20)Used By (0)

Multipass Laravel Package
=========================

[](#multipass-laravel-package)

[![Build Status](https://camo.githubusercontent.com/150c7eb61e3465f76b818ce9cd3fed8611b67947d8731ff62e41a9f0590636b1/68747470733a2f2f7472617669732d63692e6f72672f53517765622d7465616d2f53517765622d53444b2d4c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SQweb-team/SQweb-SDK-Laravel)[![Latest Stable Version](https://camo.githubusercontent.com/5f5441120720b594c446340e4ec0894da314531443aa8e5f471adda08a488368/68747470733a2f2f706f7365722e707567782e6f72672f73717765622f6c61726176656c5f73646b2f762f737461626c65)](https://packagist.org/packages/sqweb/laravel_sdk)[![Dependency Status](https://camo.githubusercontent.com/c5e127efcecb1113c72f8f46c5f7c2fba8124fade39bb13d5abc86f13673da61/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537303637326639666364313961303035313835343539392f62616467652e737667)](https://www.versioneye.com/user/projects/570672f9fcd19a0051854599)

**This package allows you to easily integrate SQweb on your Laravel powered website.**

Requirements
------------

[](#requirements)

**This SDK has been tested with PHP 5.5 and greater.**

We are unable to provide official support for earlier versions. For more information about end of life PHP branches, [see this page](http://php.net/supported-versions.php).

Install
-------

[](#install)

**This package is intended for websites powered by Laravel, and advanced integrations.**

If you're using WordPress, we've made it easy for you. Download the SQweb plugin [directly from WordPress.org](https://wordpress.org/plugins/sqweb/), or check out the source [here](https://github.com/SQweb-team/SQweb-WordPress-Plugin).

### Using Composer

[](#using-composer)

1. In your project root, execute `composer require mltpss/laravel-sdk`;
2. Now, go to config/app.php and add this line to your providers array:

    ```
    Sqweb\Laravel_sdk\SqwebServiceProvider::class,
    ```
3. Type `php artisan vendor:publish` at the root of your project to create the configuration file.
4. In `.env`, paste the following configuration and **set the variable `SQW_ID_SITE` with your website ID and the variable `SQW_SITENAME` with the name you want to show on the large multipass button**.

    ```
    SQW_ID_SITE=YOUR_WEBSITE_ID
    SQW_SITENAME=YOUR_WEBSITE_NAME
    ```

For additional settings, see "[Options](#options)" below.

Usage
-----

[](#usage)

The SDK is really simple to use. Here's how to:

### 1. Tagging your pages

[](#1-tagging-your-pages)

This function outputs the SQweb JavaScript tag. Insert it before the closing `` tag in your HTML.

```
{{ $sqweb->script() }}
```

**If you previously had a SQweb JavaScript tag, make sure to remove it to avoid any conflicts.**

### 2. Checking the credits of your subscribers

[](#2-checking-the-credits-of-your-subscribers)

This function checks if the user has credits, so that you can disable ads and/or unlock premium content.

Use it like this:

```
@if ($sqweb->checkCredits())
    // CONTENT
@else
    // ADS
@endif
```

### 3. a) Showing the Multipass button

[](#3-a-showing-the-multipass-button)

Finally, use this code to get the Multipass button on your pages:

```
{{ $sqweb->button() }}
```

We have differents sizes for the button, to use them, pass a string to the function e.g:

```
{{ $sqweb->button('tiny') }}
{{ $sqweb->button('slim') }}
{{ $sqweb->button('large') }}
```

[![Example Buttons](https://camo.githubusercontent.com/5cba7f1591059cc7aa093b60c7ff8efe41fb33aa287e9f0cfaa471b545736eb1/68747470733a2f2f63646e2e6d756c7469706173732e6e65742f6769746875622f627574746f6e734032782e706e67 "Example Buttons")](https://camo.githubusercontent.com/5cba7f1591059cc7aa093b60c7ff8efe41fb33aa287e9f0cfaa471b545736eb1/68747470733a2f2f63646e2e6d756c7469706173732e6e65742f6769746875622f627574746f6e734032782e706e67)

### 3. b) Customizing the Multipass button

[](#3-b-customizing-the-multipass-button)

If you want to customize our different type of button, put the following in your .env of in the sqweb config file. For instance: `SQW_LOGIN=Hello world`Will show `Hello world` instead of `Premium with Multipass` on the regular button for logged out visitors.

Button ModelLogged inLogged outTiny`SQW_CONNECTED_TINY``SQW_LOGIN_TINY`Regular`SQW_CONNECTED``SQW_LOGIN`Large - before black dotN / A`SQW_BTN_UNLIMITED`Large - after black dotN / A`SQW_BTN_NOADS`Large connected`SQW_CONNECTED_S`N / A### 4. More functions

[](#4-more-functions)

#### Display a "Support us" message for your users

[](#display-a-support-us-message-for-your-users)

```
/**
 * Display a support block.
 */

function supportBlock() {   }
``

For instance:

```php
{!! $sqweb->supportBlock !!}
```

Will display the block.

#### Display a locking div for your users

[](#display-a-locking-div-for-your-users)

```
/**
 * Display a locking block.
 */

function lockingBlock() {   }
``

For instance:

```php
{!! $sqweb->lockingBlock !!}
```

We recommand you to use it in combination with our filter functions, like this:

```
@if($sqweb->waitToDisplay('2016-09-15', 2))
    // The content here will appear the 2016-09-17, 2 days after the publication date for non paying users.
@else
    // Here you can put content that free users will see before the content above is available for all.
    // {!! $sqweb->lockingBlock !!}
@end
```

#### Display only a part of your content to non premium users

[](#display-only-a-part-of-your-content-to-non-premium-users)

```
/**
 * Put opacity to your text
 * Returns the text with opcaity style.
 * @param text, which is your text.
 * @param int percent which is the percent of your text you want to show.
 * @return string
 */
    public function transparent($text, $percent = 100) { ... }
```

Example:

```
{!! $sqweb->transparent('one two three four', 50) !!}
```

Will display for free users:

```
one two

```

#### Display your content later for non paying users

[](#display-your-content-later-for-non-paying-users)

```
    /**
     * Display your premium content at a later date to non-paying users.
     * @param  string  $date  When to publish the content on your site. It must be an ISO format(YYYY-MM-DD).
     * @param  integer $wait  Days to wait before showing this content to free users.
     * @return bool
     */
    public function waitToDisplay($date, $wait = 0) { ... }
```

Example:

```
@if($sqweb->waitToDisplay('2016-09-15', 2))
    // The content here will appear the 2016-09-17, 2 days after the publication date for non paying users.
@else
    // Here you can put content that free users will see before the content above is available for all.
@end
```

#### Limit the number of articles free users can read per day

[](#limit-the-number-of-articles-free-users-can-read-per-day)

```
    /**
     * Limit the number of articles free users can read per day.
     * @param $limitation int The number of articles a free user can see.
     * @return bool
     */
    public function limitArticle($limitation = 0) { ... }
```

Example if I want to display only 5 articles to free users:

```
@if ($sqweb->limitArticle(5) == true)
    echo "This is my article";
@else
    echo "Sorry, you reached the limit of pages you can see today, come back tomorrow or subscribe to Multipass to get unlimited articles !";
@endif
```

Options
-------

[](#options)

Unless otherwise noted, these options default to `false`. You can set them in your `.env` file.

OptionDescription`SQW_DEBUG`Output various messages to the browser console while the plugin executes.`SQW_DWIDE`Set to `false` to only enable SQweb on the current domain. Defaults to `true`.`SQW_LANG`We support these locales: `en_US`, `en_GB` and `fr_FR`.`SQW_AUTOLOGIN`Enable or disable our autologin feature. Defaults to `true`.Contributing
------------

[](#contributing)

We welcome contributions and improvements.

### Coding Style

[](#coding-style)

All PHP code must conform to the [PSR2 Standard](http://www.php-fig.org/psr/psr-2/).

### Builds and Releases

[](#builds-and-releases)

See [RELEASE.md](RELEASE.md).

Bugs and Security Vulnerabilities
---------------------------------

[](#bugs-and-security-vulnerabilities)

If you encounter any bug or unexpected behavior, you can either report it on Github using the bug tracker, or via email at `hello@sqweb.com`. We will be in touch as soon as possible.

If you discover a security vulnerability within SQweb or this plugin, please e-mail `security@sqweb.com`. Vulnerabilities will be promptly addressed.

License
-------

[](#license)

Copyright (C) 2018 – SQweb

This program is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details

You should have received a copy of the GNU General Public License along with this program. If not, see .

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~43 days

Recently: every ~24 days

Total

18

Last Release

2947d ago

PHP version history (2 changes)v1.0.0PHP &gt;= 5.2.0

v1.2.0PHP &gt;= 5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/04d8f4c2cae1b0fce66983646d40d2f682bab0e6de986f4456f7e22df7df6d15?d=identicon)[sqweb](/maintainers/sqweb)

---

Top Contributors

[![PierreLvx](https://avatars.githubusercontent.com/u/6901783?v=4)](https://github.com/PierreLvx "PierreLvx (32 commits)")[![mdarriga](https://avatars.githubusercontent.com/u/9700610?v=4)](https://github.com/mdarriga "mdarriga (7 commits)")[![NicolasVdk](https://avatars.githubusercontent.com/u/10002644?v=4)](https://github.com/NicolasVdk "NicolasVdk (2 commits)")[![starmatt](https://avatars.githubusercontent.com/u/8861653?v=4)](https://github.com/starmatt "starmatt (1 commits)")

---

Tags

laravelsdkmultipasssqweb

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sqweb-laravel-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/sqweb-laravel-sdk/health.svg)](https://phpackages.com/packages/sqweb-laravel-sdk)
```

###  Alternatives

[workos/workos-php-laravel

WorkOS PHP Library for Laravel

341.8M](/packages/workos-workos-php-laravel)[martbock/laravel-diceware

Diceware Passphrase Generator for Laravel

3264.7k](/packages/martbock-laravel-diceware)[orchestra/auth

Auth Component for Orchestra Platform

24108.5k3](/packages/orchestra-auth)[ingria/laravel-x509-auth

Laravel 5 Client Certificate auth middleware

375.6k](/packages/ingria-laravel-x509-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
