LaravelPackages.net
Acme Inc.
Toggle sidebar
g3n1us/laravel-model-api

Provides a unified api to access model data using basic naming conventions

202
0
v1.0
About g3n1us/laravel-model-api

g3n1us/laravel-model-api is a Laravel package for provides a unified api to access model data using basic naming conventions. It currently has 0 GitHub stars and 202 downloads on Packagist (latest version v1.0). Install it with composer require g3n1us/laravel-model-api. Discover more Laravel packages by g3n1us or browse all Laravel packages to compare alternatives.

Last updated

laravel-model-api

A controller providing a logical url structure for accessing model data

Usage: modelname is the snake cased version of the model. If singular, will display either the first model or the one specified by id. If plural, a paginated list of items will be output. If html is specified, the __toString method will explicitly be called, returning any overloaded version in the model, usually custom html output.

$_GET parameters for plural form only:

paginate - 0 results in no pagination, default = 1

per_page = results per page, disables pagination, integer default is pagination default, 15

offset = offset, return results starting at this offset

limit - limit to return, disables pagination

pluck/property - pluck a value from the returned objects

$_GET parameters for singular form only:

html - returns the model's overloaded __toString method instead of the default JSON representation, also an URL parameter

Comments