PHPackages                             sedp-mis/base-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sedp-mis/base-api

ActiveLibrary[API Development](/categories/api)

sedp-mis/base-api
=================

Abstraction for api resources in laravel

v0.1.0(9y ago)099[2 issues](https://github.com/sedp-mis/base-api/issues)MITPHPPHP &gt;=5.4.0

Since Sep 23Pushed 9y ago5 watchersCompare

[ Source](https://github.com/sedp-mis/base-api)[ Packagist](https://packagist.org/packages/sedp-mis/base-api)[ RSS](/packages/sedp-mis-base-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

SedpMis\\BaseApi
================

[](#sedpmisbaseapi)

[![Build Status](https://camo.githubusercontent.com/0587e86e257b40164d238d7c0562d42b498ea6d585e076c932f7d7900c9af6f8/68747470733a2f2f7472617669732d63692e6f72672f736564702d6d69732f626173652d6170692e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/sedp-mis/base-api)[![Coverage Status](https://camo.githubusercontent.com/0a383ccbf0847fdb410485360ff5c65de41367a24d064b538eb826187231f32c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736564702d6d69732f626173652d6170692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/sedp-mis/base-api?branch=master)

Abstraction for api resources in Laravel. Compatible to use with Laravel `4.2` and `5.*`.

Installation
------------

[](#installation)

Use composer to install base-api and dependencies:

```
composer require sedp-mis/base-api

```

Introduction
------------

[](#introduction)

The purpose of this repository is to create an abstraction for common use-cases of api resources. It is a good practice to version our api so we will set our base api to `api/v1`. So in the following api implementations, the example resource to be used is `posts`.

Implementation
--------------

[](#implementation)

METHODURLDescription`GET``api/v1/posts``@index`, List of resources`POST``api/v1/posts``@store`, Create or store new resource`GET``api/v1/posts/{id}``@show`, Show resource`PUTPATCH``api/v1/posts/{id}``DELETE``api/v1/posts/{id}``@destroy`, Destroy or delete resourceNotice that `@` are the same with the controller methods in laravel.

Advance Implementation for `GET` methods like `@index` and `@show`.
-------------------------------------------------------------------

[](#advance-implementation-for-get-methods-like-index-and-show)

### `@index` and `@show`

[](#index-and-show)

- **Selective Attributes**. Resource can be fetched with selective or specific fields or attributes by using query parameter `attributes[]`. Example:

```
GET url?attributes[]=id&attributes[]=title

```

- **Relations**. Resource can be fetched with eager loaded relations by using query parameter `relations[]`. Example:

```
GET url?relations[]=comments&relations[]=labels

```

- **Relations Attributes**. Fetched eager loaded relations can also have selective or specific attributes. Example:

```
GET url?relations[comments][attributes][]=id&relations[comments][attributes][]=text

```

### `@index`

[](#index)

- **Pagination**. For list of resources, it is recommended to have it paginated:

```
GET url?page=1&per_page=100

```

This example shows that it is currently on the 1st page and showing 100 records per page. Without `page` parameter, the list will default to all resources to be fetched.

- **Filtering**. It is also handy to filter list by its attributes using `filters[attribute][]` parameter.

- Default:

```
GET url?filters[tag][]=cool&filters[tag][]=trending

```

- Using `equals` operator (behaves like the default example):

```
GET url?filters[tag][equals][]=cool&filters[tag][equals][]=trending

```

- Using `not_equals` operator:

```
GET url?filters[tag][not_equals][]=bug&filters[tag][not_equals][]=foo

```

- **Searching**. It is also possible to search by passing `search` query parameter.

```
GET url?search[input]=SomeTextToSearch&search[compare][]=title&search[compare][]=description

```

- **Sorting**. Sorting can be done by this syntax `sort[attribute_1]=asc&sort[attribute_n]=desc`. Example:

```
GET url?sort[title]=asc

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~187 days

Total

2

Last Release

3334d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/639f0e03d4c219f0faf2b8c900a60cd77b90fd7aab010da5d0c9503bfe609c94?d=identicon)[ajcastro](/maintainers/ajcastro)

---

Top Contributors

[![ajcastro](https://avatars.githubusercontent.com/u/4918318?v=4)](https://github.com/ajcastro "ajcastro (59 commits)")[![markiiman](https://avatars.githubusercontent.com/u/17944707?v=4)](https://github.com/markiiman "markiiman (22 commits)")[![katbritanico](https://avatars.githubusercontent.com/u/17798791?v=4)](https://github.com/katbritanico "katbritanico (1 commits)")

---

Tags

apiapi-resourceslaravel-apibase-api

### Embed Badge

![Health badge](/badges/sedp-mis-base-api/health.svg)

```
[![Health](https://phpackages.com/badges/sedp-mis-base-api/health.svg)](https://phpackages.com/packages/sedp-mis-base-api)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[sajya/server

Easy implementation of the JSON-RPC 2.0 server for the Laravel framework.

2391.9M4](/packages/sajya-server)[specialtactics/laravel-api-boilerplate

An API boilerplate for Laravel

5451.5k](/packages/specialtactics-laravel-api-boilerplate)[wayofdev/laravel-symfony-serializer

📦 Laravel wrapper around Symfony Serializer.

2113.6k](/packages/wayofdev-laravel-symfony-serializer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
