PHPackages                             manianrezaei/laravel-light-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. manianrezaei/laravel-light-api

ActiveLibrary[API Development](/categories/api)

manianrezaei/laravel-light-api
==============================

Create automatic light api for laravel

0.1.0(2y ago)17MITPHP

Since Jan 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/manianrezaei/laravel-light-api)[ Packagist](https://packagist.org/packages/manianrezaei/laravel-light-api)[ RSS](/packages/manianrezaei-laravel-light-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel Light API
=================

[](#laravel-light-api)

[![](https://camo.githubusercontent.com/5935c2fa8501fdd78b90c07fc5eacd3cb7a8b0fde02e4ea6dd1941c477b9763e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6d616e69616e72657a6165692f6c61726176656c2d6c696768742d6170692e7376673f736f72743d73656d766572)](https://camo.githubusercontent.com/5935c2fa8501fdd78b90c07fc5eacd3cb7a8b0fde02e4ea6dd1941c477b9763e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6d616e69616e72657a6165692f6c61726176656c2d6c696768742d6170692e7376673f736f72743d73656d766572)

The Laravel Light API package is designed to assist users in creating APIs for all Models in Laravel. With this package, you can easily generate API routes for your models, saving you time and effort.

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

[](#installation)

To install the package, run the following command in your Laravel project:

```
$ composer require manianrezaei/laravel-light-api
```

Once the package is installed, you can start using it by following these steps:

1. Publish package vendors:

    ```
    $ php artisan vendor:publish
    ```

then select package provider `ManianRezaei\LaravelLightApi\providers\ApiLightServiceProvider`

2. Optimize the API routes using the following command:

    ```
      $ php artisan optimize
    ```
3. Thats it! You now have API routes and controllers set up for all your models.

Usage
-----

[](#usage)

Laravel Light Api endpoint is `/apilight` by default

To change the endpoint and configure the accessable models, see the `config/apilight.php` .

Set the base endpoint:

```
 'endpoint' => "/apilight",
```

List of models can access by api

```
'permissions'=>[
       "usr"=> [
            "model"=> \App\Models\User::class,
            "allowlist" =>[
                'id',
                'updated_at',
                'created_at'
            ]
        ]
    ]
```

**"Permissions"** contains an array of models that are allowed in LightAPI.

To keep the models' names hidden, you can specify an alias. In the example above, **"usr"** is an alias for the **User** model, and the endpoint for this model will be /apilight/**usr**.

All selectable fields should be added to the **allowlist**.

Custom selection
----------------

[](#custom-selection)

By default, LightAPI selects all whitelisted fields in each query.

Selected fields can be specified in the query string like this:

`/apilight/usr?select=id,created_at`

Contributing
------------

[](#contributing)

If you would like to contribute to this package, feel free to fork the repository on GitHub and submit a pull request. We welcome any contributions and appreciate your support.

License
-------

[](#license)

This package is open-source and released under the [MIT License](https://opensource.org/licenses/MIT). Feel free to use, modify, and distribute it as per the terms of the license.

For more information, please refer to the [GitHub repository](https://github.com/manianrezaei/laravel-light-api).

---

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

831d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d43e15a538d6705b82c7cb73ab30799af8bd568e233de84d93e4d144af612e13?d=identicon)[manian](/maintainers/manian)

---

Top Contributors

[![manianrezaei](https://avatars.githubusercontent.com/u/39521235?v=4)](https://github.com/manianrezaei "manianrezaei (2 commits)")

### Embed Badge

![Health badge](/badges/manianrezaei-laravel-light-api/health.svg)

```
[![Health](https://phpackages.com/badges/manianrezaei-laravel-light-api/health.svg)](https://phpackages.com/packages/manianrezaei-laravel-light-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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