1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 00:14:04 +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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Stancl\Tenancy\Traits;
namespace Stancl\Tenancy\Concerns;
use Symfony\Component\Console\Input\InputInterface;
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'),
], 'providers');
$this->loadRoutesFrom(__DIR__ . '/routes.php');
$this->loadRoutesFrom(__DIR__ . '/../assets/routes.php');
$this->app->singleton('globalUrl', function ($app) {
if ($app->bound(FilesystemTenancyBootstrapper::class)) {

View file

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

View file

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

View file

@ -1,9 +0,0 @@
<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Route;
Route::get('/tenancy/assets/{path?}', 'Stancl\Tenancy\Controllers\TenantAssetsController@asset')
->where('path', '(.*)')
->name('stancl.tenancy.asset');