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

ActiveLibrary

rawaby88/portal
===============

Portal

3.0.1(3y ago)17.8kMITPHPPHP ^7.3 || ^8.0 || ^8.1 || ^8.2

Since Aug 2Pushed 3y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (7)Versions (52)Used By (0)

Portal ⾨
========

[](#portal-)

This package adding new guard \['portal'\] to use on authenticated routes.

it will check if user has valid Token and permissions to endpoint

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

[](#installation)

You can install the package via composer:

```
composer require rawaby88/portal
```

Usage
-----

[](#usage)

Add Portable trait to User model;

```
use Rawaby88\Portal\Portable;

use Portable;
```

Run migrate to update user table:

```
php artisan migrate
```

Migration Customization

If you are not going to use Portal's default migrations, you should call the

```
Portal::ignoreMigrations();
```

method in the register method of your

```
App\Providers\AppServiceProvider class.
```

You may export the default migrations by executing the following command:

```
 php artisan vendor:publish --tag=portal-migrations
```

Usage by adding middleware 'auth:portal' to endpoints

```
Route::middleware('auth:portal')->get('/user', function (Request $request) {
    return auth()->user()->token;
});
```

auth() functions will be available for you to use

```
auth()->check();
auth()->id();
auth()->user();
auth()->user()->token;
auth()->user()->appliance;

//you can also call other param as credit
auth()->user()->getData('credit');
auth()->user()->getData('workspace');
```

if you would like to change data stored in user table You may export the default config by executing the following command:

```
 php artisan vendor:publish --tag=portal-config
```

\[/config/portal.php\]

```
return [
	'auth_endpoint'       => env( 'PORTAL_AUTH_ENDPOINT', '172.17.0.1/api/auth/token/check/' ),
	'expiration'          => null,

	//user mode namespace
	'user_model'          => env( 'PORTAL_USER_MODEL', 'App\Models\User' ),

	// Mapping data from response to database
    //add or remove fields as you wish
	'db_user_fields'      => [
		'id'    => 'user_id',
		'name'  => 'name',
		'email' => 'email'
	],

	// primary key for user table
	'user_model_key'      => 'user_id',

	// primary key type -- don't change
	'user_model_key_type' => 'string',
];
```

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Mahmoud Osman](https://github.com/rawaby88)
- [Rafał Andryanczyk](https://github.com/rafalandryanczyk)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

Established project with proven stability

 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 ~12 days

Recently: every ~64 days

Total

51

Last Release

1151d ago

Major Versions

0.9.1 → 1.0.12021-08-23

1.3.2 → 2.02022-02-15

2.4.6 → 3.0.02023-03-15

PHP version history (4 changes)0.0.1PHP ^7.4|^8.0

0.9.1PHP ^7.3 || ^8.0

2.0PHP ^8.0

3.0.0PHP ^7.3 || ^8.0 || ^8.1 || ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a26344976d8ebbaa7896e254939250e43e600e0cbecc4b4762d5dede0bbb13b?d=identicon)[rawaby88](/maintainers/rawaby88)

---

Top Contributors

[![rawaby88](https://avatars.githubusercontent.com/u/3300771?v=4)](https://github.com/rawaby88 "rawaby88 (2 commits)")

---

Tags

portalrawaby88

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)

PHPackages © 2026

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