PHPackages                             mikrocloud/mikrocloud - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mikrocloud/mikrocloud

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mikrocloud/mikrocloud
=====================

Tooling for MikroCloud microservices

v1.2.7.9(1y ago)07.2kproprietaryPHPPHP ^8.1

Since Sep 13Pushed 1y agoCompare

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

READMEChangelog (10)Dependencies (9)Versions (18)Used By (0)

MikroCloud - Laravel Tooling
============================

[](#mikrocloud---laravel-tooling)

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

[](#installation)

```
composer require mikrocloud/mikrocloud
```

### Environment Variables

[](#environment-variables)

Add the following environment variables to your `.env` file:

```
AUTH0_CLIENT_ID=
AUTH0_COOKIE_SECRET=
API_PREFIX=
```

`AUTH0_CLIENT_ID` should be the client ID of the MikroCloud Auth0 tenant application. `AUTH0_COOKIE_SECRET` should be a random string of at least 32 characters. `API_PREFIX` should be the prefix for your API routes, e.g. `v1/my-service`.

### Installation Command

[](#installation-command)

Run the following command run through some boilerplate installation steps:

```
php artisan mikrocloud:install
```

Afterward run the following command to verify that everything is working:

```
php artisan mikrocloud:check
```

---

Usage
-----

[](#usage)

### Authenticated routes

[](#authenticated-routes)

Whenever you want to register a route that requires authentication, add it to the `routes/authenticated.php` file. This will require the user to be authenticated and have the correct scopes to access the route.

During the installation a model called `Customer` was created. You can use this model to create relationships with your own models. The `Customer` model is read-only and only acts as a way to leverage eloquent relationships.

### Billable Models

[](#billable-models)

When creating a billable service, commonly a particular model is used to represent the billable item. If you want to make a model billable, simply extend the model from `MikroCloud\Billable\BillableModel`.

```
namespace App\Models;

use MikroCloud\Billable\BillableModel;
use Illuminate\Database\Eloquent\Concerns\HasUuids;

class MyModel extends BillableModel
{
    use HasUuids;

    protected $fillable = [
        'customer_id',
    ];

    //
}
```

The model that you wish to make billable must have a UUID `customer_id` column and the `id` column must be a UUID.

Nothing more is needed, when a user attempts to create an item, a check will be performed to see if the user has a valid subscription. If the user is not allowed to create the item, execution will be halted and a response will be returned to the user.

**WARNING**: When making a model billable, only an authenticated user can create the model. That means it must come in through an authenticated route and the `auth()->user()` must be set. You cannot create a billable model through a job or a command.

**HTTP requests only.**

### Helpers

[](#helpers)

The following helpers are available:

- `new ipv4Address(string $address)` - Creates a new IPv4Address object - use the `->withIsp()` method to get the ISP name.
- `IpLookup::info(string $address)` - Returns an array with information about the IP address.
- `Websocket::push(string $userId, string $event, array $data)` - Pushes an event to the user's websocket connection.
- `GeographicHelper::class` - Helper class for geographic items, like a list of currencies, countries, etc.

Implementation Notes
--------------------

[](#implementation-notes)

Remember to ask the infrastructure team to add the prefix to the ALB with these paths:

- `v1/my-service/*`
- `v1/my-service`

Service Count Routes
--------------------

[](#service-count-routes)

Billable models are automatically made countable.

As an example, if you set the prefix to `v1/my-service`, the following route will be available:

```
GET /v1/my-service/billable-count/{model}

```

The `model` parameter is the name of the model, e.g. `my-model`. Model names should be converted to kebab-case. E.g. `MyModel` becomes `my-model`.

You may optionally pass the `count=1` URL parameter to get the count of the model.

If `count=1` is not passed, the route will return a list like this:

```
[
    {
        "id": "....", // The ID of the model
        "site_id": "...." // Only if the model has a site_id column otherwise this will be null
    }
]
```

If `count=1` is passed, the route will return a count like this:

```
{
    "count": 1
}
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% 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 ~24 days

Recently: every ~0 days

Total

17

Last Release

586d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e0d504a930cb29c19ab74e9f306e50c63055c38fdb22867bdce35a47f67fb4b?d=identicon)[hanneskruger](/maintainers/hanneskruger)

---

Top Contributors

[![RossLeeThomas](https://avatars.githubusercontent.com/u/65291644?v=4)](https://github.com/RossLeeThomas "RossLeeThomas (10 commits)")[![Hannes-Kruger](https://avatars.githubusercontent.com/u/69590957?v=4)](https://github.com/Hannes-Kruger "Hannes-Kruger (7 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mikrocloud-mikrocloud/health.svg)

```
[![Health](https://phpackages.com/badges/mikrocloud-mikrocloud/health.svg)](https://phpackages.com/packages/mikrocloud-mikrocloud)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[napp/xray-laravel

AWS X-Ray for Laravel applications.

61407.3k](/packages/napp-xray-laravel)

PHPackages © 2026

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