sonleu/sconnect

SConnect API integration with Laravel by Son Leu

v1.1.14 2022-07-08 09:04 UTC

This package is auto-updated.

Last update: 2023-06-14 11:08:10 UTC


README

SConnect Integration with Laravel

Table of Contents

  1. Installation
  2. Configuration
  3. Custom Models

Installation

Execute the following command to get the latest version of the package:

composer require sonleu/sconnect

Configuration

Add these inside of .env

S_CONNECT_URL=<SCONNECT_BASE_API_URL>
S_CONNECT_API_KEY=<SCONNECT_API_KEY>

Publish configs

php artisan vendor:publish --tag=s_connect_config

Custom models

By default, packages' models will be returned in api responses.

In case you want to customize the models, change the namespaces inside config.s_connect.models. For example:

// config/s_connect.php

return [
    /*
    |--------------------------------------------------------------------------
    | Custom models
    |--------------------------------------------------------------------------
    | Your models to which SConnect data should be returned.
    |
    | Your own models should extends the base models.
    |
    */
    'models' => [
        'user' => \App\User::class,
        'position' => '\SonLeu\SConnect\Models\Position',
        'department' => '\SonLeu\SConnect\Models\Department', 
    ]
];