Download the PHP package protosofia/ben10ant without Composer

On this page you can find all versions of the php package protosofia/ben10ant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ben10ant

ben10ant

A really usefull Multi-Tenancy package for Laravel, it's serious, at least i'm trying to...

Installation

composer require protosofia/ben10ant

Configuration

Console Commands Configuration

Add to app/Console/Kernel.php:

...
protected $commands = [
    ...
    \Protosofia\Ben10ant\Commands\TenantCreate::class,
    \Protosofia\Ben10ant\Commands\TenantMigrate::class,
    \Protosofia\Ben10ant\Commands\TenantMigrateRefresh::class,
    \Protosofia\Ben10ant\Commands\TenantMigrateRollback::class,
    \Protosofia\Ben10ant\Commands\TenantSeed::class,
    ...
];
...

Middleware Configuration

Add to app/Http/Kernel.php:

...
protected $middleware = [
    ...
    \Protosofia\Ben10ant\Middlewares\CheckTenantByKey::class,
    ...
];
...

Provider Configuration

Add to config/app.php:

...
'providers' => [
    ...
    \Protosofia\Ben10ant\Providers\TenantServiceProvider::class,
    ...
],
...

Facade

Add to config/app.php:

...
'aliases' => [
    ...
    'Tenant' => Protosofia\Ben10ant\Facades\TenantFacade::class,
    ...
],
...

Models

This package have 3 types of models:

To manage the "tenants" table, you can create a model as below:

...
use Protosofia\Ben10ant\Models\TenantModel;

class Tenant extends TenantModel
{
    //
}

To have a tenant user (authenticatable), you can create a model as below:

...
use Protosofia\Ben10ant\Models\TenantAuthenticatableBaseModel;

class User extends TenantAuthenticatableBaseModel
{
    use Notifiable;
    ...
}

To have models to handle tenant data (no authenticatable), you can create a model as below:

...
use Protosofia\Ben10ant\Models\TenantBaseModel;

class YourTenantTable extends TenantBaseModel
{
    protected $table = 'your_tenant_table'; //optional
    ...
}

Usage

Config

php artisan vendor:publish

This will publish the config file.

Console Commands

Create a New Tenant

tenant:create {name} {keyname}

This command is a tenant creator wizard, you can configure the database connection and storage.

Run Migrations on Tenant Database

tenant:migrate {tenant} {--force} {--path} {--pretend} {--step}

This command is an indirect call to 'migrate' command, it set tenant conenction automatically. If the path option is not defined it assumes default path: database/migrations/tenants.

Refresh and Run Migrations on Tenant Database

tenant:migrate:refresh {tenant} {--force} {--path} {--seed} {--seeder} {--step}

This command is an indirect call to 'migrate:refresh' command, it set tenant conenction automatically. If the path option is not defined it assumes default path: database/migrations/tenants.

Rollback a Migrations on Tenant Database

tenant:migrate:rollback {tenant} {--force} {--path} {--seed} {--seeder} {--step}

This command is an indirect call to 'migrate:rollback' command, it set tenant conenction automatically. If the path option is not defined it assumes default path: database/migrations/tenants.

Seed a Tenant Database

tenant:db:seed {tenant} {--force} {--class}

This command is an indirect call to 'db:seed' command, it set tenant conenction automatically. If the class option is not defined it assumes default class: DatabaseSeeder.

Middleware

There are 3 middlewares available on the package:

Singleton Service / Facade

The service is a singleton, accessible from a Facade Tenant. E.g:

...
use Tenant;

$tenant = Tenant::setTenantByUUID($uuid);

if (!$tenant) {
    return response()->json(['error' => 'No tenant found.'], 404);
}
...

The service has 4 methods to set tenant:

TODO


All versions of ben10ant with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^5.4
webpatser/laravel-uuid Version 3.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package protosofia/ben10ant contains the following files

Loading the files please wait ....