Download the PHP package mltpss/laravel-sdk without Composer
On this page you can find all versions of the php package mltpss/laravel-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-sdk
Multipass Laravel Package
This package allows you to easily integrate SQweb on your Laravel powered website.
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.
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, or check out the source here.
Using Composer
-
In your project root, execute
composer require mltpss/laravel-sdk
; -
Now, go to config/app.php and add this line to your providers array:
-
Type
php artisan vendor:publish
at the root of your project to create the configuration file. - In
.env
, paste the following configuration and set the variableSQW_ID_SITE
with your website ID and the variableSQW_SITENAME
with the name you want to show on the large multipass button.
For additional settings, see "Options" below.
Usage
The SDK is really simple to use. Here's how to:
1. Tagging your pages
This function outputs the SQweb JavaScript tag. Insert it before the closing </body>
tag in your HTML.
If you previously had a SQweb JavaScript tag, make sure to remove it to avoid any conflicts.
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:
3. a) Showing the Multipass button
Finally, use this code to get the Multipass button on your pages:
We have differents sizes for the button, to use them, pass a string to the function e.g:
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 Model | Logged in | Logged out |
---|---|---|
Tiny | SQW_CONNECTED_TINY |
SQW_LOGIN_TINY |
Regular | SQW_CONNECTED |
SQW_LOGIN |
Large - before black dot | N / A | SQW_BTN_UNLIMITED |
Large - after black dot | N / A | SQW_BTN_NOADS |
Large connected | SQW_CONNECTED_S |
N / A |
4. More functions
Display a "Support us" message for your users
php {!! $sqweb->supportBlock !!}
We recommand you to use it in combination with our filter functions, like this:
Display only a part of your content to non premium users
Example:
Will display for free users:
Display your content later for non paying users
Example:
Limit the number of articles free users can read per day
Example if I want to display only 5 articles to free users:
Options
Unless otherwise noted, these options default to false
. You can set them in your .env
file.
Option | Description |
---|---|
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
We welcome contributions and improvements.
Coding Style
All PHP code must conform to the PSR2 Standard.
Builds and Releases
See RELEASE.md.
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 [email protected]
. We will be in touch as soon as possible.
If you discover a security vulnerability within SQweb or this plugin, please e-mail [email protected]
. Vulnerabilities will be promptly addressed.
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 http://www.gnu.org/licenses/.
All versions of laravel-sdk with dependencies
ext-curl Version *