This lib integrates all the elements the app needs in order to only keep the views, listeners and resources in the app project.
Report Bug
·
Request Feature
To incorporate it into your Lenra app project, simply run the following command:
composer require lenra/app
To call a Lenra API from a listener, use the Lenra\App\Api
instance provided in the .
You can then create a document using the data API with the following code:
class CustomType extends \Lenra\App\Data {
public string $value;
public function __construct(string $value = null) {
$this->value = $value;
}
}
$myDoc = $request->api->data()->coll(CustomType::class)->createDoc(new CustomType("Hello world"))->wait();
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please open an issue with the tag "enhancement". Don't forget to give the project a star if you liked it! Thanks again!
A part of this lib is generated from the Lenra API. To generate the classes, run the following commands:
# Load API
wget https://github.com/lenra-io/api/releases/latest/download/load-api.sh -O - -q | bash
# generate Models
php vendor/bin/jane generate
# generate builder classes
php script/generate-classes.php
./vendor/bin/phpunit test
Distributed under the MIT License. See LICENSE for more information.
Lenra - @lenra_dev - [email protected]
Project Link: https://github.com/lenra-io/app-lib-php