Auto Client
Introduction
This package provides a command-line tool for use either with the Laravel framework (as an Artisan command) or with the Electro framework (as a Workman command)., (*1)
TO DO: provide an explanation of the rationale behind this library and some usage examples., (*2)
Note: currently, this tool generates code for use with AngularJS 1.x, and it expects an Angular service called remote
of type RemoteService
., (*3)
<, (*4)
p>This requirement is temporary and it will be removed on a later version of this tool., (*5)
Documentation
Additional documentation will be written, as soon as I find the time for it., (*6)
Installation
Runtime requirements
Optionally, one of
- Laravel >= 4.2
- Electro >= 1.0
Installing on Laravel
On the command-line, type:, (*7)
composer require php-gear/auto-client
Register the Artisan command on artisan.php
:, (*8)
Artisan::resolve (PhpGear\AutoClient\Laravel\AutoClientCommand::class);
Installing on Electro
workman install php-gear/auto-client
Usage
On Laravel
Configuring
On config/app.php
, define the APIs to be exported to Javascript., (*9)
Example:, (*10)
return [
'autoclient' => [
'APIs' => [
// Endpoint URL => [controller class, target directory, Angular module name]
'API/something' => [SomethingController::class, 'App/remote', 'App'],
],
],
///... the rest of the existing file
];
Running the generator
artisan autoclient:generate
On Electro
Running the generator
workman autoclient:generate
License
This library is open-source software licensed under the MIT license., (*11)
See the accompanying LICENSE
file., (*12)
Copyright © 2018 Clåudio Silva, (*13)