Download the PHP package ibonly/potato-orm without Composer
On this page you can find all versions of the php package ibonly/potato-orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package potato-orm
ƒ# Potato-ORM
Potato-ORM is a package that manages the CRUD operation of database. Potato-ORM currently supports MYSQL
, POSTGRES
and SQLITE
Database.
Installation
PHP 5.5+ and Composer are required.
Via Composer
Usage
App Namespace
Create a Class
that correspond to the singular form of the table name in the database. i.e.
The table name can also be defined in the model if the user wants it to be specified.
The fields that is to be output can also be specified as protected $fillables = []
.
The Model
class contains getAll()
, where([$field => $value])
, find($value)
, save()
, update() and detroy($id)
methods.
getAll()
Return type = JSON
where($field, $value)
Passing conditions to where
Return type = String
Update($value):
To return custom message, wrap the `save()` method in an `if statement`
Return type = Boolean
save()
To return custom message, wrap the `save()` method in an `if statement`
Return type = Boolean
file($fileName)->uploadFile()
This method is used to upload file, it can only be used along side save()
and update($id)
detroy($value)
Return type = Boolean
Create Database Table
Its is also possible to create Database Table with the Schema
class. The table name will be specified in the
createTable($name)
method.
Return type = Boolean
Database Constraint
Foreign Key
The reference table (users)
and field (id)
will be written as (users-id)
Unique Key
Testing
Contributing
To contribute and extend the scope of this package, Please check out CONTRIBUTING file for detailed contribution guidelines.
Credits
Potato-ORM is created and maintained by Ibraheem ADENIYI
.