Download the PHP package raqmeyat/smart-orm without Composer

On this page you can find all versions of the php package raqmeyat/smart-orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smart-orm

raqmeyat/smart-orm

Request-driven smart field selection, smart filters and typed data classes for Eloquent. Built for mobile-first JSON APIs: clients ask for exactly the columns and rows they need, the server only ever honours an explicit allow-list.

The service provider is auto-discovered. Optional publishing:


1. Smart fetch: select only what you need

Add the trait (or HasSmartOrm, which bundles both traits):

Request SQL columns
?fields=title,views posts.title, posts.views, posts.id
?fields=* posts.* (hidden attributes still never serialise)
(no fields) posts.* by default, or the fillable list, see config
?fields[posts]=title JSON:API style, also supported

What is selectable: the model's $fillable, minus anything in $hidden, plus the primary key (and any extra_selectable columns from config). Requested names are intersected with that list, so column names never come from user input verbatim. Override per model:

Unknown fields are ignored by default (fields.strict = false). That is deliberate: an old mobile build that still asks for a column you removed must not break during a rolling deploy. Turn strict on to get a 422.

smartSelect() keeps expression columns that are already on the query (withCount, selectSub), so order does not matter.

2. Smart filters

Generate an allow-list from the table schema, then review it:

Request grammar

Request Meaning
?filter[title]=Laravel equals
?filter[title][like]=lara contains (case-insensitive on every driver, wildcards escaped)
?filter[title][starts]=PHP / [ends]=tips starts / ends with
?filter[views][gte]=10&filter[views][lte]=99 several operators on one field (AND)
?filter[views][between]=5,10 inclusive range
?filter[id][in]=1,2,3 or ?filter[id][]=1&filter[id][]=2 in list (nin = not in)
?filter[published_at][null]=1 IS NULL (0 = IS NOT NULL; notnull is the inverse)
?filter[author.name]=Alice through a relation
?filter[search]=hooks a custom filter (see below)
?sort=-views,title descending views, then ascending title

Operators: eq neq gt gte lt lte like starts ends in nin between null notnull.

Custom filters

Safety properties

Errors render themselves as JSON:

3. Data classes

reads the real table schema and your $casts and writes App\Data\PostData:

partial() is the mobile payload path: unselected columns are absent, not null, and every value is typed:

fromModel() on a partially loaded model throws DataHydrationException naming the missing attributes, so a half-loaded object can never masquerade as a full one.

Type mapping: integers → int, floats → float, decimals → string (a float would round money), booleans (incl. tinyint(1)) → bool, dates → CarbonImmutable, JSON / array casts → array, backed-enum casts → the enum, everything else textual → string. Hidden attributes are skipped unless --with-hidden. property_case = camel in config emits camelCase properties.

Generator options

Command Options
make:data-model {model} --with-hidden, --force
make:filtter {model} --only-fillable, --force

{model} accepts User, Billing/Invoice or a fully qualified class. Output goes to App\Data / App\Filters (configurable), mirroring the model's sub-namespace. Existing files are never overwritten without --force. Generated filters never include hidden, JSON, long-text or unknown-typed columns, but review them: the generator cannot know which non-hidden columns are sensitive.


Configuration

See config/smart-orm.php; every option is documented inline.

Testing

CI runs the suite on PHP 8.4 and 8.5, SQLite, MySQL 8.0 / 8.4 and PostgreSQL 16 / 17.

Publishing to Packagist

  1. Push this directory to GitHub as raqmeyat/smart-orm (the package name is raqmeyat/smart-orm).
  2. Tag a release: git tag v1.0.0 && git push origin v1.0.0.
  3. Submit the repository URL at https://packagist.org/packages/submit, then enable the GitHub webhook / Packagist GitHub App so new tags are picked up automatically.

Do not add a version key to composer.json; Packagist derives versions from git tags.

License

MIT. See LICENSE. By Loai Kanou


All versions of smart-orm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-json Version *
illuminate/console Version ^13.0
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/http Version ^13.0
illuminate/support Version ^13.0
nesbot/carbon Version ^3.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package raqmeyat/smart-orm contains the following files

Loading the files please wait ...