{"action":"created","issue":{"url":"https://api.github.com/repos/hyn/multi-tenant/issues/403","repository_url":"https://api.github.com/repos/hyn/multi-tenant","labels_url":"https://api.github.com/repos/hyn/multi-tenant/issues/403/labels{/name}","comments_url":"https://api.github.com/repos/hyn/multi-tenant/issues/403/comments","events_url":"https://api.github.com/repos/hyn/multi-tenant/issues/403/events","html_url":"https://github.com/hyn/multi-tenant/issues/403","id":308330354,"number":403,"title":"Can not create hostname","user":{"login":"RushabhJoshi","id":5484018,"avatar_url":"https://avatars1.githubusercontent.com/u/5484018?v=4","gravatar_id":"","url":"https://api.github.com/users/RushabhJoshi","html_url":"https://github.com/RushabhJoshi","followers_url":"https://api.github.com/users/RushabhJoshi/followers","following_url":"https://api.github.com/users/RushabhJoshi/following{/other_user}","gists_url":"https://api.github.com/users/RushabhJoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/RushabhJoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RushabhJoshi/subscriptions","organizations_url":"https://api.github.com/users/RushabhJoshi/orgs","repos_url":"https://api.github.com/users/RushabhJoshi/repos","events_url":"https://api.github.com/users/RushabhJoshi/events{/privacy}","received_events_url":"https://api.github.com/users/RushabhJoshi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-03-25T07:54:26Z","updated_at":"2018-04-06T07:05:01Z","closed_at":"2018-03-30T09:46:15Z","author_association":"NONE","body":"Earlier everything works perfectly but suddenly I am not able to create new tenant\r\nI also followed the documentation of [Full-featured app](https://laravel-tenancy.com/docs/hyn/5.x/full-featured-tutorial)\r\n\r\nMy sample code is\r\n```php\r\n$website = new \\Hyn\\Tenancy\\Models\\Website;\r\napp(\\Hyn\\Tenancy\\Repositories\\WebsiteRepository::class)->create($website);\r\n\r\n$hostname = new \\Hyn\\Tenancy\\Models\\Hostname;\r\n$hostname->fqdn = 'tenatname.localhost';\r\napp(\\Hyn\\Tenancy\\Repositories\\HostnameRepository::class)->attach($hostname, $website);\r\n```\r\n..\r\n\r\n---\r\n\r\n- hyn/multi-tenant version: 5.0.17\r\n- laravel version:v5.5.32\r\n- database driver and version:MySQL version: 5.7.21-0ubuntu0.16.04.1\r\n- webserver software and version:Apache2\r\n- php version:PHP 7.1.15-1+ubuntu16.04.1+deb.sury.org+2 \r\n\r\n---\r\n\r\n__tenancy.php config__\r\n\r\n```php\r\n<?php\r\n\r\n/*\r\n * This file is part of the hyn/multi-tenant package.\r\n *\r\n * (c) Daniël Klabbers <daniel@klabbers.email>\r\n *\r\n * For the full copyright and license information, please view the LICENSE\r\n * file that was distributed with this source code.\r\n *\r\n * @see https://laravel-tenancy.com\r\n * @see https://github.com/hyn/multi-tenant\r\n */\r\n\r\nuse Hyn\\Tenancy\\Database\\Connection;\r\n\r\nreturn [\r\n    'models' => [\r\n        /**\r\n         * Specify different models to be used for the global, system database\r\n         * connection. These are also used in their relationships. Models\r\n         * used have to implement their respective contracts and\r\n         * either extend the SystemModel or use the trait\r\n         * UsesSystemConnection.\r\n         */\r\n\r\n        // Must implement \\Hyn\\Tenancy\\Contracts\\Customer\r\n        'customer' => \\Hyn\\Tenancy\\Models\\Customer::class,\r\n\r\n        // Must implement \\Hyn\\Tenancy\\Contracts\\Hostname\r\n        'hostname' => \\Hyn\\Tenancy\\Models\\Hostname::class,\r\n\r\n        // Must implement \\Hyn\\Tenancy\\Contracts\\Website\r\n        'website' => \\Hyn\\Tenancy\\Models\\Website::class\r\n    ],\r\n    'website' => [\r\n        /**\r\n         * Each website has a short random hash that identifies this entity\r\n         * to the application. By default this id is randomized and fully\r\n         * auto-generated. In case you want to force your own logic for\r\n         * when you need to have a better overview of the complete\r\n         * tenant folder structure, disable this and implement\r\n         * your own id generation logic.\r\n         */\r\n        'disable-random-id' => false,\r\n\r\n        /**\r\n         * The random Id generator is responsible for creating the hash as mentioned\r\n         * above. You can override what generator to use by modifying this value\r\n         * in the configuration.\r\n         *\r\n         * @warn This won't work if disable-random-id is true.\r\n         */\r\n        'random-id-generator' => Hyn\\Tenancy\\Generators\\Uuid\\ShaGenerator::class,\r\n\r\n        /**\r\n         * Enable this flag in case you're using a driver that does not support\r\n         * database username or database name with a length of more than 32 characters.\r\n         *\r\n         * This should be enabled for MySQL, but not for MariaDB and PostgreSQL.\r\n         */\r\n        'uuid-limit-length-to-32' => env('LIMIT_UUID_LENGTH_32', false),\r\n\r\n        /**\r\n         * Specify the disk you configured in the filesystems.php file where to store\r\n         * the tenant specific files, including media, packages, routes and other\r\n         * files for this particular website.\r\n         *\r\n         * @info If not set, will revert to the default filesystem.\r\n         */\r\n        'disk' => null,\r\n\r\n        /**\r\n         * Automatically generate a tenant directory based on the random id of the\r\n         * website. Uses the above disk to store files to override system-wide\r\n         * files.\r\n         *\r\n         * @info set to false to disable.\r\n         */\r\n        'auto-create-tenant-directory' => true,\r\n\r\n        /**\r\n         * Automatically rename the tenant directory when the random id of the\r\n         * website changes. This should not be too common, but in case it happens\r\n         * we automatically want to move files accordingly.\r\n         *\r\n         * @info set to false to disable.\r\n         */\r\n        'auto-rename-tenant-directory' => true,\r\n\r\n        /**\r\n         * Automatically deletes the tenant specific directory and all files\r\n         * contained within.\r\n         *\r\n         * @see\r\n         * @info set to true to enable.\r\n         */\r\n        'auto-delete-tenant-directory' => env('AUTO_DELETE_TENANT_DIRECTORY', false),\r\n\r\n        /**\r\n         * Time to cache websites in minutes. Set to false to disable.\r\n         */\r\n        'cache' => 10,\r\n    ],\r\n    'hostname' => [\r\n        /**\r\n         * If you want the multi tenant application to fall back to a default\r\n         * hostname/website in case the requested hostname was not found\r\n         * in the database, complete in detail the default hostname.\r\n         *\r\n         * @warn this must be a FQDN, these have no protocol or path!\r\n         */\r\n        'default' => env('TENANCY_DEFAULT_HOSTNAME'),\r\n        /**\r\n         * The package is able to identify the requested hostname by itself,\r\n         * disable to get full control (and responsibility) over hostname\r\n         * identification. The hostname identification is needed to\r\n         * set a specific website as currently active.\r\n         *\r\n         * @see src/Jobs/HostnameIdentification.php\r\n         */\r\n        'auto-identification' => env('TENANCY_AUTO_HOSTNAME_IDENTIFICATION', true),\r\n\r\n        /**\r\n         * In case you want to have the tenancy environment set up early,\r\n         * enable this flag. This will run the tenant identification\r\n         * inside a middleware. This will eager load tenancy.\r\n         *\r\n         * A good use case is when you have set \"tenant\" as the default\r\n         * database connection.\r\n         */\r\n        'early-identification' => env('TENANCY_EARLY_IDENTIFICATION', false),\r\n\r\n        /**\r\n         * Abort application execution in case no hostname was identified. This will throw a\r\n         * 404 not found in case the tenant hostname was not resolved.\r\n         *\r\n         * @see https://hyn.readme.io/v3.0/docs/tenancy#section-hostnameabort-without-identified-hostname\r\n         */\r\n        'abort-without-identified-hostname' => true,\r\n\r\n        /**\r\n         * Time to cache hostnames in minutes. Set to false to disable.\r\n         */\r\n        'cache' => 10,\r\n    ],\r\n    'db' => [\r\n        /**\r\n         * The default connection to use; this overrules the Laravel database.default\r\n         * configuration setting. In Laravel this is normally configured to 'mysql'.\r\n         * You can set a environment variable to override the default database\r\n         * connection to - for instance - the tenant connection 'tenant'.\r\n         *\r\n         * @see https://hyn.readme.io/v3.0/docs/tenancy#section-dbdefault\r\n         */\r\n        'default' => env('TENANCY_DEFAULT_CONNECTION'),\r\n        /**\r\n         * Used to give names to the system and tenant database connections. By\r\n         * default we configure 'system' and 'tenant'. The tenant connection\r\n         * is set up automatically by this package.\r\n         *\r\n         * @see src/Database/Connection.php\r\n         * @var system-connection-name The database connection name to use for the global/system database.\r\n         * @var tenant-connection-name The database connection name to use for the tenant database.\r\n         */\r\n        'system-connection-name' => env('TENANCY_SYSTEM_CONNECTION_NAME', Connection::DEFAULT_SYSTEM_NAME),\r\n        'tenant-connection-name' => env('TENANCY_TENANT_CONNECTION_NAME', Connection::DEFAULT_TENANT_NAME),\r\n\r\n        /**\r\n         * The tenant division mode specifies to what database websites will be\r\n         * connecting. The default setup is to use a new database per tenant.\r\n         * In case you prefer to use the same database with a table prefix,\r\n         * set the mode to 'prefix'.\r\n         *\r\n         * @see src/Database/Connection.php\r\n         */\r\n        'tenant-division-mode' => env('TENANCY_DATABASE_DIVISION_MODE', 'database'),\r\n\r\n        /**\r\n         * The database password generator takes care of creating a valid hashed\r\n         * string used for tenants to connect to the specific database. Do\r\n         * note that this will only work in 'division modes' that set up\r\n         * a connection to a separate database.\r\n         */\r\n        'password-generator' => Hyn\\Tenancy\\Generators\\Database\\DefaultPasswordGenerator::class,\r\n\r\n        /**\r\n         * The tenant migrations to be run during creation of a tenant. Specify a directory\r\n         * to run the migrations from. If specified these migrations will be executed\r\n         * whenever a new tenant is created.\r\n         *\r\n         * @info set to false to disable auto migrating.\r\n         *\r\n         * @warn this has to be an absolute path, feel free to use helper methods like\r\n         * base_path() or database_path() to set this up.\r\n         */\r\n        'tenant-migrations-path' => database_path('migrations/tenant'),\r\n\r\n        /**\r\n         * Seeds the newly created tenant database based on this Seeder.\r\n         *\r\n         * @info requires tenant-migrations-path to be in use.\r\n         *\r\n         * @warn specify a valid fully qualified class name.\r\n         * @example App\\Seeders\\AdminSeeder::class\r\n         */\r\n        'tenant-seed-class' => TenantDatabaseSeeder::class,\r\n\r\n        /**\r\n         * Automatically generate a tenant database based on the random id of the\r\n         * website.\r\n         *\r\n         * @info set to false to disable.\r\n         */\r\n        'auto-create-tenant-database' => true,\r\n\r\n        /**\r\n         * Automatically rename the tenant database when the random id of the\r\n         * website changes. This should not be too common, but in case it happens\r\n         * we automatically want to move databases accordingly.\r\n         *\r\n         * @info set to false to disable.\r\n         */\r\n        'auto-rename-tenant-database' => true,\r\n\r\n        /**\r\n         * Automatically deletes the tenant specific database and all data\r\n         * contained within.\r\n         *\r\n         * @info set to true to enable.\r\n         */\r\n        'auto-delete-tenant-database' => env('AUTO_DELETE_TENANT_DATABASE', false),\r\n    ],\r\n    'folders' => [\r\n        'config' => [\r\n            /**\r\n             * Merge configuration files from the config directory\r\n             * inside the tenant directory with the global configuration files.\r\n             */\r\n            'enabled' => true,\r\n\r\n            /**\r\n             * List of configuration files to ignore, preventing override of crucial\r\n             * application configurations.\r\n             */\r\n            'blacklist' => ['database', 'tenancy', 'webserver'],\r\n        ],\r\n        'routes' => [\r\n            /**\r\n             * Allows adding and overriding URL routes inside the tenant directory.\r\n             */\r\n            'enabled' => true,\r\n\r\n            /**\r\n             * Prefix all tenant routes.\r\n             */\r\n            'prefix' => null,\r\n        ],\r\n        'trans' => [\r\n            /**\r\n             * Allows reading translation files from a trans directory inside\r\n             * the tenant directory.\r\n             */\r\n            'enabled' => true,\r\n\r\n            /**\r\n             * Will override the global translations with the tenant translations.\r\n             * This is done by overriding the laravel default translator with the new path.\r\n             */\r\n            'override-global' => true,\r\n\r\n            /**\r\n             * In case you disabled global override, specify a namespace here to load the\r\n             * tenant translation files with.\r\n             */\r\n            'namespace' => 'tenant',\r\n        ],\r\n        'vendor' => [\r\n            /**\r\n             * Allows using a custom vendor (composer driven) folder inside\r\n             * the tenant directory.\r\n             */\r\n            'enabled' => true,\r\n        ],\r\n        'media' => [\r\n            /**\r\n             * Mounts the assets directory with (static) files for public use.\r\n             */\r\n            'enabled' => true,\r\n        ]\r\n    ]\r\n];\r\n\r\n```\r\n\r\n__webserver.php config__\r\n\r\n```php\r\n<?php\r\n\r\n/*\r\n * This file is part of the hyn/multi-tenant package.\r\n *\r\n * (c) Daniël Klabbers <daniel@klabbers.email>\r\n *\r\n * For the full copyright and license information, please view the LICENSE\r\n * file that was distributed with this source code.\r\n *\r\n * @see https://laravel-tenancy.com\r\n * @see https://github.com/hyn/multi-tenant\r\n */\r\n\r\nreturn [\r\n\r\n    /**\r\n     * Let's Encrypt free SSL certificates for automatic https links of your tenant websites.\r\n     *\r\n     * @see http://www.letsencrypt.org\r\n     */\r\n    'lets-encrypt' => [\r\n        /**\r\n         * Whether Let's Encrypt is actively used to manage the SSL certificates of this domain.\r\n         *\r\n         * @info The Let's Encrypt is a non-terminal, pure PHP implementation.\r\n         */\r\n        'enabled' => true,\r\n    ],\r\n\r\n    /**\r\n     * Apache2 is one of the most widely adopted webserver packages available.\r\n     *\r\n     * @see http://httpd.apache.org/docs/\r\n     * @see https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu\r\n     */\r\n    'apache2' => [\r\n        /**\r\n         * Whether the integration with Apache2 is currently active.\r\n         *\r\n         * @see\r\n         */\r\n        'enabled' => false,\r\n\r\n        /**\r\n         * Define the ports of your Apache service.\r\n         */\r\n        'ports' => [\r\n            /**\r\n             * HTTP, non-SSL port.\r\n             *\r\n             * @default 80\r\n             */\r\n            'http' => 80,\r\n            /**\r\n             * HTTPS, SSL port.\r\n             *\r\n             * @default 443\r\n             */\r\n            'https' => 443\r\n        ],\r\n\r\n        /**\r\n         * The generator taking care of hooking into the Apache services and files.\r\n         */\r\n        'generator' => \\Hyn\\Tenancy\\Generators\\Webserver\\Vhost\\ApacheGenerator::class,\r\n\r\n        /**\r\n         * Specify the disk you configured in the filesystems.php file where to store\r\n         * the tenant vhost configuration files.\r\n         *\r\n         * @see\r\n         * @info If not set, will revert to the default filesystem.\r\n         */\r\n        'disk' => null,\r\n\r\n        'paths' => [\r\n\r\n            /**\r\n             * Location where vhost configuration files can be found.\r\n             *\r\n             * @see https://hyn.readme.io/v3.0/docs/webserverphp#section-apachepathsvhost-files\r\n             */\r\n            'vhost-files' => [\r\n                '/etc/apache2/sites-enabled/'\r\n            ],\r\n\r\n            'actions' => [\r\n                'exists' => '/etc/init.d/apache2',\r\n                'test-config' => 'apache2ctl -t',\r\n                'reload' => 'apache2ctl graceful'\r\n            ]\r\n        ]\r\n    ]\r\n];\r\n\r\n```\r\n\r\n---\r\n\r\n__Error log__\r\n\r\n```text\r\n SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd69c511cbc3a41acb6b8a910ee685081.hostnames' doesn't exist (SQL: insert into `hostnames  \r\n  ` (`fqdn`, `website_id`, `updated_at`, `created_at`) values (tenatname.localhost, 2, 2018-03-25 07:53:07, 2018-03-25 07:53:07))     \r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/hyn/multi-tenant/issues/comments/379167086","html_url":"https://github.com/hyn/multi-tenant/issues/403#issuecomment-379167086","issue_url":"https://api.github.com/repos/hyn/multi-tenant/issues/403","id":379167086,"user":{"login":"RushabhJoshi","id":5484018,"avatar_url":"https://avatars1.githubusercontent.com/u/5484018?v=4","gravatar_id":"","url":"https://api.github.com/users/RushabhJoshi","html_url":"https://github.com/RushabhJoshi","followers_url":"https://api.github.com/users/RushabhJoshi/followers","following_url":"https://api.github.com/users/RushabhJoshi/following{/other_user}","gists_url":"https://api.github.com/users/RushabhJoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/RushabhJoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RushabhJoshi/subscriptions","organizations_url":"https://api.github.com/users/RushabhJoshi/orgs","repos_url":"https://api.github.com/users/RushabhJoshi/repos","events_url":"https://api.github.com/users/RushabhJoshi/events{/privacy}","received_events_url":"https://api.github.com/users/RushabhJoshi/received_events","type":"User","site_admin":false},"created_at":"2018-04-06T07:05:01Z","updated_at":"2018-04-06T07:05:01Z","author_association":"NONE","body":"Hello @luceos ,\r\n\r\nI have updated the laravel version and package\r\nstill having the same error\r\n"}}
{"actor":{"display_login":"RushabhJoshi"}}