PHP code example of lenra / app
1. Go to this page and download the library: Download lenra/app library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lenra / app example snippets
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();
bash
# 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