PHPackages                             reivaj86/multiapps - 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. [Framework](/categories/framework)
4. /
5. reivaj86/multiapps

ActiveLibrary[Framework](/categories/framework)

reivaj86/multiapps
==================

A simple Laravel 5 package for handling child-apps within a main-app.

013PHP

Since Aug 17Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Multiapps for Laravel 5
=======================

[](#multiapps-for-laravel-5)

Simple Laravel 5 package for handling access to child-applications (Appls) within a main-application. Each Appl can be seen as a Moudle or Package within the Main APP. With this package you can grant or ungrant access to every single application, attaching or dettaching appls from a user.

```
Main App. //with 2 child apps
 -->Appl_1. (Module 1)
 -->Appl_2. (Module 2)
 .....

```

...

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

[](#installation)

Pull this package through Composer. ---- composer.json

```
{
    "require": {
        "reivaj86/multiapps": "dev-master"
    }
}
```

Run $ composer update

Add the package to your application service providers in: `config/app.php`

```
'providers' => [

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...

    'Reivaj86\Multiapps\MultiappsServiceProvider',

],
```

Publish the package migrations. Publish config file to your application.

```
$ php artisan vendor:publish --provider="Vendor/Reivaj86/Multiapps/MultiappsServiceProvider" --tag="config"
$ php artisan vendor:publish --provider="Vendor/Reivaj86/Multiapps/MultiappsServiceProvider" --tag="migrations"

```

Run migrations.

```
$ php artisan migrate

```

Crate your seeds // optional Run the seeder

### Configuration file ---- config.php

[](#configuration-file------configphp)

You can change the connection for your models, slug separator and there is also a very userfull purport option. View the config file for more information.

### Usage ---- IsApplUser trait &amp; IsApplUserContract

[](#usage------isappluser-trait--isapplusercontract)

First of all, include `IsApplUser` trait and also implement `IsApplUserContract` inside your `User`model or `Custom` model.

```
use Reivaj86\Multiapps\Contracts\IsApplUserContract;
use Reivaj86\Multiapps\Traits\IsApplUser;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract, IsApplUserContract {

	use Authenticatable, CanResetPassword, IsUserAppl;
```

Done!. You can create your first appl and attach it to a User or Custom Model

```
use Reivaj86\Multiapps\Models\Appl;
use App\User;

$appl = Appl::create([
    'name' => 'Child_App_Name',
    'slug' => 'child_app_slug',
    'description' => '' // optional
]);

$user = User::find($id)->attachAppl($appl); // you can pass whole object, or just id
```

You can easily check if the current user uses a child\_app.

```
if ($user->uses('child_app')) // you can pass an id or slug
{
    return 'child_app_slug';
}
```

You can also do the following:

```
if ($user->usesChild_App_Name())
{
    return 'child_app_slug';
}
```

And also, there is a way to check if a User/Model has access to multiple appls:

```
if ($user->can('child_app_1|child_app_2')) // or $user->can('child_app_1, child_app_2') and also $user->can(['child_app_1', 'child_app_2'])
{
    // if user has at least one appl
}

if ($user->can('child_app_1|child_app_2', 'All')) // or $user->can('child_app_1, child_app_2', 'All') and also $user->can(['child_app_1', 'child_app_2'], 'All')
{
    // if user has all appls
}
```

When you are creating appls, there is also optional parameter `level`. It is set to `1` by default, but you can overwrite it and then you can do something like this:

```
if ($user->level() > 3)
{
    // code
}
```

This option is very usefull when you want to set access levels to every child app. You can easily integrate this with a Role and level authentication package. If user has multiple child apps, the method `level` returns the leve for that appl. For a basic User it shall always be 1.

### Blade Extensions ---- @appl &amp; @uses &amp; @allowedappl

[](#blade-extensions------appl--uses--allowedappl)

There are three Blade extensions. Basically, it is replacement for classic if statements.

```
@appl('child_app_slug') // @if(Auth::check() && Auth::user()->uses('child_app_slug'))
    // user can use child_app_slug
@endappl

@allowedappl('child_app_slug', $view) // @if(Auth::check() && Auth::user()->allowed('child_app', $view))
    // show child_app specific content // Access to specific content within the child_app
@endallowedappl

@appl('child_app_1|child_app_2', 'all') // @if(Auth::check() && Auth::user()->can('child_app_1|child_app_2', 'all'))
    // user can use child_app_1 and also child_app_2
@else
    // something else
@endappl
```

For a better understanding, please have a look at [IsApplUserContract](https://github.com/reivaj86/multiapps/blob/master/src/Reivaj86/Multiapps/Contracts/IsApplUserContract.php).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1981d7515d66b64c2bb2dff3bda78aeb785d7e981fd23fe6720b9a0daf094c85?d=identicon)[reivaj86](/maintainers/reivaj86)

---

Top Contributors

[![Javeeto7](https://avatars.githubusercontent.com/u/9990617?v=4)](https://github.com/Javeeto7 "Javeeto7 (43 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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