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).
TO DO: provide an explanation of the rationale behind this library and some usage examples.
Note: currently, this tool generates code for use with AngularJS 1.x, and it expects an Angular service called
remote
of typeRemoteService
.This requirement is temporary and it will be removed on a later version of this tool.
Additional documentation will be written, as soon as I find the time for it.
- PHP >= 7.0
- AngularJS 1.x
- Laravel >= 4.2
- Electro >= 1.0
On the command-line, type:
composer require php-gear/auto-client
Register the Artisan command on artisan.php
:
Artisan::resolve (PhpGear\AutoClient\Laravel\AutoClientCommand::class);
workman install php-gear/auto-client
On config/app.php
, define the APIs to be exported to Javascript.
Example:
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
];
artisan autoclient:generate
workman autoclient:generate
This library is open-source software licensed under the MIT license.
See the accompanying LICENSE
file.
Copyright © 2018 Cláudio Silva