PHPackages                             kindharika/laravel-api-starter - 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. kindharika/laravel-api-starter

ActiveLibrary[API Development](/categories/api)

kindharika/laravel-api-starter
==============================

A Laravel API starter package with service layer, datatable macro, UUID models, FCM notifications, and scaffold generators.

1.0.0(2w ago)00MITPHPPHP ^8.2

Since May 21Pushed 2w agoCompare

[ Source](https://github.com/yogaap24/laravel-api-starter)[ Packagist](https://packagist.org/packages/kindharika/laravel-api-starter)[ RSS](/packages/kindharika-laravel-api-starter/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Laravel API Starter
===================

[](#laravel-api-starter)

A Laravel package that brings the best of the `laravel-template` API architecture into a reusable, modern, and maintainable form. Supports **Laravel 11.x, 12.x, and 13.x**.

Features
--------

[](#features)

- UUID-based models out of the box (v4 by default, configurable)
- Unified JSON response envelope with pagination metadata
- Service layer pattern (BaseService, BaseServiceInterface)
- Base API Controller (BaseApiController)
- Datatable macro (search, sort, filter, date-range on Eloquent Builder)
- Firebase Cloud Messaging (FCM) infrastructure (Channel, Notification, Trait)
- Artisan scaffold generators (model, service, controller, request, migration, resource)
- Auto-discovery via Composer extras

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

[](#installation)

```
composer require kindharika/laravel-api-starter
```

Or add via path repository for local development:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "./package/laravel-api-starter"
    }
  ]
}
```

Publish Config
--------------

[](#publish-config)

```
php artisan vendor:publish --tag=api-starter-config
```

Usage
-----

[](#usage)

### Base classes

[](#base-classes)

Your models should extend `BaseModel`:

```
use Kindharika\ApiStarter\Base\BaseModel;

class Post extends BaseModel
{
    protected $table = 'posts';
}
```

Your controllers should extend `BaseApiController`:

```
use Kindharika\ApiStarter\Base\BaseApiController;

class PostController extends BaseApiController
{
    // use sendSuccess() / sendError()
}
```

Your services should extend `BaseService` and implement `BaseServiceInterface`:

```
use Kindharika\ApiStarter\Base\BaseService;
use Kindharika\ApiStarter\Base\BaseServiceInterface;

class PostService extends BaseService implements BaseServiceInterface
{
    // implements dataTable, getById, create, update, delete
}
```

### Datatable macro

[](#datatable-macro)

Once installed, the macro is available on any query builder:

```
$posts = Post::datatable($request->all())->paginate(15);
```

### Scaffolding

[](#scaffolding)

Generate a full resource scaffold with one command:

```
php artisan api:scaffold Post
```

This generates:

- `app/Models/Post.php`
- `app/Http/Controllers/PostController.php`
- `app/Http/Requests/Post/StorePost.php`
- `app/Http/Requests/Post/UpdatePost.php`
- `app/Services/Post/PostService.php`
- `app/Services/Post/PostServiceInterface.php`
- `app/Http/Resources/PostResource.php`
- Database migration

Or generate individually:

```
php artisan api:make-model Post
php artisan api:make-controller PostController --model=Post
php artisan api:make-service PostService --model=Post
php artisan api:make-request Post
php artisan api:make-migration Post
php artisan api:make-resource Post
```

### Firebase Notification

[](#firebase-notification)

Use the trait in your service or notification class:

```
use Kindharika\ApiStarter\Traits\FirebaseNotification;

class YourService
{
    use FirebaseNotification;

    public function notify($user)
    {
        $this->sendNotification($user, 'Title", "Body", "INFO");
    }
}
```

Configuration
-------------

[](#configuration)

`config/api-starter.php`:

```
return [
    'namespace' => 'App',
    'uuid_version' => 4,
    'fcm' => [
        'enabled' => true,
        'server_key' => env('FCM_SERVER_KEY'),
        'endpoint' => 'https://fcm.googleapis.com/fcm/send',
    ],
    'datatable' => [
        'per_page' => 15,
        'default_sort_column' => 'created_at',
        'default_sort_direction' => 'desc',
    ],
];
```

Upgrading from Template
-----------------------

[](#upgrading-from-template)

If you were previously using the `laravel-template` as-is, migrate by:

1. `composer require kindharika/laravel-api-starter`
2. Replace `AppModel` with `Kindharika\ApiStarter\Base\BaseModel`
3. Replace `AppAuthenticatable` with `Kindharika\ApiStarter\Base\BaseAuthenticatable`
4. Replace `AppService` with `Kindharika\ApiStarter\Base\BaseService`
5. Replace `ApiController` with `Kindharika\ApiStarter\Base\BaseApiController`
6. Replace `ResponseService` with `Kindharika\ApiStarter\Base\ResponseService`
7. Remove `DatatableServiceProvider` — the macro is registered automatically now
8. Use `api:scaffold` to generate new resources instead of manual stubs

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance96

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

20d ago

### Community

Maintainers

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

---

Top Contributors

[![yogaap24](https://avatars.githubusercontent.com/u/30617548?v=4)](https://github.com/yogaap24 "yogaap24 (1 commits)")

---

Tags

apilaravelscaffolduuidserviceFCMdatatablestarter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kindharika-laravel-api-starter/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[illuminate/queue

The Illuminate Queue package.

20432.2M1.5k](/packages/illuminate-queue)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)

PHPackages © 2026

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