PHPackages                             ninjaportal/portal - 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. ninjaportal/portal

ActiveLibrary[API Development](/categories/api)

ninjaportal/portal
==================

A Laravel Like Apigee DevPortal

0.1.3.1(2mo ago)064MITPHPPHP ^8.2

Since Feb 28Pushed 1mo agoCompare

[ Source](https://github.com/ninjaportal/portal)[ Packagist](https://packagist.org/packages/ninjaportal/portal)[ Docs](https://github.com/ninjaportal/ninjaportal)[ RSS](/packages/ninjaportal-portal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (10)Versions (8)Used By (4)

NinjaPortal Portal Package
==========================

[](#ninjaportal-portal-package)

Core domain package for NinjaPortal.

It provides:

- Portal data models (users, categories, API products, audiences, menus, settings)
- Repository + service abstractions
- Translatable model support
- Apigee-backed developer app + credential services
- Core events/policies/RBAC seeding

`ninjaportal/portal` intentionally keeps API authentication concerns out of the core package. JWT-aware user/admin models are provided by `ninjaportal/portal-api`.

Install
-------

[](#install)

From the Laravel app (backend):

```
php artisan portal:install
```

Safer install options:

```
php artisan portal:install --force-provider-overwrite
php artisan portal:install --delete-default-users-migration
```

Notes:

- The installer does not overwrite `App\Providers\NinjaPortalServiceProvider` unless you pass `--force-provider-overwrite`.
- The installer does not delete Laravel's default users migration unless you pass `--delete-default-users-migration`.

Seeding
-------

[](#seeding)

```
php artisan portal:seed --all
php artisan portal:seed --settings --rbac
php artisan portal:seed --demo
```

RBAC And Policies
-----------------

[](#rbac-and-policies)

The package now standardizes model-policy permissions using:

```
portal.{model}.{ability}

```

Examples:

- `portal.user.view_any`
- `portal.user.update`
- `portal.api_product.create`
- `portal.setting_group.delete`

Route/API level permissions remain:

- `portal.admin.access`
- `portal.rbac.manage`
- `portal.admins.manage`
- `portal.activities.view`

The `RbacSeeder` seeds both route-level permissions and model-policy permissions.

Service Implementation Standards
--------------------------------

[](#service-implementation-standards)

### 1. Eloquent-backed domain services

[](#1-eloquent-backed-domain-services)

Use this pattern:

- Extend `BaseService`
- Implement a `...ServiceInterface`
- Use `CrudOperationsTrait`
- Inject a repository interface in the constructor
- Keep business-specific methods small and focused

Examples:

- `src/Services/UserService.php`
- `src/Services/ApiProductService.php`
- `src/Services/SettingService.php`

### 2. External/Apigee-backed services

[](#2-externalapigee-backed-services)

Use this pattern:

- Implement a dedicated interface (not `ServiceInterface`)
- Wrap LaraApigee service calls
- Use consistent error logging via `ReportsServiceFailuresTrait`
- Emit portal domain events after successful mutations

Examples:

- `src/Services/UserAppService.php`
- `src/Services/UserAppCredentialService.php`

Event Naming Standard
---------------------

[](#event-naming-standard)

Preferred event naming is:

```
{DomainThing}{Action}Event

```

Examples:

- `UserCreatedEvent`
- `ApiProductUpdatedEvent`
- `UserAppCredentialCreatedEvent`

Publishing policy:

- `...Event` is the canonical and only supported class name
- do not add no-suffix event classes

`FireEventsTrait` dispatches the `...Event` class only.

Credential-related events may include `credentialKey` when the operation targets a specific credential (approve/revoke/delete/product mutations). Generated-key events include it when the upstream Apigee client returns the created key.

App-Level Wiring (Listeners / Observers)
----------------------------------------

[](#app-level-wiring-listeners--observers)

The package publishes an app provider stub:

- `App\Providers\NinjaPortalServiceProvider`

Use it to wire project-specific listeners/observers (for example syncing users to Apigee on create/update).

Testing And Static Checks (Package)
-----------------------------------

[](#testing-and-static-checks-package)

After installing package dev dependencies:

```
composer install
composer test
composer analyse
composer format
```

Known Tradeoffs (Current)
-------------------------

[](#known-tradeoffs-current)

- Migration rollback safety is not guaranteed for every migration path.
- Demo seeders are intended for one-time/demo environments and are not guaranteed to be re-runnable.
- `restore()` is only supported for models using Eloquent `SoftDeletes`; other models will throw a clear exception if `restore()` is called.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

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

69d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/572472a15d795bd58c160445f6e9298cd82b756bf4355e860491785b5398d6f7?d=identicon)[Youssef20](/maintainers/Youssef20)

---

Top Contributors

[![lordjoo](https://avatars.githubusercontent.com/u/11289152?v=4)](https://github.com/lordjoo "lordjoo (14 commits)")

---

Tags

laravelapigeelordjoolaravel-apigeeapigee-php

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

29428.0k](/packages/sunchayn-nimbus)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.1k](/packages/codebar-ag-laravel-zammad)

PHPackages © 2026

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