DataStore
DataStore
DataStore
DataStore Helper is the DevLess internal API for working with data related to services. To use the DataStore class import it by inserting use App\Helpers\DataStore;
at the very top of the php file, right after the <?php
tag. Now you can use it to interact with the database.
Query Records
To get all records:
You may pass in query parameters. eg: The size parameter gets a given number of results:
Available query parameters include :
Add Records
To add data to a given table by passing it in as an array of values.
You may also make double entries
Update Records
To update records you need the record id.
The $id
parameter should be a string identifier.
Delete tables or records
To delete records from the table:
To truncate a table:
To drop table:
Instance Info
You may also get all info about the DevLess instance using the DataStore from within your application.
Dump
DevLess also provides a key/value store. This could be used to store user configuration settings or any data not part of the service but relates to the current instance only
Last updated