square1-io / laravel-connect by robertoprato

Connect to a laravel backend from anywhere
113
1
6
Package Data
Maintainer Username: robertoprato
Maintainer Contact: roberto@square1.io (Roberto Prato)
Package Create Date: 2017-07-22
Package Last Update: 2018-06-06
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2025-01-29 15:01:58
Package Statistics
Total Downloads: 113
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 6
Total Forks: 1
Total Open Issues: 0

Laravel Connect

Access data of a laravel app via a REST API.

Installation

$ composer require square1ltd/laravel-connect

Setup

Register the service in the app config

Square1\Laravel\Connect\ConnectServiceProvider::class

Update the Schema Facade in the app config

Replace 
    'Schema' => Illuminate\Support\Facades\Schema::class  
with    
    'Schema' => Square1\Laravel\Connect\Model\ConnectSchema::class

Double check that the migration files are using the Schema facade

Add authorization guards

    'guards' => [
        'connect' => [
            'driver' => 'passport',
            'provider' => 'users',
        ],
    ],

Config

$ php artisan connect:init

ENV

CONNECT_API_KEY: api key CONNECT_API_AUTH_CLIENT_ID laravel passport client id CONNECT_API_AUTH_GRANT_TYPE laravel passport grant type ( default is password) CONNECT_API_AUTH_CLIENT_SECRET laravel passport secret