PHPackages                             galaxydevs/laravel-api-master - 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. galaxydevs/laravel-api-master

ActiveLibrary[API Development](/categories/api)

galaxydevs/laravel-api-master
=============================

Create Laravel API

v1.0.0(3y ago)043PHP

Since Jul 15Pushed 3y ago1 watchersCompare

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

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

Usage
=====

[](#usage)

Step 1: Install through Composer
--------------------------------

[](#step-1-install-through-composer)

```
composer require galaxydevs/laravel-api-master
```

Step 2: Add new Service Provider in config/app.php inside the providers\[\] array:
----------------------------------------------------------------------------------

[](#step-2-add-new-service-provider-in-configappphp-inside-the-providers-array)

```
DevDr\ApiCrudGenerator\DrCrudServiceProvider::class
```

Step 3: Add this function inside the "app/Exceptions/Handler.php"
-----------------------------------------------------------------

[](#step-3-add-this-function-inside-the-appexceptionshandlerphp)

```
use Psy\Util\Json;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

public function _errorMessage($responseCode = 400, $message = 'Bad Request'){
    $body = Json::encode(
        array(
            "success" => false,
            "responseCode" => $responseCode,
            'message' => $message
        )
    );
    echo $body;
    die;
}
```

Step 4: Add those functions in the "render()"
---------------------------------------------

[](#step-4-add-those-functions-in-the-render)

```
public function render($request, Exception $exception)
{
    if($exception instanceof NotFoundHttpException){
        $this->_errorMessage(404,'Page Not Found');
    }

    if ($exception instanceof MethodNotAllowedHttpException) {
        $this->_errorMessage(405,'Method is not allowed for the requested route');
    }

    return parent::render($request, $exception);
}
```

Step 5: Add this line into your "app/Http/Kernel.php" $routeMiddleware\[\]
--------------------------------------------------------------------------

[](#step-5-add-this-line-into-your-apphttpkernelphp-routemiddleware)

```
'api.auth' => \DevDr\ApiCrudGenerator\Middleware\CheckAuth::class,
```

Now you can use this 'api.auth' middleware anywhere

#### You can pass the "AUTH-TOKEN" in api headers for the check authentication

[](#you-can-pass-the-auth-token-in-api-headers-for-the-check-authentication)

Step 6: User "crud:api-generator" for the crud creation
-------------------------------------------------------

[](#step-6-user-crudapi-generator-for-the-crud-creation)

```
php artisan crud:api-generator User
```

Step 7: After using middleware that in that function you can use the user object by this
----------------------------------------------------------------------------------------

[](#step-7-after-using-middleware-that-in-that-function-you-can-use-the-user-object-by-this)

```
$user = $request->get('users');
```

Step 8: Add this function in the Users Model
--------------------------------------------

[](#step-8-add-this-function-in-the-users-model)

```
public static function findIdentityByAccessToken($token, $type = null)
{
    return static::where(['auth_token' => $token])->first();
}
```

#### OR

[](#or)

without middleware you can use bellow function into the direct controller api action

```
$user = $this->_checkAuth();
```

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

[](#contributing)

We're not suggesting you to use this package. Use it as your own RISK.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

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

1396d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0f1cbe13a117fe5e158c3985c681a4c0370ab76d304a4139b0c34897495fe85?d=identicon)[nitin.vaghani](/maintainers/nitin.vaghani)

---

Top Contributors

[![hussain-technostacks](https://avatars.githubusercontent.com/u/49179430?v=4)](https://github.com/hussain-technostacks "hussain-technostacks (3 commits)")[![technostacksnitin](https://avatars.githubusercontent.com/u/88702110?v=4)](https://github.com/technostacksnitin "technostacksnitin (2 commits)")

---

Tags

laravel

### Embed Badge

![Health badge](/badges/galaxydevs-laravel-api-master/health.svg)

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

###  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.9M271](/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)
