PHPackages                             devdr/api-crud-generator - 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. devdr/api-crud-generator

ActiveLibrary[API Development](/categories/api)

devdr/api-crud-generator
========================

This Package is boost your speed of you REST api creation with the exception handling

v2.0.2(3y ago)0488PHP

Since Mar 14Pushed 3y agoCompare

[ Source](https://github.com/DarshanRowdy/ApiCrudGenerator)[ Packagist](https://packagist.org/packages/devdr/api-crud-generator)[ RSS](/packages/devdr-api-crud-generator/feed)WikiDiscussions master Synced 6d ago

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

Usage
=====

[](#usage)

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

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

```
composer require devdr/api-crud-generator
```

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: User "crud:api-generator" for the crud creation
-------------------------------------------------------

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

FYI: Please make sure the parameter should be same as your table name Ex: if the table name is user then you can use command as bellow.

This command generate Model file, Request File, Resource controller file for api and also add resource routes into api.php

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

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

[](#step-4-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 5: After using middleware that in that function you can use the user object by this
----------------------------------------------------------------------------------------

[](#step-5-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)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

##### Enjoy Code :)

[](#enjoy-code-)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

Every ~0 days

Total

5

Last Release

1160d ago

Major Versions

1.0.0.x-dev → 2.0.0.x-dev2023-03-14

### Community

Maintainers

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

---

Top Contributors

[![DarshanRowdy](https://avatars.githubusercontent.com/u/46758396?v=4)](https://github.com/DarshanRowdy "DarshanRowdy (6 commits)")

### Embed Badge

![Health badge](/badges/devdr-api-crud-generator/health.svg)

```
[![Health](https://phpackages.com/badges/devdr-api-crud-generator/health.svg)](https://phpackages.com/packages/devdr-api-crud-generator)
```

###  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)
