Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

ExpressiveLabs/syncad-connector-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Syncad-Connector-Laravel

Recommended tools to complete this integration:
☕🎶💻⏰
This package allows to easily connect any Laravel application to an instance of the syncad application management platform.

Table of contents

  1. Installation
    1. Using Composer
  2. Configuration
    1. Connecting things up
    2. Configuration options
  3. Usage
    1. connection/test
    2. login/init
    3. ext/auth
  4. Bugs

Installation

Using Composer

First of all, install the package. Y'all know the drill, but as a reminder:
composer require mainstreamct/syncad-connector-laravel
Then publish the configuration files using:
php artisan vendor:publish

Laravel 5.5 and below

For Laravel 5.5 and below, add this to your config/app.php:

// Providers array:
  mainstreamct\SyncadConnectorLaravel\SyncadConnectorServiceProvider::class,
// Aliases array:
  'Syncad' => mainstreamct\SyncadConnectorLaravel\Syncad::class,
Laravel 5.6 and up

You're all ready to rock! Thanks to package discovery, you don't need to manually add the service provider to your config/app.php.

Configuration

Connecting things up

  1. Log in to your Syncad installation and go to Admin > Apps
  2. Click '+' (Add existing application)
  3. Fill out your app's details (location, application key)
  4. Connect!

Configuration options

In config/syncad.php, you'll find the following options:

  1. key contains your application key, this should be set in your .env file.
  2. color specifies a unique app color used in your Syncad dashboard to distinguish your application.
  3. login_redirect specifies the URL a user is redirected to upon login. This defaults to /admin.
  4. name is the application name that is stored on your Syncad instance upon connecting. It defaults to your .env's APP_NAME key.

Usage

This package exposes the following endpoints that are used by Syncad.

[POST] connection/test

Params: key
This endpoint tests the connection using the provided key. It returns an array of environment data used by Syncad to personalize your application.

[POST] login/init

Params: email, token, key
This endpoint returns a login token for a given user using their email and the stored syncad_token.

[GET] ext/auth

Params: key
This endpoint logs the user in by the provided Syncad token syncad_token. This login token is destroyed upon login. The user is then redirected to the login_redirect URL specified in config/syncad.php.

Bugs

Found a bug? Message us at [email protected] or contact us via the Support environment in your Mainstream Web Portal (MainstreamCT customers only).

Copyright © 2019 MainstreamCT