Download the PHP package suth/laravel-sift without Composer

On this page you can find all versions of the php package suth/laravel-sift. 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 laravel-sift

Laravel Sift

A Laravel 5 package for Sift Science.

Installation

Install the package using Composer

Next, add the following to the providers array in config/app.php

Register the facade by adding the following line to the aliases array in config/app.php

Config

You can publish the configuration file using the following artisan command

The default config file will check for a SIFT_API_KEY and SIFT_JAVASCRIPT_KEY in your .env file.

Usage

JavaScript Snippet

To add the JavaScript snippet to your pages, include the following line immediately after the opening body tag in your master blade template:

This will track user interaction with your site using a session ID as well as the user's email when authenticated. For more information on the JavaScript snippet itself, consult the Sift Science documentation.

Customizing the Sift User ID

By default the package uses the getAuthIdentifier() method to get an identifier (the user ID in most cases) for a user when tracking auth events. This value can be customized by adding a getSiftId() method to your user model that will return the value you want to track. This is useful if you don't want to expose your user IDs (the value is visible in the JavaScript snippet) or have another value you'd like to use. Keep in mind that using email addresses (or any other value that may change) may not be a good idea because you will lose your reference to the user in Sift if the value changes.

It is recommended that you use SiftScience::getUserId($user) to get a user's Sift ID when reporting your own events, as this is the method used internally. The $user arg is optional and will default to the currently authenticated user. It currently uses the value from the previously mentioned getSiftId() method and will fall back to getAuthIdentifier().

If you are customizing your identifier be aware that if you change it in the future, another user will be created in Sift and their score may be impacted. Also be sure to check out the allowed characters).

Tracking Events

By default the package tracks successful and failed logins as well as logouts, but you'll probably want to track other actions like transactions.

To track events, you'll want to interact with the SiftClient class, which can be accessed as shown below:

In the example above you'll notice SiftScience::getSessionId(). This gets an identifier stored in the current session using the key 'sift_session_id'. You can also pass a session store as an argument for situations (like queues) where there is not a current session.

For more on how to use the SiftClient class, consult the sift-php documentation and the events API reference.

Queues

You may want to use a queue to track certain events to avoid slowing down your application. The built-in support for auth event tracking uses the queue, but as of now you will have to implement queueing yourself. Suggestions are welcome for an elegant way of adding queue support directly to this package.


All versions of laravel-sift with dependencies

PHP Build Version
Package Version
Requires siftscience/sift-php Version 1.*
illuminate/contracts Version 5.1.*|5.2.*|5.3.*
illuminate/support Version 5.1.*|5.2.*|5.3.*
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 suth/laravel-sift contains the following files

Loading the files please wait ....