1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 20:34:03 +00:00

Remove obsolete files, restructure

This commit is contained in:
Samuel Štancl 2020-05-21 15:54:35 +02:00
parent fbe43fbb04
commit 4f8d892481
20 changed files with 19 additions and 83 deletions

View file

@ -8,7 +8,7 @@ use Stancl\Tenancy\Database\Models\Tenant;
return [ return [
'tenant_model' => Tenant::class, 'tenant_model' => Tenant::class,
'internal_prefix' => 'tenancy_', 'internal_prefix' => 'tenancy_',
'id_generator' => Stancl\Tenancy\UniqueIDGenerators\UUIDGenerator::class, 'id_generator' => Stancl\Tenancy\UUIDGenerator::class,
'domain_model' => Domain::class, 'domain_model' => Domain::class,
'central_domains' => [ 'central_domains' => [

View file

@ -10,8 +10,8 @@ use Illuminate\Database\Migrations\Migrator;
use Stancl\Tenancy\Contracts\TenantWithDatabase; use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\DatabaseManager; use Stancl\Tenancy\DatabaseManager;
use Stancl\Tenancy\Events\DatabaseMigrated; use Stancl\Tenancy\Events\DatabaseMigrated;
use Stancl\Tenancy\Traits\DealsWithMigrations; use Stancl\Tenancy\Concerns\DealsWithMigrations;
use Stancl\Tenancy\Traits\HasATenantsOption; use Stancl\Tenancy\Concerns\HasATenantsOption;
class Migrate extends MigrateCommand class Migrate extends MigrateCommand
{ {

View file

@ -6,8 +6,8 @@ namespace Stancl\Tenancy\Commands;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Stancl\Tenancy\Contracts\TenantWithDatabase; use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Traits\DealsWithMigrations; use Stancl\Tenancy\Concerns\DealsWithMigrations;
use Stancl\Tenancy\Traits\HasATenantsOption; use Stancl\Tenancy\Concerns\HasATenantsOption;
final class MigrateFresh extends Command final class MigrateFresh extends Command
{ {

View file

@ -10,8 +10,8 @@ use Illuminate\Database\Migrations\Migrator;
use Stancl\Tenancy\Contracts\TenantWithDatabase; use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\DatabaseManager; use Stancl\Tenancy\DatabaseManager;
use Stancl\Tenancy\Events\DatabaseRolledBack; use Stancl\Tenancy\Events\DatabaseRolledBack;
use Stancl\Tenancy\Traits\DealsWithMigrations; use Stancl\Tenancy\Concerns\DealsWithMigrations;
use Stancl\Tenancy\Traits\HasATenantsOption; use Stancl\Tenancy\Concerns\HasATenantsOption;
class Rollback extends RollbackCommand class Rollback extends RollbackCommand
{ {

View file

@ -9,7 +9,7 @@ use Illuminate\Database\Console\Seeds\SeedCommand;
use Stancl\Tenancy\Contracts\TenantWithDatabase; use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\DatabaseManager; use Stancl\Tenancy\DatabaseManager;
use Stancl\Tenancy\Events\DatabaseSeeded; use Stancl\Tenancy\Events\DatabaseSeeded;
use Stancl\Tenancy\Traits\HasATenantsOption; use Stancl\Tenancy\Concerns\HasATenantsOption;
class Seed extends SeedCommand class Seed extends SeedCommand
{ {

View file

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Stancl\Tenancy\Traits; namespace Stancl\Tenancy\Concerns;
use Stancl\Tenancy\Contracts\TenantWithDatabase; use Stancl\Tenancy\Contracts\TenantWithDatabase;

View file

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Stancl\Tenancy\Traits; namespace Stancl\Tenancy\Concerns;
trait DealsWithMigrations trait DealsWithMigrations
{ {

View file

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Stancl\Tenancy\Traits; namespace Stancl\Tenancy\Concerns;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;

View file

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Stancl\Tenancy\Traits; namespace Stancl\Tenancy\Concerns;
use Illuminate\Support\LazyCollection; use Illuminate\Support\LazyCollection;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;

View file

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Stancl\Tenancy\Traits; namespace Stancl\Tenancy\Concerns;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;

View file

@ -1,15 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Exception;
class NotImplementedException extends Exception
{
public function __construct($class, $method, $extra)
{
parent::__construct("The $class class does not implement the $method method. $extra");
}
}

View file

@ -1,15 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Exception;
class TenantDoesNotExistException extends Exception
{
public function __construct(string $id, string $key = 'id')
{
$this->message = "Tenant with this $key does not exist: $id";
}
}

View file

@ -1,9 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
class TenantStorageException extends \Exception
{
}

View file

@ -1,25 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
class TenantWithThisIdAlreadyExistsException extends TenantCannotBeCreatedException
{
/** @var string */
protected $id;
public function reason(): string
{
return "Tenant with id {$this->id} already exists.";
}
public function __construct(string $id)
{
parent::__construct();
$this->id = $id;
}
}

View file

@ -95,7 +95,7 @@ class TenancyServiceProvider extends ServiceProvider
__DIR__ . '/../assets/TenancyServiceProvider.stub.php' => app_path('Providers/TenancyServiceProvider.php'), __DIR__ . '/../assets/TenancyServiceProvider.stub.php' => app_path('Providers/TenancyServiceProvider.php'),
], 'providers'); ], 'providers');
$this->loadRoutesFrom(__DIR__ . '/routes.php'); $this->loadRoutesFrom(__DIR__ . '/../assets/routes.php');
$this->app->singleton('globalUrl', function ($app) { $this->app->singleton('globalUrl', function ($app) {
if ($app->bound(FilesystemTenancyBootstrapper::class)) { if ($app->bound(FilesystemTenancyBootstrapper::class)) {

View file

@ -7,7 +7,7 @@ namespace Stancl\Tenancy\TenantDatabaseManagers;
use Stancl\Tenancy\Contracts\ManagesDatabaseUsers; use Stancl\Tenancy\Contracts\ManagesDatabaseUsers;
use Stancl\Tenancy\DatabaseConfig; use Stancl\Tenancy\DatabaseConfig;
use Stancl\Tenancy\Exceptions\TenantDatabaseUserAlreadyExistsException; use Stancl\Tenancy\Exceptions\TenantDatabaseUserAlreadyExistsException;
use Stancl\Tenancy\Traits\CreatesDatabaseUsers; use Stancl\Tenancy\Concerns\CreatesDatabaseUsers;
class PermissionControlledMySQLDatabaseManager extends MySQLDatabaseManager implements ManagesDatabaseUsers class PermissionControlledMySQLDatabaseManager extends MySQLDatabaseManager implements ManagesDatabaseUsers
{ {

View file

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Stancl\Tenancy\UniqueIDGenerators; namespace Stancl\Tenancy;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator; use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator;

View file

@ -6,8 +6,8 @@ namespace Stancl\Tenancy\Tests\Etc;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Stancl\Tenancy\Traits\HasATenantsOption; use Stancl\Tenancy\Concerns\HasATenantsOption;
use Stancl\Tenancy\Traits\TenantAwareCommand; use Stancl\Tenancy\Concerns\TenantAwareCommand;
class AddUserCommand extends Command class AddUserCommand extends Command
{ {

View file

@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Schema;
use Stancl\Tenancy\Tests\Etc\Tenant; use Stancl\Tenancy\Tests\Etc\Tenant;
use Stancl\Tenancy\Events\TenantCreated; use Stancl\Tenancy\Events\TenantCreated;
use Stancl\Tenancy\Tests\TestCase; use Stancl\Tenancy\Tests\TestCase;
use Stancl\Tenancy\UniqueIDGenerators\UUIDGenerator; use Stancl\Tenancy\UUIDGenerator;
use Stancl\Tenancy\Contracts; use Stancl\Tenancy\Contracts;
use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator; use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator;
use Stancl\Tenancy\Events\TenancyInitialized; use Stancl\Tenancy\Events\TenancyInitialized;