master redirect
1
dist/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
docs/
|
||||||
432
dist/docs/1.x/application-testing/index.html
vendored
|
|
@ -1,432 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Application Testing with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Application Testing | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Application Testing with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/application-testing"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Application Testing | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="application-testing">Application Testing</h1>
|
|
||||||
<p>To test your application with this package installed, you can create tenants in the <code>setUp()</code> method of your test case:</p>
|
|
||||||
<pre><code class="language-php">protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
tenant()->create('test.localhost');
|
|
||||||
tenancy()->init('test.localhost');
|
|
||||||
}</code></pre>
|
|
||||||
<p>If you're using the database storage driver, you will also need to run the <code>create_tenants_table</code> migration:</p>
|
|
||||||
<pre><code class="language-php">protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
$this->call('migrate', [
|
|
||||||
'--path' => database_path('migrations'),
|
|
||||||
'--database' => 'sqlite',
|
|
||||||
]);
|
|
||||||
|
|
||||||
tenant()->create('test.localhost');
|
|
||||||
tenancy()->init('test.localhost');
|
|
||||||
}</code></pre>
|
|
||||||
<p>If you're using the Redis storage driver, flush the database in <code>setUp()</code>:</p>
|
|
||||||
<pre><code class="language-php">protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
// make sure you're using a different connection for testing to avoid losing data
|
|
||||||
Redis::connection('tenancyTesting')->flushdb();
|
|
||||||
|
|
||||||
tenant()->create('test.localhost');
|
|
||||||
tenancy()->init('test.localhost');
|
|
||||||
}</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
431
dist/docs/1.x/configuration/index.html
vendored
|
|
@ -1,431 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Configuring stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Configuration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Configuring stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/configuration"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Configuration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="configuration">Configuration</h1>
|
|
||||||
<p>The <code>config/tenancy.php</code> file lets you configure how the package behaves.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p><strong>Note:</strong> If the <code>tenancy.php</code> file doesn't exist in your <code>config</code> directory, you can publish it by running <code>php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=config</code></p>
|
|
||||||
</blockquote>
|
|
||||||
<h3 id="storage"><code>storage_driver, storage</code></h3>
|
|
||||||
<p>This lets you configure the driver for tenant storage, i.e. what will be used to store information about your tenants. You can read more about this on the <a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers">Storage Drivers</a> page.</p>
|
|
||||||
<p>Available storage drivers:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>Stancl\Tenancy\StorageDrivers\RedisStorageDriver</code></li>
|
|
||||||
<li><code>Stancl\Tenancy\StorageDrivers\DatabaseStorageDriver</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="tenant-route-namespace"><code>tenant_route_namespace</code></h3>
|
|
||||||
<p>Controller namespace used for routes in <code>routes/tenant.php</code>. The default value is the same as the namespace for <code>web.php</code> routes.</p>
|
|
||||||
<h3 id="exempt-domains"><code>exempt_domains</code></h3>
|
|
||||||
<p>If a hostname from this array is visited, the <code>tenant.php</code> routes won't be registered, letting you use the same routes as in that file.</p>
|
|
||||||
<h3 id="database"><code>database</code></h3>
|
|
||||||
<p>The application's default connection will be switched to a new one — <code>tenant</code>. This connection will be based on the connection specified in <code>tenancy.database.based_on</code>. The database name will be <code>tenancy.database.prefix + tenant UUID + tenancy.database.suffix</code>.</p>
|
|
||||||
<p>You can set the suffix to <code>.sqlite</code> if you're using sqlite and want the files to be with the <code>.sqlite</code> extension. Conversely, you can leave the suffix empty if you're using MySQL, for example.</p>
|
|
||||||
<h3 id="redis"><code>redis</code></h3>
|
|
||||||
<p>If <code>tenancy.redis.tenancy</code> is set to true, connections listed in <code>tenancy.redis.prefixed_connections</code> will be prefixed with <code>config('tenancy.redis.prefix_base') . $uuid</code>.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: You need phpredis for multi-tenant Redis.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h3 id="cache"><code>cache</code></h3>
|
|
||||||
<p>The <code>CacheManager</code> instance that's resolved when you use the <code>Cache</code> or the <code>cache()</code> helper will be replaced by <code>Stancl\Tenancy\CacheManager</code>. This class automatically uses <a href="https://laravel.com/docs/master/cache#cache-tags">tags</a>. The tag will look like <code>config('tenancy.cache.tag_base') . $uuid</code>.</p>
|
|
||||||
<p>If you need to store something in global, non-tenant cache, </p>
|
|
||||||
<h3 id="filesystem"><code>filesystem</code></h3>
|
|
||||||
<p>The <code>storage_path()</code> will be suffixed with a directory named <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p>The root of each disk listed in <code>tenancy.filesystem.disks</code> will be suffixed with <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p>For disks listed in <code>root_override</code>, the root will be that string with <code>%storage_path%</code> replaced by <code>storage_path()</code> <em>after</em> tenancy has been initialized. All other disks will be simply suffixed with <code>tenancy.filesystem.suffix_base</code> + the tenant UUID.</p>
|
|
||||||
<p>Read more about this on the <a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy">Filesystem Tenancy</a> page.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
433
dist/docs/1.x/console-commands/index.html
vendored
|
|
@ -1,433 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Console commands with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Console Commands | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Console commands with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/console-commands"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Console Commands | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="console-commands">Console Commands</h1>
|
|
||||||
<p>The package comes with some artisan commands that will help you during development.</p>
|
|
||||||
<h2 id="migrate">Migrate</h2>
|
|
||||||
<p>The most important command. To use tenants, you have to be able to migrate their databases.</p>
|
|
||||||
<p>You can use the <code>tenants:migrate</code> command to migrate tenant's databases. You can also specify which tenants' databases should be migrated using the <code>--tenants</code> option.</p>
|
|
||||||
<pre><code>php artisan tenants:migrate --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: Tenant migrations must be located in <code>database/migrations/tenant</code>.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>You can use these commands outside the command line as well. If you want to migrate a tenant's database in a controller, you can use the <code>Artisan</code> facade.</p>
|
|
||||||
<pre><code class="language-php">$tenant = tenant()->create('tenant1.localhost');
|
|
||||||
|
|
||||||
\Artisan::call('tenants:migrate', [
|
|
||||||
'--tenants' => [$tenant['uuid']]
|
|
||||||
]);</code></pre>
|
|
||||||
<h2 id="rollback">Rollback & seed</h2>
|
|
||||||
<ul>
|
|
||||||
<li>Rollback: <code>tenants:rollback</code></li>
|
|
||||||
<li>Seed: <code>tenants:seed</code></li>
|
|
||||||
</ul>
|
|
||||||
<p>Similarly to <a href="#migrate">migrate</a>, these commands accept a <code>--tenants</code> option.</p>
|
|
||||||
<h2 id="run">Run</h2>
|
|
||||||
<p>You can use the tenants:run command to run your own commands for tenants.</p>
|
|
||||||
<p>If your command's signature were <code>email:send {--queue} {--subject=} {body}</code>, you would run this command like this:</p>
|
|
||||||
<pre><code>php artisan tenants:run email:send --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23 --option="queue=1" --option="subject=New Feature" --argument="body=We have launched a new feature. ..."</code></pre>
|
|
||||||
<h2 id="tenant-list">Tenant list</h2>
|
|
||||||
<pre><code class="language-none">php artisan tenants:list
|
|
||||||
Listing all tenants.
|
|
||||||
[Tenant] uuid: dbe0b330-1a6e-11e9-b4c3-354da4b4f339 @ localhost
|
|
||||||
[Tenant] uuid: 49670df0-1a87-11e9-b7ba-cf5353777957 @ dev.localhost</code></pre>
|
|
||||||
<h2 id="selectively-clearing-tenant-cache">Selectively clearing tenant cache</h2>
|
|
||||||
<p>You can delete specific tenants' cache by using the <code>--tags</code> option on <code>cache:clear</code>:</p>
|
|
||||||
<pre><code>php artisan cache:clear --tags=tenantdbe0b330-1a6e-11e9-b4c3-354da4b4f339</code></pre>
|
|
||||||
<p>The tag is <code>config('tenancy.cache.tag_base') . $uuid</code>.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
416
dist/docs/1.x/creating-tenants/index.html
vendored
|
|
@ -1,416 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Creating tenants with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Creating Tenants | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Creating tenants with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Creating Tenants | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="creating-tenants">Creating Tenants</h1>
|
|
||||||
<blockquote>
|
|
||||||
<p><strong>Make sure your database is correctly <a href="https://tenancy.samuelstancl.me/docs/1.x/configuration/#database">configured</a> before creating tenants.</strong></p>
|
|
||||||
</blockquote>
|
|
||||||
<p>To create a tenant, you can use</p>
|
|
||||||
<pre><code class="language-php">tenant()->create('tenant1.yourapp.com');</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>Tip: All domains under <code>.localhost</code> are routed to 127.0.0.1 on most operating systems. This is useful for development.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>If you want to set some data while creating the tenant, you can pass an array with the data as the second argument:</p>
|
|
||||||
<pre><code class="language-php">tenant()->create('tenant2.yourapp.com', [
|
|
||||||
'plan' => 'free'
|
|
||||||
]);</code></pre>
|
|
||||||
<p>The <code>create</code> method returns an array with tenant information (<code>uuid</code>, <code>domain</code> and whatever else you supplied).</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: Creating a tenant doesn't run <a href="https://stancl-tenancy.netlify.com/docs/console-commands/#migrate">migrations</a> automatically. You have to do that yourself.</p>
|
|
||||||
</blockquote> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
409
dist/docs/1.x/custom-database-names/index.html
vendored
|
|
@ -1,409 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Custom Database Names with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Custom Database Names | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Custom Database Names with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Custom Database Names | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="custom-database-names">Custom Database Names</h1>
|
|
||||||
<p>If you want to specify the tenant's database name, set the <code>tenancy.database_name_key</code> configuration key to the name of the key that is used to specify the database name in the tenant storage. You must use a name that you won't use for storing other data, so it's recommended to avoid names like <code>database</code> and use names like <code>_stancl_tenancy_database_name</code> instead. Then just give the key a value during the tenant creation process:</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->create('example.com', [
|
|
||||||
'_stancl_tenancy_database_name' => 'example_com'
|
|
||||||
])
|
|
||||||
=> [
|
|
||||||
"uuid" => "49670df0-1a87-11e9-b7ba-cf5353777957",
|
|
||||||
"domain" => "example.com",
|
|
||||||
"_stancl_tenancy_database_name" => "example_com",
|
|
||||||
]</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
406
dist/docs/1.x/development/index.html
vendored
|
|
@ -1,406 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Development | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Development | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Development | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/development"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Development | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="development">Development</h1>
|
|
||||||
<h2 id="running-tests">Running tests</h2>
|
|
||||||
<h3 id="with-docker">With Docker</h3>
|
|
||||||
<p>If you have Docker installed, simply run ./test. When you're done testing, run docker-compose down to shut down the containers.</p>
|
|
||||||
<h3 id="without-docker">Without Docker</h3>
|
|
||||||
<p>If you run the tests of this package, please make sure you don't store anything in Redis @ 127.0.0.1:6379 db#14. The contents of this database are flushed everytime the tests are run.</p>
|
|
||||||
<p>Some tests are run only if the CI, TRAVIS and CONTINUOUS_INTEGRATION environment variables are set to true. This is to avoid things like bloating your MySQL instance with test databases.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Difference Between This Package And Others | with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Difference Between This Package And Others | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Difference Between This Package And Others | with stancl/tenancy — A Laravel multi-database tenancy package that respects your code."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Difference Between This Package And Others | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Difference Between This Package And Others</h1>
|
|
||||||
<p>A frequently asked question is the difference between this package and <a href="https://github.com/tenancy/multi-tenant">tenancy/multi-tenant</a>.</p>
|
|
||||||
<p>Packages like tenancy/multi-tenant and tenancy/tenancy give you an API for making your application multi-tenant. They give you a tenant DB connection, traits to apply on your models, a guide on creating your own tenant-aware cache, etc.</p>
|
|
||||||
<p>This package makes your application multi-tenant automatically and attempts to make you not have to change (m)any things in your code.</p>
|
|
||||||
<h2>Which one should you use?</h2>
|
|
||||||
<p>Depends on what you prefer.</p>
|
|
||||||
<p>If you want full control and make your application multi-tenant yourself, use tenancy/multi-tenant.</p>
|
|
||||||
<p>If you want to focus on writing your application instead of tenancy implementations, use stancl/tenancy.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
400
dist/docs/1.x/digging-deeper/index.html
vendored
|
|
@ -1,400 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Digging Deeper | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Digging Deeper | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Digging Deeper | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Digging Deeper | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="digging-deeper">Digging Deeper</h1> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
431
dist/docs/1.x/event-system/index.html
vendored
|
|
@ -1,431 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="The Event System | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="The Event System | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="The Event System | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/event-system"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>The Event System | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>The Event System</h1>
|
|
||||||
<p>You can use event hooks to change the behavior of the tenancy boostrapping and tenancy ending processes.</p>
|
|
||||||
<p>The following events are available:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>boostrapping</code></li>
|
|
||||||
<li><code>boostrapped</code></li>
|
|
||||||
<li><code>ending</code></li>
|
|
||||||
<li><code>ended</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="tenant-specific-database-connection-example">Tenant-specific database connection example</h3>
|
|
||||||
<p>You can hook into these events using <code>Tenancy::<eventName></code>:</p>
|
|
||||||
<pre><code class="language-php">\Tenancy::boostrapping(function ($tenantManager) {
|
|
||||||
if ($tenantManager->tenant['uuid'] === 'someUUID') {
|
|
||||||
config(['database.connections.someDatabaseConnection' => $tenantManager->tenant['databaseConnection']]);
|
|
||||||
$tenantManager->database->useConnection('someDatabaseConnection');
|
|
||||||
|
|
||||||
return ['database'];
|
|
||||||
}
|
|
||||||
});</code></pre>
|
|
||||||
<p>The example above checks whether the current tenant has an uuid of <code>someUUID</code>. If yes, it creates a new database connection based on data stored in the tenant's storage. Then it changes the default database connection. Finally, it returns an array of the events that this callback prevents.</p>
|
|
||||||
<p>The following actions can be prevented:</p>
|
|
||||||
<ul>
|
|
||||||
<li>database connection switch: <code>database</code></li>
|
|
||||||
<li>Redis prefix: <code>redis</code></li>
|
|
||||||
<li>CacheManager switch: <code>cache</code></li>
|
|
||||||
<li>Filesystem changes: <code>filesystem</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="tenant-specific-configuration-example">Tenant-specific configuration example</h3>
|
|
||||||
<p>Another common use case for events is tenant-specific config:</p>
|
|
||||||
<pre><code class="language-php">\Tenancy::bootstrapped(function ($tenantManager) {
|
|
||||||
config(['some.api.key' => $tenantManager->tenant['api_key']);
|
|
||||||
});</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
423
dist/docs/1.x/filesystem-tenancy/index.html
vendored
|
|
@ -1,423 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Filesystem Tenancy with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Filesystem Tenancy | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Filesystem Tenancy with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Filesystem Tenancy | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="filesystem-tenancy">Filesystem Tenancy</h1>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: It's important to differentiate between storage_path() and the Storage facade. The Storage facade is what you use to put files into storage, i.e. <code>Storage::disk('local')->put()</code>. <code>storage_path()</code> is used to get the path to the storage directory.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>The <code>storage_path()</code> will be suffixed with a directory named <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p>The root of each disk listed in <code>tenancy.filesystem.disks</code> will be suffixed with <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p><strong>However, this alone would cause unwanted behavior.</strong> It would work for S3 and similar disks, but for local disks, this would result in <code>/path_to_your_application/storage/app/tenant1e22e620-1cb8-11e9-93b6-8d1b78ac0bcd/</code>. That's not what we want. We want <code>/path_to_your_application/storage/tenant1e22e620-1cb8-11e9-93b6-8d1b78ac0bcd/app/</code>.</p>
|
|
||||||
<p>That's what the <code>root_override</code> section is for. <code>%storage_path%</code> gets replaced by <code>storage_path()</code> <em>after</em> tenancy has been initialized. The roots of disks listed in the <code>root_override</code> section of the config will be replaced accordingly. All other disks will be simply suffixed with <code>tenancy.filesystem.suffix_base</code> + the tenant UUID.</p>
|
|
||||||
<p>Since <code>storage_path()</code> will be suffixed, your folder structure will look like this:</p>
|
|
||||||
<p><img src="https://i.imgur.com/GAXQOnN.png" alt="The folder structure" /></p>
|
|
||||||
<p>If you write to these directories, you will need to create them after you create the tenant. See the docs for <a href="http://php.net/function.mkdir">PHP's mkdir</a>.</p>
|
|
||||||
<p>Logs will be saved to <code>storage/logs</code> regardless of any changes to <code>storage_path()</code>.</p>
|
|
||||||
<p>One thing that you <strong>will</strong> have to change if you use storage similarly to the example on the image is your use of the helper function <code>asset()</code> (that is, if you use it).</p>
|
|
||||||
<p>You need to make this change to your code:</p>
|
|
||||||
<pre><code class="language-diff">- asset("storage/images/products/$product_id.png");
|
|
||||||
+ tenant_asset("images/products/$product_id.png");</code></pre>
|
|
||||||
<p>Note that all (public) tenant assets have to be in the <code>app/public/</code> subdirectory of the tenant's storage directory, as shown in the image above.</p>
|
|
||||||
<p>This is what the backend of <code>tenant_asset()</code> returns:</p>
|
|
||||||
<pre><code class="language-php">// TenantAssetsController
|
|
||||||
return response()->file(storage_path('app/public/' . $path));</code></pre>
|
|
||||||
<p>With default filesystem configuration, these two commands are equivalent:</p>
|
|
||||||
<pre><code class="language-php">Storage::disk('public')->put($filename, $data);
|
|
||||||
Storage::disk('local')->put("public/$filename", $data);</code></pre>
|
|
||||||
<p>If you want to store something globally, simply create a new disk and <em>don't</em> add it to the <code>tenancy.filesystem.disks</code> config.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
422
dist/docs/1.x/getting-started/index.html
vendored
|
|
@ -1,422 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Getting started with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Getting Started | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Getting started with stancl/tenancy — A Laravel multi-database tenancy package that respects your code."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/getting-started"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Getting Started | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="getting-started">Getting Started</h1>
|
|
||||||
<p><a href="https://github.com/stancl/tenancy"><strong>stancl/tenancy</strong></a> is a Laravel multi-database tenancy package. It is designed in a way that requires you to make no changes to your codebase. Instead of applying traits on models and replacing every single reference to cache by a reference to a tenant-aware cache, the package lets you write your app without thinking about tenancy. It handles tenancy automatically.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: Filesystem is the only thing that can be a little problematic. Be sure to read <a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy">that page</a>.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h2 id="how-does-it-work">How does it work?</h2>
|
|
||||||
<p>A user visits <code>client1.yourapp.com</code>. The package identifies the tenant who this domain belongs to, and automatically does the following:</p>
|
|
||||||
<ul>
|
|
||||||
<li>switches database connection</li>
|
|
||||||
<li>replaces the default cache manager</li>
|
|
||||||
<li>switches Redis connection</li>
|
|
||||||
<li>changes filesystem root paths</li>
|
|
||||||
</ul>
|
|
||||||
<p>The benefits of this being taken care of by the package are:</p>
|
|
||||||
<ul>
|
|
||||||
<li>separation of concerns: you should write your app, not tenancy implementations</li>
|
|
||||||
<li>reliability: you won't have to fear that you forgot to replace a reference to cache by a tenant-aware cache call. This is something you might worry about if you're implementing tenancy into an existing application.</li>
|
|
||||||
</ul>
|
|
||||||
<h2 id="what-is-multi-tenancy">What is multi-tenancy?</h2>
|
|
||||||
<p>Multi-tenancy is the ability to provide your application to multiple customers (who have their own users and other resources) from a single instance of your application. Think Slack, Shopify, etc.</p>
|
|
||||||
<p>Multi-tenancy can be single-database and multi-database.</p>
|
|
||||||
<p><strong>Single-database tenancy</strong> means that your application uses only a single database. The way this is usually implemented is that instead of having the <code>id</code>, <code>title</code>, <code>user_id</code> and <code>body</code> columns in your <code>posts</code> table, you will also have a <code>tenant_id</code> column. This approach works until you need custom databases for your clients. It's also easy to implement, it basically boils down to having your models use a trait which adds a <a href="https://laravel.com/docs/master/eloquent#global-scopes">global scope</a>.</p>
|
|
||||||
<p><strong>Multi-database tenancy</strong>, the type that this package provides, lets you use a separate database for each tenant. The benefits of this approach are scalability, compliance (some clients need to have the database on their server) and mitigation of risks such as showing the wrong tenant's data to a user. The downside is that this model is harder to implement, which is why this package exists.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
407
dist/docs/1.x/horizon/index.html
vendored
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Horizon Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Horizon Integration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Horizon Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/horizon"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Horizon Integration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Horizon Integration</h1>
|
|
||||||
<blockquote>
|
|
||||||
<p>Make sure your queue is <a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues">correctly configured</a> before using Horizon.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>Jobs are automatically tagged with the tenant's uuid and domain:</p>
|
|
||||||
<p><img src="https://i.imgur.com/K2oWTJc.png" alt="UUID and domain tags" /></p>
|
|
||||||
<p>You can use these tags to monitor specific tenants' jobs:</p>
|
|
||||||
<p><img src="https://i.imgur.com/qB6veK7.png" alt="Monitoring tags" /></p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
417
dist/docs/1.x/https-certificates/index.html
vendored
|
|
@ -1,417 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="HTTPS Certificates with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="HTTPS Certificates | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="HTTPS Certificates with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>HTTPS Certificates | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>HTTPS certificates</h1>
|
|
||||||
<p>HTTPS certificates are very easy to deal with if you use the <code>yourclient1.yourapp.com</code>, <code>yourclient2.yourapp.com</code> model. You can use a wildcard HTTPS certificate.</p>
|
|
||||||
<p>If you use the model where second level domains are used, there are multiple ways you can solve this.</p>
|
|
||||||
<p>This guide focuses on nginx.</p>
|
|
||||||
<h3>1. Use nginx with the lua module</h3>
|
|
||||||
<p>Specifically, you're interested in the <a href="https://github.com/openresty/lua-nginx-module#ssl_certificate_by_lua_block"><code>ssl_certificate_by_lua_block</code></a> directive. Nginx doesn't support using variables such as the hostname in the <code>ssl_certificate</code> directive, which is why the lua module is needed.</p>
|
|
||||||
<p>This approach lets you use one server block for all tenants.</p>
|
|
||||||
<h3>2. Add a simple server block for each tenant</h3>
|
|
||||||
<p>You can store most of your config in a file, such as <code>/etc/nginx/includes/tenant</code>, and include this file into tenant server blocks.</p>
|
|
||||||
<pre><code class="language-nginx">server {
|
|
||||||
include includes/tenant;
|
|
||||||
server_name foo.bar;
|
|
||||||
# ssl_certificate /etc/foo/...;
|
|
||||||
}</code></pre>
|
|
||||||
<h3>Generating certificates</h3>
|
|
||||||
<p>You can generate a certificate using certbot. If you use the <code>--nginx</code> flag, you will need to run certbot as root. If you use the <code>--webroot</code> flag, you only need the user that runs it to have write access to the webroot directory (or perhaps webroot/.well-known is enough) and some certbot files (you can specify these using --work-dir, --config-dir and --logs-dir).</p>
|
|
||||||
<p>Creating this config dynamically from PHP is not easy, but is probably feasible. Giving <code>www-data</code> write access to <code>/etc/nginx/sites-available/tenants.conf</code> should work.</p>
|
|
||||||
<p>However, you still need to reload nginx configuration to apply the changes to configuration. This is problematic and I'm not sure if there is a simple and secure way to do this from PHP.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
8
dist/docs/1.x/index.html
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en-US">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="refresh" content="0; url=getting-started">
|
|
||||||
<title>stancl/tenancy</title>
|
|
||||||
</head>
|
|
||||||
</html>
|
|
||||||
427
dist/docs/1.x/installation/index.html
vendored
|
|
@ -1,427 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Installing stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Installation | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Installing stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/installation"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Installation | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="getting-started">Installation</h1>
|
|
||||||
<p>Laravel 5.8 or higher is needed.</p>
|
|
||||||
<h3>Require the package via composer</h3>
|
|
||||||
<p>First you need to require the package using composer:</p>
|
|
||||||
<pre><code>composer require stancl/tenancy</code></pre>
|
|
||||||
<h3 id="automatic-installation">Automatic installation</h3>
|
|
||||||
<p>To install the package, simply run</p>
|
|
||||||
<pre><code>php artisan tenancy:install</code></pre>
|
|
||||||
<p>You will be asked if you want to store your data in Redis or a relational database. You can read more about this on the <a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers">Storage Drivers</a> page.</p>
|
|
||||||
<p>This will do all the steps listed in the <a href="#manual-installation">Manual installation</a> section for you.</p>
|
|
||||||
<p>The only thing you have to do now is create a database/Redis connection. Read the <a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers">Storage Drivers</a> page for information about that.</p>
|
|
||||||
<h3 id="manual-installation">Manual installation</h3>
|
|
||||||
<p>If you prefer installing the package manually, you can do that too. It shouldn't take more than a minute either way.</p>
|
|
||||||
<h4>Setting up middleware</h4>
|
|
||||||
<p>Now open <code>app/Http/Kernel.php</code> and make the <code>InitializeTenancy</code> middleware top priority, so that it gets executed before anything else, making sure things like the database switch connections soon enough:</p>
|
|
||||||
<pre><code class="language-php">protected $middlewarePriority = [
|
|
||||||
\Stancl\Tenancy\Middleware\InitializeTenancy::class,
|
|
||||||
// ...
|
|
||||||
];</code></pre>
|
|
||||||
<h4>Creating routes</h4>
|
|
||||||
<p>The package lets you have tenant routes and "exempt" routes. Tenant routes are your application's routes. Exempt routes are routes exempt from tenancy — landing pages, sign up forms, and routes for managing tenants.</p>
|
|
||||||
<p>Routes in <code>routes/web.php</code> are exempt, whereas routes in <code>routes/tenant.php</code> have the <code>InitializeTenancy</code> middleware automatically applied on them.</p>
|
|
||||||
<p>So, to create tenant routes, put those routes in a new file called <code>routes/tenant.php</code>.</p>
|
|
||||||
<h4>Configuration</h4>
|
|
||||||
<p>Run the following:</p>
|
|
||||||
<pre><code>php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=config</code></pre>
|
|
||||||
<p>This creates a <code>config/tenancy.php</code>. You can use it to configure how the package works.</p>
|
|
||||||
<p>Configuration is explained in detail on the <a href="https://tenancy.samuelstancl.me/docs/1.x/configuration">Configuration</a> page.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
402
dist/docs/1.x/integrations/index.html
vendored
|
|
@ -1,402 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Integrating stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Integrations | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Integrating stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/integrations"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Integrations | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="integrations">Integrations</h1>
|
|
||||||
<p>This package naturally integrates well with Laravel packages, since it does not rely on you explicitly specifying database connections.</p>
|
|
||||||
<p>There are some exceptions, though. <a href="https://tenancy.samuelstancl.me/docs/1.x/telescope">Telescope integration</a>, for example, requires you to change the database connection in <code>config/telescope.php</code> to a non-default one, because the default connection is switched to the tenant connection. Some packages should use a central connection for data storage.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
407
dist/docs/1.x/jobs-queues/index.html
vendored
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Jobs & Queues with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Jobs & Queues | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Jobs & Queues with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Jobs & Queues | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="jobs-queues">Jobs & Queues</h1>
|
|
||||||
<p>Jobs are automatically multi-tenant, which means that if a job is dispatched while tenant A is initialized, the job will operate with tenant A's database, cache, filesystem, and Redis.</p>
|
|
||||||
<p><strong>However</strong>, if you're using the <code>database</code> or <code>redis</code> queue driver, you have to make a small tweak to your queue configuration.</p>
|
|
||||||
<p>Open <code>config/queue.php</code> and make sure your queue driver has an explicitly set connection. Otherwise it would use the default one, which would cause issues, since <code>database.default</code> is changed by the package and Redis connections are prefixed.</p>
|
|
||||||
<p><strong>If you're using <code>database</code>, add a new line to <code>queue.connections.database</code>:</strong></p>
|
|
||||||
<pre><code class="language-php">'connection' => 'mysql',</code></pre>
|
|
||||||
<p>where <code>'mysql'</code> is the name of your non-tenant database connection with a <code>jobs</code> table.</p>
|
|
||||||
<p><strong>If you're using Redis, make sure its <code>'connection'</code> is not in <code>tenancy.redis.prefixed_connections</code>.</strong></p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
408
dist/docs/1.x/middleware-configuration/index.html
vendored
|
|
@ -1,408 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Middleware Configuration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Middleware Configuration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Middleware Configuration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Middleware Configuration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="middleware-configuration">Middleware Configuration</h1>
|
|
||||||
<p>When a tenant route is visited and the tenant can't be identified, an exception is thrown. If you want to change this behavior, to a redirect for example, add this to your <code>app/Providers/AppServiceProvider.php</code>'s <code>boot()</code> method:</p>
|
|
||||||
<pre><code class="language-php">// use Stancl\Tenancy\Middleware\InitializeTenancy;
|
|
||||||
|
|
||||||
$this->app->bind(InitializeTenancy::class, function ($app) {
|
|
||||||
return new InitializeTenancy(function ($exception) {
|
|
||||||
// return redirect()->route('foo');
|
|
||||||
});
|
|
||||||
});</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
416
dist/docs/1.x/misc-tips/index.html
vendored
|
|
@ -1,416 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Miscellaneous Tips | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Miscellaneous Tips | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Miscellaneous Tips | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Miscellaneous Tips | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="misc-tips">Miscellaneous Tips</h1>
|
|
||||||
<h2 id="tenant-redirect">Tenant Redirect</h2>
|
|
||||||
<p>A customer has signed up on your website, you have created a new tenant and now you want to redirect the customer to their website. You can use the <code>tenant()</code> method on Redirect, like this:</p>
|
|
||||||
<pre><code class="language-php">// tenant sign up controller
|
|
||||||
return redirect()->route('dashboard')->tenant($tenant['domain']);</code></pre>
|
|
||||||
<h2>Custom ID scheme</h2>
|
|
||||||
<p>If you don't want to use UUIDs and want to use something more human-readable (even domain concatenated with uuid, for example), you can create a custom class for this:</p>
|
|
||||||
<pre><code class="language-php">use Stancl\Tenancy\Interfaces\UniqueIdentifierGenerator;
|
|
||||||
|
|
||||||
class MyUniqueIDGenerator implements UniqueIdentifierGenerator
|
|
||||||
{
|
|
||||||
public static function handle(string $domain, array $data): string
|
|
||||||
{
|
|
||||||
return $domain . \Webpatser\Uuid\Uuid::generate(1, $domain);
|
|
||||||
}
|
|
||||||
}</code></pre>
|
|
||||||
<p>and then set the <code>tenancy.unique_id_generator</code> config to the full path to your class.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
407
dist/docs/1.x/stay-updated/index.html
vendored
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Stay Updated | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Stay Updated | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Stay Updated | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Stay Updated | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="stay-updated">Stay Updated</h1>
|
|
||||||
<p>If you'd like to be notified about new versions, you can <a href="https://stancl.github.io/tenancy/#stay-updated">sign up for e-mail notifications</a> or join our <a href="https://t.me/joinchat/AAAAAFjdrbSJg0ZCHTzxLA">Telegram channel</a>.</p>
|
|
||||||
<p>You can choose whether you want to receive emails about major versions and/or minor versions.</p>
|
|
||||||
<ul>
|
|
||||||
<li>Major versions include breaking changes. Composer won't know about these versions and won't update to them. Major versions will be released about once every 6 months.</li>
|
|
||||||
<li>Minor versions include backwards-compatible features and bug fixes.</li>
|
|
||||||
</ul>
|
|
||||||
<!-- todo mailchimp dialog --> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
429
dist/docs/1.x/storage-drivers/index.html
vendored
|
|
@ -1,429 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Storage Drivers of stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Storage Drivers | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Storage Drivers of stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Storage Drivers | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="storage-drivers">Storage Drivers</h1>
|
|
||||||
<p>Storage drivers are used to store a list of all tenants, their domains and any extra information you store about your tenants (e.g. their plan).</p>
|
|
||||||
<p>Currently, database and Redis storage drivers are available as part of the package. However, you can <a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers">write your own</a> (and contribute ❤️) storage drivers.</p>
|
|
||||||
<h2 id="database">Database</h2>
|
|
||||||
<p>The database storage driver lets you store tenant information in a relational database like MySQL, PostgreSQL and SQLite.</p>
|
|
||||||
<p>The benefit of this storage driver is that you don't have to use both Redis and a database for your data. Also you don't have to do as much configuration.</p>
|
|
||||||
<p>To use this driver, you need to have a <code>tenants</code> table. You may also use a custom database connection. By default, <code>tenancy.storage.db.connection</code> is set to <code>central</code>, which means that the <code>central</code> database connection will be used to store tenants. This connection is not automatically created, so you'd have to create it manually. You can create database connections in the <code>config/database.php</code> file.</p>
|
|
||||||
<p>If you'd like to use an existing connection, you can set this config to the name of the connection, e.g. <code>mysql</code>.</p>
|
|
||||||
<p>To create the <code>tenants</code> table, you can use the migration that comes with this package. If you haven't published it during installation, publish it now:</p>
|
|
||||||
<pre><code>php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=migrations</code></pre>
|
|
||||||
<p>By default, all of your data will be stored in the JSON column <code>data</code>. If you want to store some data in a dedicated column (to leverage indexing, for example), add the column to the migration and to <code>tenancy.custom_columns</code> config.</p>
|
|
||||||
<p>Finally, run the migration:</p>
|
|
||||||
<pre><code>php artisan migrate</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>If you use a non-default connection, such as <code>central</code>, you have to specify which DB to migrate using the <code>--database</code> option.</p>
|
|
||||||
<p>If you have existing migrations related to your app in <code>database/migrations</code>, move them to <code>database/migrations/tenant</code>. You can read more about tenant migrations <a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands/#migrate">here</a>.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h2 id="redis">Redis</h2>
|
|
||||||
<p>The Redis storage driver lets you store tenant information in Redis, a high-performance key-value store.</p>
|
|
||||||
<p>The benefit of this storage driver is its performance.</p>
|
|
||||||
<p><strong>Note that you need to configure persistence on your Redis instance if you don't want to lose all information about tenants.</strong></p>
|
|
||||||
<p>Read the <a href="https://redis.io/topics/persistence">Redis documentation page on persistence</a>. You should definitely use AOF and if you want to be even more protected from data loss, you can use RDB <strong>in conjunction with AOF</strong>.</p>
|
|
||||||
<p>If your cache driver is Redis and you don't want to use AOF with it, run two Redis instances. Otherwise, just make sure you use a different database (number) for tenancy and for anything else.</p>
|
|
||||||
<p>To use this driver, create a new Redis connection in the <code>database.redis</code> configuration (<code>config/database.php</code>) called <code>tenancy</code>.</p>
|
|
||||||
<pre><code class="language-php">'tenancy' => [
|
|
||||||
'host' => env('TENANCY_REDIS_HOST', '127.0.0.1'),
|
|
||||||
'password' => env('TENANCY_REDIS_PASSWORD', null),
|
|
||||||
'port' => env('TENANCY_REDIS_PORT', 6380), // different port = separate Redis instance
|
|
||||||
'database' => env('TENANCY_REDIS_DB', 3), // alternatively, different database number
|
|
||||||
],</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
412
dist/docs/1.x/telescope/index.html
vendored
|
|
@ -1,412 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Telescope Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Telescope Integration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Telescope Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/telescope"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Telescope Integration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Telescope Integration</h1>
|
|
||||||
<p>Requests in Telescope are automatically tagged with the tenant uuid and domain:</p>
|
|
||||||
<p><img src="https://i.imgur.com/CEEluYj.png" alt="Telescope Request with tags" /></p>
|
|
||||||
<p>This lets you filter requests by uuid and domain:</p>
|
|
||||||
<p><img src="https://i.imgur.com/SvbOa7S.png" alt="Filtering by uuid" />
|
|
||||||
<img src="https://i.imgur.com/dCJuEr1.png" alt="Filtering by domain" /></p>
|
|
||||||
<p>If you'd like to set Telescope tags in your own code, e.g. in your <code>AppServiceProvider</code>, replace your <code>Telescope::tag()</code> call like this:</p>
|
|
||||||
<pre><code class="language-php">\Tenancy::integrationEvent('telescope', function ($entry) {
|
|
||||||
return ['abc']; // your logic
|
|
||||||
});</code></pre>
|
|
||||||
<p><img src="https://i.imgur.com/4p1wOiM.png" alt="Tenancy tags merged with tag abc" /></p>
|
|
||||||
<p>Once Telescope 3 is released, you won't have to do this.</p>
|
|
||||||
<p>To have Telescope working, make sure your <code>telescope.storage.database.connection</code> points to a non-tenant connection. It's that way by default, so for most projects, Telescope should work out of the box.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
510
dist/docs/1.x/tenancy-initialization/index.html
vendored
|
|
@ -1,510 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenancy Initialization with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenancy Initialization | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenancy Initialization with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenancy Initialization | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenancy-initialization">Tenancy Initialization</h1>
|
|
||||||
<p>Tenancy can be initialized by calling <code>tenancy()->init()</code>. The <code>InitializeTenancy</code> middleware calls this method automatically.</p>
|
|
||||||
<p>You can end a tenancy session using <code>tenancy()->end()</code>. This is useful if you need to run multiple tenant sessions or a mixed tenant/non-tenant session in a single request/command.</p>
|
|
||||||
<p>The <code>tenancy()->init()</code> method calls <code>bootstrap()</code>.</p>
|
|
||||||
<p>This method switches database connection, Redis connection (if Redis tenancy is enabled), cache and filesystem root paths.</p>
|
|
||||||
<p>This page goes through the code that actually makes this happen. You don't have to read this page to use the package, but it will give you insight into the magic that's happening in the background, so that you can be more confident in it.</p>
|
|
||||||
<h2 id="database-tenancy">Database tenancy</h2>
|
|
||||||
<p><code>bootstrap()</code> runs the following method:</p>
|
|
||||||
<pre><code class="language-php">public function switchDatabaseConnection()
|
|
||||||
{
|
|
||||||
$this->database->connect($this->getDatabaseName());
|
|
||||||
}</code></pre>
|
|
||||||
<p>If <code>tenancy.database_name_key</code> is set and present in the current tenant's data, the <code>getDatabaseName()</code> returns the stored database_name. Otherwise it returns the prefix + uuid + suffix.</p>
|
|
||||||
<pre><code class="language-php">public function getDatabaseName($tenant = []): string
|
|
||||||
{
|
|
||||||
$tenant = $tenant ?: $this->tenant;
|
|
||||||
if ($key = $this->app['config']['tenancy.database_name_key']) {
|
|
||||||
if (isset($tenant[$key])) {
|
|
||||||
return $tenant[$key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->app['config']['tenancy.database.prefix'] . $tenant['uuid'] . $this->app['config']['tenancy.database.suffix'];
|
|
||||||
}</code></pre>
|
|
||||||
<p>This is passed as an argument to the <code>connect()</code> method. This method creates a new database connection and sets it as the default one.</p>
|
|
||||||
<pre><code class="language-php">public function connect(string $database)
|
|
||||||
{
|
|
||||||
$this->createTenantConnection($database);
|
|
||||||
$this->useConnection('tenant');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createTenantConnection(string $database_name)
|
|
||||||
{
|
|
||||||
// Create the `tenant` database connection.
|
|
||||||
$based_on = config('tenancy.database.based_on') ?: config('database.default');
|
|
||||||
config()->set([
|
|
||||||
'database.connections.tenant' => config('database.connections.' . $based_on),
|
|
||||||
]);
|
|
||||||
// Change DB name
|
|
||||||
$database_name = $this->getDriver() === 'sqlite' ? database_path($database_name) : $database_name;
|
|
||||||
config()->set(['database.connections.tenant.database' => $database_name]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function useConnection(string $connection)
|
|
||||||
{
|
|
||||||
// $this->database = Illuminate\Database\DatabaseManager
|
|
||||||
$this->database->setDefaultConnection($connection);
|
|
||||||
$this->database->reconnect($connection);
|
|
||||||
}</code></pre>
|
|
||||||
<h2 id="redis-tenancy">Redis tenancy</h2>
|
|
||||||
<p>The <code>bootstrap()</code> method calls <code>setPhpRedisPrefix()</code> if <code>tenancy.redis.tenancy</code> is <code>true</code>.</p>
|
|
||||||
<p>This method cycles through the <code>tenancy.redis.prefixed_connections</code> and sets their prefix to <code>tenancy.redis.prefix_base</code> + uuid.</p>
|
|
||||||
<pre><code class="language-php">public function setPhpRedisPrefix($connections = ['default'])
|
|
||||||
{
|
|
||||||
// [...]
|
|
||||||
foreach ($connections as $connection) {
|
|
||||||
$prefix = $this->app['config']['tenancy.redis.prefix_base'] . $this->tenant['uuid'];
|
|
||||||
$client = Redis::connection($connection)->client();
|
|
||||||
try {
|
|
||||||
// [...]
|
|
||||||
$client->setOption($client::OPT_PREFIX, $prefix);
|
|
||||||
} catch (\Throwable $t) {
|
|
||||||
throw new PhpRedisNotInstalledException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}</code></pre>
|
|
||||||
<h2 id="cache-tenancy">Cache tenancy</h2>
|
|
||||||
<p><code>bootstrap()</code> calls <code>tagCache()</code> which replaces the <code>'cache'</code> key in the service container with a different <code>CacheManager</code>.</p>
|
|
||||||
<pre><code class="language-php">public function tagCache()
|
|
||||||
{
|
|
||||||
// [...]
|
|
||||||
$this->app->extend('cache', function () {
|
|
||||||
return new \Stancl\Tenancy\CacheManager($this->app);
|
|
||||||
});
|
|
||||||
}</code></pre>
|
|
||||||
<p>This <code>CacheManager</code> forwards all calls to the inner store, but also adds tag which "scope" the cache and allow for selective cache clearing:</p>
|
|
||||||
<pre><code class="language-php">class CacheManager extends BaseCacheManager
|
|
||||||
{
|
|
||||||
public function __call($method, $parameters)
|
|
||||||
{
|
|
||||||
$tags = [config('tenancy.cache.tag_base') . tenant('uuid')];
|
|
||||||
if ($method === 'tags') {
|
|
||||||
if (\count($parameters) !== 1) {
|
|
||||||
throw new \Exception("Method tags() takes exactly 1 argument. {count($parameters)} passed.");
|
|
||||||
}
|
|
||||||
$names = $parameters[0];
|
|
||||||
$names = (array) $names; // cache()->tags('foo') https://laravel.com/docs/5.7/cache#removing-tagged-cache-items
|
|
||||||
return $this->store()->tags(\array_merge($tags, $names));
|
|
||||||
}
|
|
||||||
return $this->store()->tags($tags)->$method(...$parameters);
|
|
||||||
}
|
|
||||||
}</code></pre>
|
|
||||||
<h2 id="filesystem-tenancy">Filesystem tenancy</h2>
|
|
||||||
<p><code>bootstrap()</code> calls <code>suffiexFilesystemRootPaths()</code>. This method changes <code>storage_path()</code> and the roots of disks listed in <code>config('tenancy.filesystem.disks)</code>. You can read more about this on the <a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy">Filesystem Tenancy</a> page.</p>
|
|
||||||
<pre><code class="language-php">public function suffixFilesystemRootPaths()
|
|
||||||
{
|
|
||||||
// [...]
|
|
||||||
$suffix = $this->app['config']['tenancy.filesystem.suffix_base'] . tenant('uuid');
|
|
||||||
// storage_path()
|
|
||||||
$this->app->useStoragePath($old['path'] . "/{$suffix}");
|
|
||||||
// Storage facade
|
|
||||||
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {
|
|
||||||
// [...]
|
|
||||||
if ($root = \str_replace('%storage_path%', storage_path(), $this->app['config']["tenancy.filesystem.root_override.{$disk}"])) {
|
|
||||||
Storage::disk($disk)->getAdapter()->setPathPrefix($root);
|
|
||||||
} else {
|
|
||||||
$root = $this->app['config']["filesystems.disks.{$disk}.root"];
|
|
||||||
Storage::disk($disk)->getAdapter()->setPathPrefix($root . "/{$suffix}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// [...]
|
|
||||||
}</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
467
dist/docs/1.x/tenant-manager/index.html
vendored
|
|
@ -1,467 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenant Manager | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenant Manager | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenant Manager | stancl/tenancy — A Laravel multi-database tenancy package that respects your code."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenant Manager | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenant-manager">Tenant Manager</h1>
|
|
||||||
<p>This page documents a couple of other <code>TenantManager</code> methods you may find useful.</p>
|
|
||||||
<h3>Finding tenant using UUID</h3>
|
|
||||||
<p><code>find()</code> is an alias for <code>getTenantById()</code>. You may use the second argument to specify the key(s) as a string/array.</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->find('dbe0b330-1a6e-11e9-b4c3-354da4b4f339');
|
|
||||||
=> [
|
|
||||||
"uuid" => "dbe0b330-1a6e-11e9-b4c3-354da4b4f339",
|
|
||||||
"domain" => "localhost",
|
|
||||||
"foo" => "bar",
|
|
||||||
]
|
|
||||||
>>> tenant()->find('dbe0b330-1a6e-11e9-b4c3-354da4b4f339', 'foo');
|
|
||||||
=> [
|
|
||||||
"foo" => "bar",
|
|
||||||
]
|
|
||||||
>>> tenant()->getTenantById('dbe0b330-1a6e-11e9-b4c3-354da4b4f339', ['foo', 'domain']);
|
|
||||||
=> [
|
|
||||||
"foo" => "bar",
|
|
||||||
"domain" => "localhost",
|
|
||||||
]</code></pre>
|
|
||||||
<h3>Getting tenant ID by domain</h3>
|
|
||||||
<pre><code class="language-php">>>> tenant()->getTenantIdByDomain('localhost');
|
|
||||||
=> "b3ce3f90-1a88-11e9-a6b0-038c6337ae50"
|
|
||||||
>>> tenant()->getIdByDomain('localhost');
|
|
||||||
=> "b3ce3f90-1a88-11e9-a6b0-038c6337ae50"</code></pre>
|
|
||||||
<h3>Finding tenant by domain</h3>
|
|
||||||
<p>You may use the second argument to specify the key(s) as a string/array.</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->findByDomain('localhost');
|
|
||||||
=> [
|
|
||||||
"uuid" => "b3ce3f90-1a88-11e9-a6b0-038c6337ae50",
|
|
||||||
"domain" => "localhost",
|
|
||||||
]</code></pre>
|
|
||||||
<h3>Accessing the array</h3>
|
|
||||||
<p>You can access the public array tenant of TenantManager like this:</p>
|
|
||||||
<pre><code class="language-php">tenancy()->tenant</code></pre>
|
|
||||||
<p>which is an array. If you want to get the value of a specific key from the array, you can use one of the helpers the key on the tenant array as an argument.</p>
|
|
||||||
<pre><code class="language-php">tenant('uuid'); // Does the same thing as tenant()->tenant['uuid']</code></pre>
|
|
||||||
<h3>Getting all tenants</h3>
|
|
||||||
<p>This method returns a collection of arrays.</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->all();
|
|
||||||
=> Illuminate\Support\Collection {#2980
|
|
||||||
all: [
|
|
||||||
[
|
|
||||||
"uuid" => "32e20780-1a88-11e9-a051-4b6489a7edac",
|
|
||||||
"domain" => "localhost",
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"uuid" => "49670df0-1a87-11e9-b7ba-cf5353777957",
|
|
||||||
"domain" => "dev.localhost",
|
|
||||||
],
|
|
||||||
],
|
|
||||||
}
|
|
||||||
>>> tenant()->all()->pluck('domain');
|
|
||||||
=> Illuminate\Support\Collection {#2983
|
|
||||||
all: [
|
|
||||||
"localhost",
|
|
||||||
"dev.localhost",
|
|
||||||
],
|
|
||||||
}</code></pre>
|
|
||||||
<h3>Deleting a tenant</h3>
|
|
||||||
<pre><code class="language-php">>>> tenant()->delete('dbe0b330-1a6e-11e9-b4c3-354da4b4f339');
|
|
||||||
=> true
|
|
||||||
>>> tenant()->delete(tenant()->getTenantIdByDomain('dev.localhost'));
|
|
||||||
=> true
|
|
||||||
>>> tenant()->delete(tenant()->findByDomain('localhost')['uuid']);
|
|
||||||
=> true</code></pre>
|
|
||||||
<p>This doesn't delete the tenant's database. If you want to delete it, save the database name prior to deleting the tenant. You can get the database name using <code>getDatabaseName()</code></p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->getDatabaseName(tenant()->findByDomain('laravel.localhost'))
|
|
||||||
=> "tenant67412a60-1c01-11e9-a9e9-f799baa56fd9"</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
416
dist/docs/1.x/tenant-routes/index.html
vendored
|
|
@ -1,416 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenant routes with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenant Routes | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenant routes with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenant Routes | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenant-routes">Tenant Routes</h1>
|
|
||||||
<p>Routes within <code>routes/tenant.php</code> will have the <code>web</code> middleware group and the <code>IntializeTenancy</code> middleware automatically applied on them. This middleware attempts to identify the tenant based on the current hostname. Once the tenant is identified, the database connection, cache, filesystem root paths and, optionally, Redis connection, will be switched.</p>
|
|
||||||
<p>Just like <code>routes/web.php</code>, these routes use the <code>App\Http\Controllers</code> namespace.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>If a tenant cannot be identified, anexception will be thrown. If you want to change this behavior (to a redirect, for example) read the <a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration">Middleware Configuration</a> page.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h2 id="exempt-routes">Exempt routes</h2>
|
|
||||||
<p>Routes outside the <code>routes/tenant.php</code> file will not have the tenancy middleware automatically applied on them. You can apply this middleware manually, though.</p>
|
|
||||||
<p>If you want some of your, say, API routes to be multi-tenant, simply wrap them in a Route group with this middleware:</p>
|
|
||||||
<pre><code class="language-php">use Stancl\Tenancy\Middleware\InitializeTenancy;
|
|
||||||
|
|
||||||
Route::middleware(InitializeTenancy::class)->group(function () {
|
|
||||||
// Route::get('/', 'HelloWorld');
|
|
||||||
});</code></pre>
|
|
||||||
<h2 id="using-the-same-routes-for-tenant-and-non-tenant-parts-of-the-application">Using the same routes for tenant and non-tenant parts of the application</h2>
|
|
||||||
<p>The <code>Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains</code> middleware makes sure 404 is returned when a user attempts to visit a web route on a tenant (non-exempt) domain.</p>
|
|
||||||
<p>The install command applies this middleware to the <code>web</code> group. If you want to do this for another route group, add this middleware manually to that group. You can do this in <code>app/Http/Kernel.php</code>.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
427
dist/docs/1.x/tenant-storage/index.html
vendored
|
|
@ -1,427 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenant storage with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenant Storage | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenant storage with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenant Storage | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenant-storage">Tenant Storage</h1>
|
|
||||||
<p>Tenant storage is where tenants' uuids and domains are stored. You can store things like the tenant's plan, subscription information, and tenant-specific application configuration in tenant storage. You can use these functions:</p>
|
|
||||||
<pre><code class="language-php">get (string|array $key, string $uuid = null) // $uuid defaults to the current tenant's UUID
|
|
||||||
put (string|array $key, mixed $value = null, string $uuid = null) // if $key is array, make sure $value is null</code></pre>
|
|
||||||
<p>To put something into the tenant storage, you can use <code>put()</code> or <code>set()</code>.</p>
|
|
||||||
<pre><code class="language-php">tenancy()->put($key, $value);
|
|
||||||
tenancy()->set($key, $value); // alias for put()
|
|
||||||
tenancy()->put($key, $value, $uuid);
|
|
||||||
tenancy()->put(['key1' => 'value1', 'key2' => 'value2']);
|
|
||||||
tenancy()->put(['key1' => 'value1', 'key2' => 'value2'], null, $uuid);</code></pre>
|
|
||||||
<p>To get something from the storage, you can use <code>get()</code>:</p>
|
|
||||||
<pre><code class="language-php">tenancy()->get($key);
|
|
||||||
tenancy()->get($key, $uuid);
|
|
||||||
tenancy()->get(['key1', 'key2']);</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: <code>tenancy()->get(['key1', 'key2'])</code> returns an array with values only</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>Note that $key has to be a string or an array with string keys. The value(s) can be of any data type. Example with arrays:</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->put('foo', ['a' => 'b', 'c' => 'd']);
|
|
||||||
=> [ // put() returns the supplied value(s)
|
|
||||||
"a" => "b",
|
|
||||||
"c" => "d",
|
|
||||||
]
|
|
||||||
>>> tenant()->get('foo');
|
|
||||||
=> [
|
|
||||||
"a" => "b",
|
|
||||||
"c" => "d",
|
|
||||||
]</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
406
dist/docs/1.x/usage/index.html
vendored
|
|
@ -1,406 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Usage | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Usage | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Usage | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/usage"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Usage | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="usage">Usage</h1>
|
|
||||||
<p>This chapter describes usage of the package. That includes creating tenants, deleting tenants, storing data in the tenant storage.</p>
|
|
||||||
<p>Most pages will use the <code>tenancy()</code> helper function. This package comes with two helpers - <code>tenancy()</code> and <code>tenant()</code>. They do the same thing, so you can use the one that reads better given its context.</p>
|
|
||||||
<p><code>tenant()->create()</code> reads better than <code>tenancy()->create()</code>, but <code>tenancy()->init()</code> reads better than <code>tenant()->init()</code>.</p>
|
|
||||||
<p>You can pass an argument to the helper function to get a value out of the tenant storage. <code>tenant('plan')</code> is identical to <a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"><code>tenant()->get('plan')</code></a>.</p>
|
|
||||||
<p>The package also comes with two facades. <code>Tenancy</code> and <code>Tenant</code>. Use what feels the best.</p>
|
|
||||||
<p>Both the helpers and the facades resolve the <code>TenantManager</code> from the service container.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
464
dist/docs/1.x/writing-storage-drivers/index.html
vendored
|
|
@ -1,464 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Writing Storage Drivers with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Writing Storage Drivers | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Writing Storage Drivers with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Writing Storage Drivers | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/storage-drivers"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/1.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Writing Storage Drivers</h1>
|
|
||||||
<p>If you don't want to use the provided DB/Redis storage drivers, you can write your own driver.</p>
|
|
||||||
<p>To create a driver, create a class that implements the <code>Stancl\Tenancy\Interfaces\StorageDriver</code> interface.</p>
|
|
||||||
<p>For historical reasons, the <code>TenantManager</code> will try to json encode/decode data coming from the storage driver. If you want to avoid this, set <code>public $useJson = false;</code>. That will make <code>TenantManager</code> encode/decode only <code>put()</code> and <code>get()</code> data, so that data types can be stored correctly.</p>
|
|
||||||
<p>The DB storage driver has <code>public $useJson = false;</code>, while the Redis storage driver doesn't use this property, so it's false by default.</p>
|
|
||||||
<p>Here's an example:</p>
|
|
||||||
<pre><code class="language-php">
|
|
||||||
namespace App\StorageDrivers\MongoDBStorageDriver;
|
|
||||||
|
|
||||||
use Stancl\Tenancy\Interfaces\StorageDriver;
|
|
||||||
|
|
||||||
class MongoDBStorageDriver implements StorageDriver
|
|
||||||
{
|
|
||||||
public $useJson = false;
|
|
||||||
|
|
||||||
public function identifyTenant(string $domain): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAllTenants(array $uuids = []): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTenantById(string $uuid, array $fields = []): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTenantIdByDomain(string $domain): ?string
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createTenant(string $domain, string $uuid): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deleteTenant(string $uuid): bool
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get(string $uuid, string $key)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMany(string $uuid, array $keys): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function put(string $uuid, string $key, $value)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function putMany(string $uuid, array $values): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
432
dist/docs/2.x/application-testing/index.html
vendored
|
|
@ -1,432 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Application Testing with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Application Testing | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Application Testing with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/application-testing"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Application Testing | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="application-testing">Application Testing</h1>
|
|
||||||
<p>To test your application with this package installed, you can create tenants in the <code>setUp()</code> method of your test case:</p>
|
|
||||||
<pre><code class="language-php">protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
tenant()->create('test.localhost');
|
|
||||||
tenancy()->init('test.localhost');
|
|
||||||
}</code></pre>
|
|
||||||
<p>If you're using the database storage driver, you will also need to run the <code>create_tenants_table</code> migration:</p>
|
|
||||||
<pre><code class="language-php">protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
$this->call('migrate', [
|
|
||||||
'--path' => database_path('migrations'),
|
|
||||||
'--database' => 'sqlite',
|
|
||||||
]);
|
|
||||||
|
|
||||||
tenant()->create('test.localhost');
|
|
||||||
tenancy()->init('test.localhost');
|
|
||||||
}</code></pre>
|
|
||||||
<p>If you're using the Redis storage driver, flush the database in <code>setUp()</code>:</p>
|
|
||||||
<pre><code class="language-php">protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
// make sure you're using a different connection for testing to avoid losing data
|
|
||||||
Redis::connection('tenancyTesting')->flushdb();
|
|
||||||
|
|
||||||
tenant()->create('test.localhost');
|
|
||||||
tenancy()->init('test.localhost');
|
|
||||||
}</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
431
dist/docs/2.x/configuration/index.html
vendored
|
|
@ -1,431 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Configuring stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Configuration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Configuring stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/configuration"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Configuration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="configuration">Configuration</h1>
|
|
||||||
<p>The <code>config/tenancy.php</code> file lets you configure how the package behaves.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p><strong>Note:</strong> If the <code>tenancy.php</code> file doesn't exist in your <code>config</code> directory, you can publish it by running <code>php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=config</code></p>
|
|
||||||
</blockquote>
|
|
||||||
<h3 id="storage"><code>storage_driver, storage</code></h3>
|
|
||||||
<p>This lets you configure the driver for tenant storage, i.e. what will be used to store information about your tenants. You can read more about this on the <a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers">Storage Drivers</a> page.</p>
|
|
||||||
<p>Available storage drivers:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>Stancl\Tenancy\StorageDrivers\RedisStorageDriver</code></li>
|
|
||||||
<li><code>Stancl\Tenancy\StorageDrivers\DatabaseStorageDriver</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="tenant-route-namespace"><code>tenant_route_namespace</code></h3>
|
|
||||||
<p>Controller namespace used for routes in <code>routes/tenant.php</code>. The default value is the same as the namespace for <code>web.php</code> routes.</p>
|
|
||||||
<h3 id="exempt-domains"><code>exempt_domains</code></h3>
|
|
||||||
<p>If a hostname from this array is visited, the <code>tenant.php</code> routes won't be registered, letting you use the same routes as in that file.</p>
|
|
||||||
<h3 id="database"><code>database</code></h3>
|
|
||||||
<p>The application's default connection will be switched to a new one — <code>tenant</code>. This connection will be based on the connection specified in <code>tenancy.database.based_on</code>. The database name will be <code>tenancy.database.prefix + tenant UUID + tenancy.database.suffix</code>.</p>
|
|
||||||
<p>You can set the suffix to <code>.sqlite</code> if you're using sqlite and want the files to be with the <code>.sqlite</code> extension. Conversely, you can leave the suffix empty if you're using MySQL, for example.</p>
|
|
||||||
<h3 id="redis"><code>redis</code></h3>
|
|
||||||
<p>If <code>tenancy.redis.tenancy</code> is set to true, connections listed in <code>tenancy.redis.prefixed_connections</code> will be prefixed with <code>config('tenancy.redis.prefix_base') . $uuid</code>.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: You need phpredis for multi-tenant Redis.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h3 id="cache"><code>cache</code></h3>
|
|
||||||
<p>The <code>CacheManager</code> instance that's resolved when you use the <code>Cache</code> or the <code>cache()</code> helper will be replaced by <code>Stancl\Tenancy\CacheManager</code>. This class automatically uses <a href="https://laravel.com/docs/master/cache#cache-tags">tags</a>. The tag will look like <code>config('tenancy.cache.tag_base') . $uuid</code>.</p>
|
|
||||||
<p>If you need to store something in global, non-tenant cache, </p>
|
|
||||||
<h3 id="filesystem"><code>filesystem</code></h3>
|
|
||||||
<p>The <code>storage_path()</code> will be suffixed with a directory named <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p>The root of each disk listed in <code>tenancy.filesystem.disks</code> will be suffixed with <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p>For disks listed in <code>root_override</code>, the root will be that string with <code>%storage_path%</code> replaced by <code>storage_path()</code> <em>after</em> tenancy has been initialized. All other disks will be simply suffixed with <code>tenancy.filesystem.suffix_base</code> + the tenant UUID.</p>
|
|
||||||
<p>Read more about this on the <a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy">Filesystem Tenancy</a> page.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
433
dist/docs/2.x/console-commands/index.html
vendored
|
|
@ -1,433 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Console commands with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Console Commands | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Console commands with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/console-commands"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Console Commands | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="console-commands">Console Commands</h1>
|
|
||||||
<p>The package comes with some artisan commands that will help you during development.</p>
|
|
||||||
<h2 id="migrate">Migrate</h2>
|
|
||||||
<p>The most important command. To use tenants, you have to be able to migrate their databases.</p>
|
|
||||||
<p>You can use the <code>tenants:migrate</code> command to migrate tenant's databases. You can also specify which tenants' databases should be migrated using the <code>--tenants</code> option.</p>
|
|
||||||
<pre><code>php artisan tenants:migrate --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: Tenant migrations must be located in <code>database/migrations/tenant</code>.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>You can use these commands outside the command line as well. If you want to migrate a tenant's database in a controller, you can use the <code>Artisan</code> facade.</p>
|
|
||||||
<pre><code class="language-php">$tenant = tenant()->create('tenant1.localhost');
|
|
||||||
|
|
||||||
\Artisan::call('tenants:migrate', [
|
|
||||||
'--tenants' => [$tenant['uuid']]
|
|
||||||
]);</code></pre>
|
|
||||||
<h2 id="rollback">Rollback & seed</h2>
|
|
||||||
<ul>
|
|
||||||
<li>Rollback: <code>tenants:rollback</code></li>
|
|
||||||
<li>Seed: <code>tenants:seed</code></li>
|
|
||||||
</ul>
|
|
||||||
<p>Similarly to <a href="#migrate">migrate</a>, these commands accept a <code>--tenants</code> option.</p>
|
|
||||||
<h2 id="run">Run</h2>
|
|
||||||
<p>You can use the tenants:run command to run your own commands for tenants.</p>
|
|
||||||
<p>If your command's signature were <code>email:send {--queue} {--subject=} {body}</code>, you would run this command like this:</p>
|
|
||||||
<pre><code>php artisan tenants:run email:send --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23 --option="queue=1" --option="subject=New Feature" --argument="body=We have launched a new feature. ..."</code></pre>
|
|
||||||
<h2 id="tenant-list">Tenant list</h2>
|
|
||||||
<pre><code class="language-none">php artisan tenants:list
|
|
||||||
Listing all tenants.
|
|
||||||
[Tenant] uuid: dbe0b330-1a6e-11e9-b4c3-354da4b4f339 @ localhost
|
|
||||||
[Tenant] uuid: 49670df0-1a87-11e9-b7ba-cf5353777957 @ dev.localhost</code></pre>
|
|
||||||
<h2 id="selectively-clearing-tenant-cache">Selectively clearing tenant cache</h2>
|
|
||||||
<p>You can delete specific tenants' cache by using the <code>--tags</code> option on <code>cache:clear</code>:</p>
|
|
||||||
<pre><code>php artisan cache:clear --tags=tenantdbe0b330-1a6e-11e9-b4c3-354da4b4f339</code></pre>
|
|
||||||
<p>The tag is <code>config('tenancy.cache.tag_base') . $uuid</code>.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
417
dist/docs/2.x/creating-tenants/index.html
vendored
|
|
@ -1,417 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Creating tenants with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Creating Tenants | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Creating tenants with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Creating Tenants | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="creating-tenants">Creating Tenants</h1>
|
|
||||||
<blockquote>
|
|
||||||
<p><strong>Make sure your database is correctly <a href="https://tenancy.samuelstancl.me/docs/2.x/configuration/#database">configured</a> before creating tenants.</strong></p>
|
|
||||||
</blockquote>
|
|
||||||
<p>To create a tenant, you can use</p>
|
|
||||||
<pre><code class="language-php">Tenant::new()->withDomains(['tenant1.yourapp.com'])->withData(['plan' => 'free'])->save();</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>Tip: All domains under <code>.localhost</code> are routed to 127.0.0.1 on most operating systems. This is useful for development.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>The <code>withDomains()</code> and <code>withData()</code> methods are optional.</p>
|
|
||||||
<p>You can also create a tenant using the <code>Tenant::create</code> method:</p>
|
|
||||||
<pre><code class="language-php">$domains = ['tenant1.myapp.com', 'tenant1.com'];
|
|
||||||
Tenant::create($domains, [
|
|
||||||
'plan' => 'free',
|
|
||||||
]);</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: Creating a tenant doesn't run <a href="https://stancl-tenancy.netlify.com/docs/console-commands/#migrate">migrations</a> automatically. You have to do that yourself. <!-- TODO auto migrate after creation --></p>
|
|
||||||
</blockquote> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
409
dist/docs/2.x/custom-database-names/index.html
vendored
|
|
@ -1,409 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Custom Database Names with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Custom Database Names | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Custom Database Names with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Custom Database Names | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="custom-database-names">Custom Database Names</h1>
|
|
||||||
<p>If you want to specify the tenant's database name, set the <code>tenancy.database_name_key</code> configuration key to the name of the key that is used to specify the database name in the tenant storage. You must use a name that you won't use for storing other data, so it's recommended to avoid names like <code>database</code> and use names like <code>_stancl_tenancy_database_name</code> instead. Then just give the key a value during the tenant creation process:</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->create('example.com', [
|
|
||||||
'_stancl_tenancy_database_name' => 'example_com'
|
|
||||||
])
|
|
||||||
=> [
|
|
||||||
"uuid" => "49670df0-1a87-11e9-b7ba-cf5353777957",
|
|
||||||
"domain" => "example.com",
|
|
||||||
"_stancl_tenancy_database_name" => "example_com",
|
|
||||||
]</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
406
dist/docs/2.x/development/index.html
vendored
|
|
@ -1,406 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Development | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Development | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Development | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/development"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Development | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="development">Development</h1>
|
|
||||||
<h2 id="running-tests">Running tests</h2>
|
|
||||||
<h3 id="with-docker">With Docker</h3>
|
|
||||||
<p>If you have Docker installed, simply run ./test. When you're done testing, run docker-compose down to shut down the containers.</p>
|
|
||||||
<h3 id="without-docker">Without Docker</h3>
|
|
||||||
<p>If you run the tests of this package, please make sure you don't store anything in Redis @ 127.0.0.1:6379 db#14. The contents of this database are flushed everytime the tests are run.</p>
|
|
||||||
<p>Some tests are run only if the CI, TRAVIS and CONTINUOUS_INTEGRATION environment variables are set to true. This is to avoid things like bloating your MySQL instance with test databases.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Difference Between This Package And Others | with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Difference Between This Package And Others | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Difference Between This Package And Others | with stancl/tenancy — A Laravel multi-database tenancy package that respects your code."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Difference Between This Package And Others | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Difference Between This Package And Others</h1>
|
|
||||||
<p>A frequently asked question is the difference between this package and <a href="https://github.com/tenancy/multi-tenant">tenancy/multi-tenant</a>.</p>
|
|
||||||
<p>Packages like tenancy/multi-tenant and tenancy/tenancy give you an API for making your application multi-tenant. They give you a tenant DB connection, traits to apply on your models, a guide on creating your own tenant-aware cache, etc.</p>
|
|
||||||
<p>This package makes your application multi-tenant automatically and attempts to make you not have to change (m)any things in your code.</p>
|
|
||||||
<h2>Which one should you use?</h2>
|
|
||||||
<p>Depends on what you prefer.</p>
|
|
||||||
<p>If you want full control and make your application multi-tenant yourself, use tenancy/multi-tenant.</p>
|
|
||||||
<p>If you want to focus on writing your application instead of tenancy implementations, use stancl/tenancy.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
400
dist/docs/2.x/digging-deeper/index.html
vendored
|
|
@ -1,400 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Digging Deeper | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Digging Deeper | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Digging Deeper | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Digging Deeper | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="digging-deeper">Digging Deeper</h1> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
431
dist/docs/2.x/event-system/index.html
vendored
|
|
@ -1,431 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="The Event System | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="The Event System | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="The Event System | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/event-system"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>The Event System | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>The Event System</h1>
|
|
||||||
<p>You can use event hooks to change the behavior of the tenancy boostrapping and tenancy ending processes.</p>
|
|
||||||
<p>The following events are available:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>boostrapping</code></li>
|
|
||||||
<li><code>boostrapped</code></li>
|
|
||||||
<li><code>ending</code></li>
|
|
||||||
<li><code>ended</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="tenant-specific-database-connection-example">Tenant-specific database connection example</h3>
|
|
||||||
<p>You can hook into these events using <code>Tenancy::<eventName></code>:</p>
|
|
||||||
<pre><code class="language-php">\Tenancy::boostrapping(function ($tenantManager) {
|
|
||||||
if ($tenantManager->tenant['uuid'] === 'someUUID') {
|
|
||||||
config(['database.connections.someDatabaseConnection' => $tenantManager->tenant['databaseConnection']]);
|
|
||||||
$tenantManager->database->useConnection('someDatabaseConnection');
|
|
||||||
|
|
||||||
return ['database'];
|
|
||||||
}
|
|
||||||
});</code></pre>
|
|
||||||
<p>The example above checks whether the current tenant has an uuid of <code>someUUID</code>. If yes, it creates a new database connection based on data stored in the tenant's storage. Then it changes the default database connection. Finally, it returns an array of the events that this callback prevents.</p>
|
|
||||||
<p>The following actions can be prevented:</p>
|
|
||||||
<ul>
|
|
||||||
<li>database connection switch: <code>database</code></li>
|
|
||||||
<li>Redis prefix: <code>redis</code></li>
|
|
||||||
<li>CacheManager switch: <code>cache</code></li>
|
|
||||||
<li>Filesystem changes: <code>filesystem</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="tenant-specific-configuration-example">Tenant-specific configuration example</h3>
|
|
||||||
<p>Another common use case for events is tenant-specific config:</p>
|
|
||||||
<pre><code class="language-php">\Tenancy::bootstrapped(function ($tenantManager) {
|
|
||||||
config(['some.api.key' => $tenantManager->tenant['api_key']);
|
|
||||||
});</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
423
dist/docs/2.x/filesystem-tenancy/index.html
vendored
|
|
@ -1,423 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Filesystem Tenancy with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Filesystem Tenancy | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Filesystem Tenancy with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Filesystem Tenancy | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="filesystem-tenancy">Filesystem Tenancy</h1>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: It's important to differentiate between storage_path() and the Storage facade. The Storage facade is what you use to put files into storage, i.e. <code>Storage::disk('local')->put()</code>. <code>storage_path()</code> is used to get the path to the storage directory.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>The <code>storage_path()</code> will be suffixed with a directory named <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p>The root of each disk listed in <code>tenancy.filesystem.disks</code> will be suffixed with <code>config('tenancy.filesystem.suffix_base') . $uuid</code>.</p>
|
|
||||||
<p><strong>However, this alone would cause unwanted behavior.</strong> It would work for S3 and similar disks, but for local disks, this would result in <code>/path_to_your_application/storage/app/tenant1e22e620-1cb8-11e9-93b6-8d1b78ac0bcd/</code>. That's not what we want. We want <code>/path_to_your_application/storage/tenant1e22e620-1cb8-11e9-93b6-8d1b78ac0bcd/app/</code>.</p>
|
|
||||||
<p>That's what the <code>root_override</code> section is for. <code>%storage_path%</code> gets replaced by <code>storage_path()</code> <em>after</em> tenancy has been initialized. The roots of disks listed in the <code>root_override</code> section of the config will be replaced accordingly. All other disks will be simply suffixed with <code>tenancy.filesystem.suffix_base</code> + the tenant UUID.</p>
|
|
||||||
<p>Since <code>storage_path()</code> will be suffixed, your folder structure will look like this:</p>
|
|
||||||
<p><img src="https://i.imgur.com/GAXQOnN.png" alt="The folder structure" /></p>
|
|
||||||
<p>If you write to these directories, you will need to create them after you create the tenant. See the docs for <a href="http://php.net/function.mkdir">PHP's mkdir</a>.</p>
|
|
||||||
<p>Logs will be saved to <code>storage/logs</code> regardless of any changes to <code>storage_path()</code>.</p>
|
|
||||||
<p>One thing that you <strong>will</strong> have to change if you use storage similarly to the example on the image is your use of the helper function <code>asset()</code> (that is, if you use it).</p>
|
|
||||||
<p>You need to make this change to your code:</p>
|
|
||||||
<pre><code class="language-diff">- asset("storage/images/products/$product_id.png");
|
|
||||||
+ tenant_asset("images/products/$product_id.png");</code></pre>
|
|
||||||
<p>Note that all (public) tenant assets have to be in the <code>app/public/</code> subdirectory of the tenant's storage directory, as shown in the image above.</p>
|
|
||||||
<p>This is what the backend of <code>tenant_asset()</code> returns:</p>
|
|
||||||
<pre><code class="language-php">// TenantAssetsController
|
|
||||||
return response()->file(storage_path('app/public/' . $path));</code></pre>
|
|
||||||
<p>With default filesystem configuration, these two commands are equivalent:</p>
|
|
||||||
<pre><code class="language-php">Storage::disk('public')->put($filename, $data);
|
|
||||||
Storage::disk('local')->put("public/$filename", $data);</code></pre>
|
|
||||||
<p>If you want to store something globally, simply create a new disk and <em>don't</em> add it to the <code>tenancy.filesystem.disks</code> config.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
422
dist/docs/2.x/getting-started/index.html
vendored
|
|
@ -1,422 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Getting started with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Getting Started | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Getting started with stancl/tenancy — A Laravel multi-database tenancy package that respects your code."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/getting-started"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Getting Started | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="getting-started">Getting Started</h1>
|
|
||||||
<p><a href="https://github.com/stancl/tenancy"><strong>stancl/tenancy</strong></a> is a Laravel multi-database tenancy package. It is designed in a way that requires you to make no changes to your codebase. Instead of applying traits on models and replacing every single reference to cache by a reference to a tenant-aware cache, the package lets you write your app without thinking about tenancy. It handles tenancy automatically.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: Filesystem is the only thing that can be a little problematic. Be sure to read <a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy">that page</a>.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h2 id="how-does-it-work">How does it work?</h2>
|
|
||||||
<p>A user visits <code>client1.yourapp.com</code>. The package identifies the tenant who this domain belongs to, and automatically does the following:</p>
|
|
||||||
<ul>
|
|
||||||
<li>switches database connection</li>
|
|
||||||
<li>replaces the default cache manager</li>
|
|
||||||
<li>switches Redis connection</li>
|
|
||||||
<li>changes filesystem root paths</li>
|
|
||||||
</ul>
|
|
||||||
<p>The benefits of this being taken care of by the package are:</p>
|
|
||||||
<ul>
|
|
||||||
<li>separation of concerns: you should write your app, not tenancy implementations</li>
|
|
||||||
<li>reliability: you won't have to fear that you forgot to replace a reference to cache by a tenant-aware cache call. This is something you might worry about if you're implementing tenancy into an existing application.</li>
|
|
||||||
</ul>
|
|
||||||
<h2 id="what-is-multi-tenancy">What is multi-tenancy?</h2>
|
|
||||||
<p>Multi-tenancy is the ability to provide your application to multiple customers (who have their own users and other resources) from a single instance of your application. Think Slack, Shopify, etc.</p>
|
|
||||||
<p>Multi-tenancy can be single-database and multi-database.</p>
|
|
||||||
<p><strong>Single-database tenancy</strong> means that your application uses only a single database. The way this is usually implemented is that instead of having the <code>id</code>, <code>title</code>, <code>user_id</code> and <code>body</code> columns in your <code>posts</code> table, you will also have a <code>tenant_id</code> column. This approach works until you need custom databases for your clients. It's also easy to implement, it basically boils down to having your models use a trait which adds a <a href="https://laravel.com/docs/master/eloquent#global-scopes">global scope</a>.</p>
|
|
||||||
<p><strong>Multi-database tenancy</strong>, the type that this package provides, lets you use a separate database for each tenant. The benefits of this approach are scalability, compliance (some clients need to have the database on their server) and mitigation of risks such as showing the wrong tenant's data to a user. The downside is that this model is harder to implement, which is why this package exists.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
407
dist/docs/2.x/horizon/index.html
vendored
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Horizon Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Horizon Integration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Horizon Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/horizon"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Horizon Integration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Horizon Integration</h1>
|
|
||||||
<blockquote>
|
|
||||||
<p>Make sure your queue is <a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues">correctly configured</a> before using Horizon.</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>Jobs are automatically tagged with the tenant's uuid and domain:</p>
|
|
||||||
<p><img src="https://i.imgur.com/K2oWTJc.png" alt="UUID and domain tags" /></p>
|
|
||||||
<p>You can use these tags to monitor specific tenants' jobs:</p>
|
|
||||||
<p><img src="https://i.imgur.com/qB6veK7.png" alt="Monitoring tags" /></p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
417
dist/docs/2.x/https-certificates/index.html
vendored
|
|
@ -1,417 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="HTTPS Certificates with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="HTTPS Certificates | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="HTTPS Certificates with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>HTTPS Certificates | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>HTTPS certificates</h1>
|
|
||||||
<p>HTTPS certificates are very easy to deal with if you use the <code>yourclient1.yourapp.com</code>, <code>yourclient2.yourapp.com</code> model. You can use a wildcard HTTPS certificate.</p>
|
|
||||||
<p>If you use the model where second level domains are used, there are multiple ways you can solve this.</p>
|
|
||||||
<p>This guide focuses on nginx.</p>
|
|
||||||
<h3>1. Use nginx with the lua module</h3>
|
|
||||||
<p>Specifically, you're interested in the <a href="https://github.com/openresty/lua-nginx-module#ssl_certificate_by_lua_block"><code>ssl_certificate_by_lua_block</code></a> directive. Nginx doesn't support using variables such as the hostname in the <code>ssl_certificate</code> directive, which is why the lua module is needed.</p>
|
|
||||||
<p>This approach lets you use one server block for all tenants.</p>
|
|
||||||
<h3>2. Add a simple server block for each tenant</h3>
|
|
||||||
<p>You can store most of your config in a file, such as <code>/etc/nginx/includes/tenant</code>, and include this file into tenant server blocks.</p>
|
|
||||||
<pre><code class="language-nginx">server {
|
|
||||||
include includes/tenant;
|
|
||||||
server_name foo.bar;
|
|
||||||
# ssl_certificate /etc/foo/...;
|
|
||||||
}</code></pre>
|
|
||||||
<h3>Generating certificates</h3>
|
|
||||||
<p>You can generate a certificate using certbot. If you use the <code>--nginx</code> flag, you will need to run certbot as root. If you use the <code>--webroot</code> flag, you only need the user that runs it to have write access to the webroot directory (or perhaps webroot/.well-known is enough) and some certbot files (you can specify these using --work-dir, --config-dir and --logs-dir).</p>
|
|
||||||
<p>Creating this config dynamically from PHP is not easy, but is probably feasible. Giving <code>www-data</code> write access to <code>/etc/nginx/sites-available/tenants.conf</code> should work.</p>
|
|
||||||
<p>However, you still need to reload nginx configuration to apply the changes to configuration. This is problematic and I'm not sure if there is a simple and secure way to do this from PHP.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
8
dist/docs/2.x/index.html
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en-US">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="refresh" content="0; url=getting-started">
|
|
||||||
<title>stancl/tenancy</title>
|
|
||||||
</head>
|
|
||||||
</html>
|
|
||||||
427
dist/docs/2.x/installation/index.html
vendored
|
|
@ -1,427 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Installing stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Installation | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Installing stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/installation"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Installation | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="getting-started">Installation</h1>
|
|
||||||
<p>Laravel 5.8 or higher is needed.</p>
|
|
||||||
<h3>Require the package via composer</h3>
|
|
||||||
<p>First you need to require the package using composer:</p>
|
|
||||||
<pre><code>composer require stancl/tenancy</code></pre>
|
|
||||||
<h3 id="automatic-installation">Automatic installation</h3>
|
|
||||||
<p>To install the package, simply run</p>
|
|
||||||
<pre><code>php artisan tenancy:install</code></pre>
|
|
||||||
<p>You will be asked if you want to store your data in Redis or a relational database. You can read more about this on the <a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers">Storage Drivers</a> page.</p>
|
|
||||||
<p>This will do all the steps listed in the <a href="#manual-installation">Manual installation</a> section for you.</p>
|
|
||||||
<p>The only thing you have to do now is create a database/Redis connection. Read the <a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers">Storage Drivers</a> page for information about that.</p>
|
|
||||||
<h3 id="manual-installation">Manual installation</h3>
|
|
||||||
<p>If you prefer installing the package manually, you can do that too. It shouldn't take more than a minute either way.</p>
|
|
||||||
<h4>Setting up middleware</h4>
|
|
||||||
<p>Now open <code>app/Http/Kernel.php</code> and make the <code>InitializeTenancy</code> middleware top priority, so that it gets executed before anything else, making sure things like the database switch connections soon enough:</p>
|
|
||||||
<pre><code class="language-php">protected $middlewarePriority = [
|
|
||||||
\Stancl\Tenancy\Middleware\InitializeTenancy::class,
|
|
||||||
// ...
|
|
||||||
];</code></pre>
|
|
||||||
<h4>Creating routes</h4>
|
|
||||||
<p>The package lets you have tenant routes and "exempt" routes. Tenant routes are your application's routes. Exempt routes are routes exempt from tenancy — landing pages, sign up forms, and routes for managing tenants.</p>
|
|
||||||
<p>Routes in <code>routes/web.php</code> are exempt, whereas routes in <code>routes/tenant.php</code> have the <code>InitializeTenancy</code> middleware automatically applied on them.</p>
|
|
||||||
<p>So, to create tenant routes, put those routes in a new file called <code>routes/tenant.php</code>.</p>
|
|
||||||
<h4>Configuration</h4>
|
|
||||||
<p>Run the following:</p>
|
|
||||||
<pre><code>php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=config</code></pre>
|
|
||||||
<p>This creates a <code>config/tenancy.php</code>. You can use it to configure how the package works.</p>
|
|
||||||
<p>Configuration is explained in detail on the <a href="https://tenancy.samuelstancl.me/docs/2.x/configuration">Configuration</a> page.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
402
dist/docs/2.x/integrations/index.html
vendored
|
|
@ -1,402 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Integrating stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Integrations | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Integrating stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/integrations"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Integrations | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="integrations">Integrations</h1>
|
|
||||||
<p>This package naturally integrates well with Laravel packages, since it does not rely on you explicitly specifying database connections.</p>
|
|
||||||
<p>There are some exceptions, though. <a href="https://tenancy.samuelstancl.me/docs/2.x/telescope">Telescope integration</a>, for example, requires you to change the database connection in <code>config/telescope.php</code> to a non-default one, because the default connection is switched to the tenant connection. Some packages should use a central connection for data storage.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
407
dist/docs/2.x/jobs-queues/index.html
vendored
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Jobs & Queues with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Jobs & Queues | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Jobs & Queues with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Jobs & Queues | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="jobs-queues">Jobs & Queues</h1>
|
|
||||||
<p>Jobs are automatically multi-tenant, which means that if a job is dispatched while tenant A is initialized, the job will operate with tenant A's database, cache, filesystem, and Redis.</p>
|
|
||||||
<p><strong>However</strong>, if you're using the <code>database</code> or <code>redis</code> queue driver, you have to make a small tweak to your queue configuration.</p>
|
|
||||||
<p>Open <code>config/queue.php</code> and make sure your queue driver has an explicitly set connection. Otherwise it would use the default one, which would cause issues, since <code>database.default</code> is changed by the package and Redis connections are prefixed.</p>
|
|
||||||
<p><strong>If you're using <code>database</code>, add a new line to <code>queue.connections.database</code>:</strong></p>
|
|
||||||
<pre><code class="language-php">'connection' => 'mysql',</code></pre>
|
|
||||||
<p>where <code>'mysql'</code> is the name of your non-tenant database connection with a <code>jobs</code> table.</p>
|
|
||||||
<p><strong>If you're using Redis, make sure its <code>'connection'</code> is not in <code>tenancy.redis.prefixed_connections</code>.</strong></p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
408
dist/docs/2.x/middleware-configuration/index.html
vendored
|
|
@ -1,408 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Middleware Configuration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Middleware Configuration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Middleware Configuration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Middleware Configuration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="middleware-configuration">Middleware Configuration</h1>
|
|
||||||
<p>When a tenant route is visited and the tenant can't be identified, an exception is thrown. If you want to change this behavior, to a redirect for example, add this to your <code>app/Providers/AppServiceProvider.php</code>'s <code>boot()</code> method:</p>
|
|
||||||
<pre><code class="language-php">// use Stancl\Tenancy\Middleware\InitializeTenancy;
|
|
||||||
|
|
||||||
$this->app->bind(InitializeTenancy::class, function ($app) {
|
|
||||||
return new InitializeTenancy(function ($exception) {
|
|
||||||
// return redirect()->route('foo');
|
|
||||||
});
|
|
||||||
});</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
416
dist/docs/2.x/misc-tips/index.html
vendored
|
|
@ -1,416 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Miscellaneous Tips | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Miscellaneous Tips | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Miscellaneous Tips | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Miscellaneous Tips | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="misc-tips">Miscellaneous Tips</h1>
|
|
||||||
<h2 id="tenant-redirect">Tenant Redirect</h2>
|
|
||||||
<p>A customer has signed up on your website, you have created a new tenant and now you want to redirect the customer to their website. You can use the <code>tenant()</code> method on Redirect, like this:</p>
|
|
||||||
<pre><code class="language-php">// tenant sign up controller
|
|
||||||
return redirect()->route('dashboard')->tenant($tenant['domain']);</code></pre>
|
|
||||||
<h2>Custom ID scheme</h2>
|
|
||||||
<p>If you don't want to use UUIDs and want to use something more human-readable (even domain concatenated with uuid, for example), you can create a custom class for this:</p>
|
|
||||||
<pre><code class="language-php">use Stancl\Tenancy\Interfaces\UniqueIdentifierGenerator;
|
|
||||||
|
|
||||||
class MyUniqueIDGenerator implements UniqueIdentifierGenerator
|
|
||||||
{
|
|
||||||
public static function handle(string $domain, array $data): string
|
|
||||||
{
|
|
||||||
return $domain . \Webpatser\Uuid\Uuid::generate(1, $domain);
|
|
||||||
}
|
|
||||||
}</code></pre>
|
|
||||||
<p>and then set the <code>tenancy.unique_id_generator</code> config to the full path to your class.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
407
dist/docs/2.x/stay-updated/index.html
vendored
|
|
@ -1,407 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Stay Updated | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Stay Updated | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Stay Updated | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Stay Updated | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="stay-updated">Stay Updated</h1>
|
|
||||||
<p>If you'd like to be notified about new versions, you can <a href="https://stancl.github.io/tenancy/#stay-updated">sign up for e-mail notifications</a> or join our <a href="https://t.me/joinchat/AAAAAFjdrbSJg0ZCHTzxLA">Telegram channel</a>.</p>
|
|
||||||
<p>You can choose whether you want to receive emails about major versions and/or minor versions.</p>
|
|
||||||
<ul>
|
|
||||||
<li>Major versions include breaking changes. Composer won't know about these versions and won't update to them. Major versions will be released about once every 6 months.</li>
|
|
||||||
<li>Minor versions include backwards-compatible features and bug fixes.</li>
|
|
||||||
</ul>
|
|
||||||
<!-- todo mailchimp dialog --> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
429
dist/docs/2.x/storage-drivers/index.html
vendored
|
|
@ -1,429 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Storage Drivers of stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Storage Drivers | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Storage Drivers of stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Storage Drivers | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="storage-drivers">Storage Drivers</h1>
|
|
||||||
<p>Storage drivers are used to store a list of all tenants, their domains and any extra information you store about your tenants (e.g. their plan).</p>
|
|
||||||
<p>Currently, database and Redis storage drivers are available as part of the package. However, you can <a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers">write your own</a> (and contribute ❤️) storage drivers.</p>
|
|
||||||
<h2 id="database">Database</h2>
|
|
||||||
<p>The database storage driver lets you store tenant information in a relational database like MySQL, PostgreSQL and SQLite.</p>
|
|
||||||
<p>The benefit of this storage driver is that you don't have to use both Redis and a database for your data. Also you don't have to do as much configuration.</p>
|
|
||||||
<p>To use this driver, you need to have a <code>tenants</code> table. You may also use a custom database connection. By default, <code>tenancy.storage.db.connection</code> is set to <code>central</code>, which means that the <code>central</code> database connection will be used to store tenants. This connection is not automatically created, so you'd have to create it manually. You can create database connections in the <code>config/database.php</code> file.</p>
|
|
||||||
<p>If you'd like to use an existing connection, you can set this config to the name of the connection, e.g. <code>mysql</code>.</p>
|
|
||||||
<p>To create the <code>tenants</code> table, you can use the migration that comes with this package. If you haven't published it during installation, publish it now:</p>
|
|
||||||
<pre><code>php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=migrations</code></pre>
|
|
||||||
<p>By default, all of your data will be stored in the JSON column <code>data</code>. If you want to store some data in a dedicated column (to leverage indexing, for example), add the column to the migration and to <code>tenancy.custom_columns</code> config.</p>
|
|
||||||
<p>Finally, run the migration:</p>
|
|
||||||
<pre><code>php artisan migrate</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>If you use a non-default connection, such as <code>central</code>, you have to specify which DB to migrate using the <code>--database</code> option.</p>
|
|
||||||
<p>If you have existing migrations related to your app in <code>database/migrations</code>, move them to <code>database/migrations/tenant</code>. You can read more about tenant migrations <a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands/#migrate">here</a>.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h2 id="redis">Redis</h2>
|
|
||||||
<p>The Redis storage driver lets you store tenant information in Redis, a high-performance key-value store.</p>
|
|
||||||
<p>The benefit of this storage driver is its performance.</p>
|
|
||||||
<p><strong>Note that you need to configure persistence on your Redis instance if you don't want to lose all information about tenants.</strong></p>
|
|
||||||
<p>Read the <a href="https://redis.io/topics/persistence">Redis documentation page on persistence</a>. You should definitely use AOF and if you want to be even more protected from data loss, you can use RDB <strong>in conjunction with AOF</strong>.</p>
|
|
||||||
<p>If your cache driver is Redis and you don't want to use AOF with it, run two Redis instances. Otherwise, just make sure you use a different database (number) for tenancy and for anything else.</p>
|
|
||||||
<p>To use this driver, create a new Redis connection in the <code>database.redis</code> configuration (<code>config/database.php</code>) called <code>tenancy</code>.</p>
|
|
||||||
<pre><code class="language-php">'tenancy' => [
|
|
||||||
'host' => env('TENANCY_REDIS_HOST', '127.0.0.1'),
|
|
||||||
'password' => env('TENANCY_REDIS_PASSWORD', null),
|
|
||||||
'port' => env('TENANCY_REDIS_PORT', 6380), // different port = separate Redis instance
|
|
||||||
'database' => env('TENANCY_REDIS_DB', 3), // alternatively, different database number
|
|
||||||
],</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
412
dist/docs/2.x/telescope/index.html
vendored
|
|
@ -1,412 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Telescope Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Telescope Integration | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Telescope Integration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/telescope"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Telescope Integration | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Telescope Integration</h1>
|
|
||||||
<p>Requests in Telescope are automatically tagged with the tenant uuid and domain:</p>
|
|
||||||
<p><img src="https://i.imgur.com/CEEluYj.png" alt="Telescope Request with tags" /></p>
|
|
||||||
<p>This lets you filter requests by uuid and domain:</p>
|
|
||||||
<p><img src="https://i.imgur.com/SvbOa7S.png" alt="Filtering by uuid" />
|
|
||||||
<img src="https://i.imgur.com/dCJuEr1.png" alt="Filtering by domain" /></p>
|
|
||||||
<p>If you'd like to set Telescope tags in your own code, e.g. in your <code>AppServiceProvider</code>, replace your <code>Telescope::tag()</code> call like this:</p>
|
|
||||||
<pre><code class="language-php">\Tenancy::integrationEvent('telescope', function ($entry) {
|
|
||||||
return ['abc']; // your logic
|
|
||||||
});</code></pre>
|
|
||||||
<p><img src="https://i.imgur.com/4p1wOiM.png" alt="Tenancy tags merged with tag abc" /></p>
|
|
||||||
<p>Once Telescope 3 is released, you won't have to do this.</p>
|
|
||||||
<p>To have Telescope working, make sure your <code>telescope.storage.database.connection</code> points to a non-tenant connection. It's that way by default, so for most projects, Telescope should work out of the box.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
510
dist/docs/2.x/tenancy-initialization/index.html
vendored
|
|
@ -1,510 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenancy Initialization with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenancy Initialization | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenancy Initialization with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenancy Initialization | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenancy-initialization">Tenancy Initialization</h1>
|
|
||||||
<p>Tenancy can be initialized by calling <code>tenancy()->init()</code>. The <code>InitializeTenancy</code> middleware calls this method automatically.</p>
|
|
||||||
<p>You can end a tenancy session using <code>tenancy()->end()</code>. This is useful if you need to run multiple tenant sessions or a mixed tenant/non-tenant session in a single request/command.</p>
|
|
||||||
<p>The <code>tenancy()->init()</code> method calls <code>bootstrap()</code>.</p>
|
|
||||||
<p>This method switches database connection, Redis connection (if Redis tenancy is enabled), cache and filesystem root paths.</p>
|
|
||||||
<p>This page goes through the code that actually makes this happen. You don't have to read this page to use the package, but it will give you insight into the magic that's happening in the background, so that you can be more confident in it.</p>
|
|
||||||
<h2 id="database-tenancy">Database tenancy</h2>
|
|
||||||
<p><code>bootstrap()</code> runs the following method:</p>
|
|
||||||
<pre><code class="language-php">public function switchDatabaseConnection()
|
|
||||||
{
|
|
||||||
$this->database->connect($this->getDatabaseName());
|
|
||||||
}</code></pre>
|
|
||||||
<p>If <code>tenancy.database_name_key</code> is set and present in the current tenant's data, the <code>getDatabaseName()</code> returns the stored database_name. Otherwise it returns the prefix + uuid + suffix.</p>
|
|
||||||
<pre><code class="language-php">public function getDatabaseName($tenant = []): string
|
|
||||||
{
|
|
||||||
$tenant = $tenant ?: $this->tenant;
|
|
||||||
if ($key = $this->app['config']['tenancy.database_name_key']) {
|
|
||||||
if (isset($tenant[$key])) {
|
|
||||||
return $tenant[$key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->app['config']['tenancy.database.prefix'] . $tenant['uuid'] . $this->app['config']['tenancy.database.suffix'];
|
|
||||||
}</code></pre>
|
|
||||||
<p>This is passed as an argument to the <code>connect()</code> method. This method creates a new database connection and sets it as the default one.</p>
|
|
||||||
<pre><code class="language-php">public function connect(string $database)
|
|
||||||
{
|
|
||||||
$this->createTenantConnection($database);
|
|
||||||
$this->useConnection('tenant');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createTenantConnection(string $database_name)
|
|
||||||
{
|
|
||||||
// Create the `tenant` database connection.
|
|
||||||
$based_on = config('tenancy.database.based_on') ?: config('database.default');
|
|
||||||
config()->set([
|
|
||||||
'database.connections.tenant' => config('database.connections.' . $based_on),
|
|
||||||
]);
|
|
||||||
// Change DB name
|
|
||||||
$database_name = $this->getDriver() === 'sqlite' ? database_path($database_name) : $database_name;
|
|
||||||
config()->set(['database.connections.tenant.database' => $database_name]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function useConnection(string $connection)
|
|
||||||
{
|
|
||||||
// $this->database = Illuminate\Database\DatabaseManager
|
|
||||||
$this->database->setDefaultConnection($connection);
|
|
||||||
$this->database->reconnect($connection);
|
|
||||||
}</code></pre>
|
|
||||||
<h2 id="redis-tenancy">Redis tenancy</h2>
|
|
||||||
<p>The <code>bootstrap()</code> method calls <code>setPhpRedisPrefix()</code> if <code>tenancy.redis.tenancy</code> is <code>true</code>.</p>
|
|
||||||
<p>This method cycles through the <code>tenancy.redis.prefixed_connections</code> and sets their prefix to <code>tenancy.redis.prefix_base</code> + uuid.</p>
|
|
||||||
<pre><code class="language-php">public function setPhpRedisPrefix($connections = ['default'])
|
|
||||||
{
|
|
||||||
// [...]
|
|
||||||
foreach ($connections as $connection) {
|
|
||||||
$prefix = $this->app['config']['tenancy.redis.prefix_base'] . $this->tenant['uuid'];
|
|
||||||
$client = Redis::connection($connection)->client();
|
|
||||||
try {
|
|
||||||
// [...]
|
|
||||||
$client->setOption($client::OPT_PREFIX, $prefix);
|
|
||||||
} catch (\Throwable $t) {
|
|
||||||
throw new PhpRedisNotInstalledException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}</code></pre>
|
|
||||||
<h2 id="cache-tenancy">Cache tenancy</h2>
|
|
||||||
<p><code>bootstrap()</code> calls <code>tagCache()</code> which replaces the <code>'cache'</code> key in the service container with a different <code>CacheManager</code>.</p>
|
|
||||||
<pre><code class="language-php">public function tagCache()
|
|
||||||
{
|
|
||||||
// [...]
|
|
||||||
$this->app->extend('cache', function () {
|
|
||||||
return new \Stancl\Tenancy\CacheManager($this->app);
|
|
||||||
});
|
|
||||||
}</code></pre>
|
|
||||||
<p>This <code>CacheManager</code> forwards all calls to the inner store, but also adds tag which "scope" the cache and allow for selective cache clearing:</p>
|
|
||||||
<pre><code class="language-php">class CacheManager extends BaseCacheManager
|
|
||||||
{
|
|
||||||
public function __call($method, $parameters)
|
|
||||||
{
|
|
||||||
$tags = [config('tenancy.cache.tag_base') . tenant('uuid')];
|
|
||||||
if ($method === 'tags') {
|
|
||||||
if (\count($parameters) !== 1) {
|
|
||||||
throw new \Exception("Method tags() takes exactly 1 argument. {count($parameters)} passed.");
|
|
||||||
}
|
|
||||||
$names = $parameters[0];
|
|
||||||
$names = (array) $names; // cache()->tags('foo') https://laravel.com/docs/5.7/cache#removing-tagged-cache-items
|
|
||||||
return $this->store()->tags(\array_merge($tags, $names));
|
|
||||||
}
|
|
||||||
return $this->store()->tags($tags)->$method(...$parameters);
|
|
||||||
}
|
|
||||||
}</code></pre>
|
|
||||||
<h2 id="filesystem-tenancy">Filesystem tenancy</h2>
|
|
||||||
<p><code>bootstrap()</code> calls <code>suffiexFilesystemRootPaths()</code>. This method changes <code>storage_path()</code> and the roots of disks listed in <code>config('tenancy.filesystem.disks)</code>. You can read more about this on the <a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy">Filesystem Tenancy</a> page.</p>
|
|
||||||
<pre><code class="language-php">public function suffixFilesystemRootPaths()
|
|
||||||
{
|
|
||||||
// [...]
|
|
||||||
$suffix = $this->app['config']['tenancy.filesystem.suffix_base'] . tenant('uuid');
|
|
||||||
// storage_path()
|
|
||||||
$this->app->useStoragePath($old['path'] . "/{$suffix}");
|
|
||||||
// Storage facade
|
|
||||||
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {
|
|
||||||
// [...]
|
|
||||||
if ($root = \str_replace('%storage_path%', storage_path(), $this->app['config']["tenancy.filesystem.root_override.{$disk}"])) {
|
|
||||||
Storage::disk($disk)->getAdapter()->setPathPrefix($root);
|
|
||||||
} else {
|
|
||||||
$root = $this->app['config']["filesystems.disks.{$disk}.root"];
|
|
||||||
Storage::disk($disk)->getAdapter()->setPathPrefix($root . "/{$suffix}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// [...]
|
|
||||||
}</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
467
dist/docs/2.x/tenant-manager/index.html
vendored
|
|
@ -1,467 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenant Manager | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenant Manager | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenant Manager | stancl/tenancy — A Laravel multi-database tenancy package that respects your code."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenant Manager | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenant-manager">Tenant Manager</h1>
|
|
||||||
<p>This page documents a couple of other <code>TenantManager</code> methods you may find useful.</p>
|
|
||||||
<h3>Finding tenant using UUID</h3>
|
|
||||||
<p><code>find()</code> is an alias for <code>getTenantById()</code>. You may use the second argument to specify the key(s) as a string/array.</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->find('dbe0b330-1a6e-11e9-b4c3-354da4b4f339');
|
|
||||||
=> [
|
|
||||||
"uuid" => "dbe0b330-1a6e-11e9-b4c3-354da4b4f339",
|
|
||||||
"domain" => "localhost",
|
|
||||||
"foo" => "bar",
|
|
||||||
]
|
|
||||||
>>> tenant()->find('dbe0b330-1a6e-11e9-b4c3-354da4b4f339', 'foo');
|
|
||||||
=> [
|
|
||||||
"foo" => "bar",
|
|
||||||
]
|
|
||||||
>>> tenant()->getTenantById('dbe0b330-1a6e-11e9-b4c3-354da4b4f339', ['foo', 'domain']);
|
|
||||||
=> [
|
|
||||||
"foo" => "bar",
|
|
||||||
"domain" => "localhost",
|
|
||||||
]</code></pre>
|
|
||||||
<h3>Getting tenant ID by domain</h3>
|
|
||||||
<pre><code class="language-php">>>> tenant()->getTenantIdByDomain('localhost');
|
|
||||||
=> "b3ce3f90-1a88-11e9-a6b0-038c6337ae50"
|
|
||||||
>>> tenant()->getIdByDomain('localhost');
|
|
||||||
=> "b3ce3f90-1a88-11e9-a6b0-038c6337ae50"</code></pre>
|
|
||||||
<h3>Finding tenant by domain</h3>
|
|
||||||
<p>You may use the second argument to specify the key(s) as a string/array.</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->findByDomain('localhost');
|
|
||||||
=> [
|
|
||||||
"uuid" => "b3ce3f90-1a88-11e9-a6b0-038c6337ae50",
|
|
||||||
"domain" => "localhost",
|
|
||||||
]</code></pre>
|
|
||||||
<h3>Accessing the array</h3>
|
|
||||||
<p>You can access the public array tenant of TenantManager like this:</p>
|
|
||||||
<pre><code class="language-php">tenancy()->tenant</code></pre>
|
|
||||||
<p>which is an array. If you want to get the value of a specific key from the array, you can use one of the helpers the key on the tenant array as an argument.</p>
|
|
||||||
<pre><code class="language-php">tenant('uuid'); // Does the same thing as tenant()->tenant['uuid']</code></pre>
|
|
||||||
<h3>Getting all tenants</h3>
|
|
||||||
<p>This method returns a collection of arrays.</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->all();
|
|
||||||
=> Illuminate\Support\Collection {#2980
|
|
||||||
all: [
|
|
||||||
[
|
|
||||||
"uuid" => "32e20780-1a88-11e9-a051-4b6489a7edac",
|
|
||||||
"domain" => "localhost",
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"uuid" => "49670df0-1a87-11e9-b7ba-cf5353777957",
|
|
||||||
"domain" => "dev.localhost",
|
|
||||||
],
|
|
||||||
],
|
|
||||||
}
|
|
||||||
>>> tenant()->all()->pluck('domain');
|
|
||||||
=> Illuminate\Support\Collection {#2983
|
|
||||||
all: [
|
|
||||||
"localhost",
|
|
||||||
"dev.localhost",
|
|
||||||
],
|
|
||||||
}</code></pre>
|
|
||||||
<h3>Deleting a tenant</h3>
|
|
||||||
<pre><code class="language-php">>>> tenant()->delete('dbe0b330-1a6e-11e9-b4c3-354da4b4f339');
|
|
||||||
=> true
|
|
||||||
>>> tenant()->delete(tenant()->getTenantIdByDomain('dev.localhost'));
|
|
||||||
=> true
|
|
||||||
>>> tenant()->delete(tenant()->findByDomain('localhost')['uuid']);
|
|
||||||
=> true</code></pre>
|
|
||||||
<p>This doesn't delete the tenant's database. If you want to delete it, save the database name prior to deleting the tenant. You can get the database name using <code>getDatabaseName()</code></p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->getDatabaseName(tenant()->findByDomain('laravel.localhost'))
|
|
||||||
=> "tenant67412a60-1c01-11e9-a9e9-f799baa56fd9"</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
416
dist/docs/2.x/tenant-routes/index.html
vendored
|
|
@ -1,416 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenant routes with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenant Routes | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenant routes with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenant Routes | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenant-routes">Tenant Routes</h1>
|
|
||||||
<p>Routes within <code>routes/tenant.php</code> will have the <code>web</code> middleware group and the <code>IntializeTenancy</code> middleware automatically applied on them. This middleware attempts to identify the tenant based on the current hostname. Once the tenant is identified, the database connection, cache, filesystem root paths and, optionally, Redis connection, will be switched.</p>
|
|
||||||
<p>Just like <code>routes/web.php</code>, these routes use the <code>App\Http\Controllers</code> namespace.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>If a tenant cannot be identified, anexception will be thrown. If you want to change this behavior (to a redirect, for example) read the <a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration">Middleware Configuration</a> page.</p>
|
|
||||||
</blockquote>
|
|
||||||
<h2 id="exempt-routes">Exempt routes</h2>
|
|
||||||
<p>Routes outside the <code>routes/tenant.php</code> file will not have the tenancy middleware automatically applied on them. You can apply this middleware manually, though.</p>
|
|
||||||
<p>If you want some of your, say, API routes to be multi-tenant, simply wrap them in a Route group with this middleware:</p>
|
|
||||||
<pre><code class="language-php">use Stancl\Tenancy\Middleware\InitializeTenancy;
|
|
||||||
|
|
||||||
Route::middleware(InitializeTenancy::class)->group(function () {
|
|
||||||
// Route::get('/', 'HelloWorld');
|
|
||||||
});</code></pre>
|
|
||||||
<h2 id="using-the-same-routes-for-tenant-and-non-tenant-parts-of-the-application">Using the same routes for tenant and non-tenant parts of the application</h2>
|
|
||||||
<p>The <code>Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains</code> middleware makes sure 404 is returned when a user attempts to visit a web route on a tenant (non-exempt) domain.</p>
|
|
||||||
<p>The install command applies this middleware to the <code>web</code> group. If you want to do this for another route group, add this middleware manually to that group. You can do this in <code>app/Http/Kernel.php</code>.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
427
dist/docs/2.x/tenant-storage/index.html
vendored
|
|
@ -1,427 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Tenant storage with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Tenant Storage | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Tenant storage with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Tenant Storage | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="tenant-storage">Tenant Storage</h1>
|
|
||||||
<p>Tenant storage is where tenants' uuids and domains are stored. You can store things like the tenant's plan, subscription information, and tenant-specific application configuration in tenant storage. You can use these functions:</p>
|
|
||||||
<pre><code class="language-php">get (string|array $key, string $uuid = null) // $uuid defaults to the current tenant's UUID
|
|
||||||
put (string|array $key, mixed $value = null, string $uuid = null) // if $key is array, make sure $value is null</code></pre>
|
|
||||||
<p>To put something into the tenant storage, you can use <code>put()</code> or <code>set()</code>.</p>
|
|
||||||
<pre><code class="language-php">tenancy()->put($key, $value);
|
|
||||||
tenancy()->set($key, $value); // alias for put()
|
|
||||||
tenancy()->put($key, $value, $uuid);
|
|
||||||
tenancy()->put(['key1' => 'value1', 'key2' => 'value2']);
|
|
||||||
tenancy()->put(['key1' => 'value1', 'key2' => 'value2'], null, $uuid);</code></pre>
|
|
||||||
<p>To get something from the storage, you can use <code>get()</code>:</p>
|
|
||||||
<pre><code class="language-php">tenancy()->get($key);
|
|
||||||
tenancy()->get($key, $uuid);
|
|
||||||
tenancy()->get(['key1', 'key2']);</code></pre>
|
|
||||||
<blockquote>
|
|
||||||
<p>Note: <code>tenancy()->get(['key1', 'key2'])</code> returns an array with values only</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>Note that $key has to be a string or an array with string keys. The value(s) can be of any data type. Example with arrays:</p>
|
|
||||||
<pre><code class="language-php">>>> tenant()->put('foo', ['a' => 'b', 'c' => 'd']);
|
|
||||||
=> [ // put() returns the supplied value(s)
|
|
||||||
"a" => "b",
|
|
||||||
"c" => "d",
|
|
||||||
]
|
|
||||||
>>> tenant()->get('foo');
|
|
||||||
=> [
|
|
||||||
"a" => "b",
|
|
||||||
"c" => "d",
|
|
||||||
]</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
406
dist/docs/2.x/usage/index.html
vendored
|
|
@ -1,406 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Usage | stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Usage | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Usage | stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/usage"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Usage | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1 id="usage">Usage</h1>
|
|
||||||
<p>This chapter describes usage of the package. That includes creating tenants, deleting tenants, storing data in the tenant storage.</p>
|
|
||||||
<p>Most pages will use the <code>tenancy()</code> helper function. This package comes with two helpers - <code>tenancy()</code> and <code>tenant()</code>. They do the same thing, so you can use the one that reads better given its context.</p>
|
|
||||||
<p><code>tenant()->create()</code> reads better than <code>tenancy()->create()</code>, but <code>tenancy()->init()</code> reads better than <code>tenant()->init()</code>.</p>
|
|
||||||
<p>You can pass an argument to the helper function to get a value out of the tenant storage. <code>tenant('plan')</code> is identical to <a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"><code>tenant()->get('plan')</code></a>.</p>
|
|
||||||
<p>The package also comes with two facades. <code>Tenancy</code> and <code>Tenant</code>. Use what feels the best.</p>
|
|
||||||
<p>Both the helpers and the facades resolve the <code>TenantManager</code> from the service container.</p> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
464
dist/docs/2.x/writing-storage-drivers/index.html
vendored
|
|
@ -1,464 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="Writing Storage Drivers with stancl/tenancy — A Laravel multi-database tenancy package that respects your code..">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="Writing Storage Drivers | stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="Writing Storage Drivers with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>Writing Storage Drivers | stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
selected
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button class="flex justify-center items-center bg-blue border border-blue h-10 mr-4 px-5 rounded-full lg:hidden focus:outline-none"
|
|
||||||
onclick="navMenu.toggle()"
|
|
||||||
>
|
|
||||||
<svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="fill-current text-white h-9 w-4" viewBox="0 0 32 32"
|
|
||||||
>
|
|
||||||
<path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30"
|
|
||||||
>
|
|
||||||
<polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<section class="container max-w-4xl mx-auto px-6 md:px-8 py-4">
|
|
||||||
<div class="flex flex-col lg:flex-row">
|
|
||||||
<nav id="js-nav-menu" class="nav-menu hidden lg:block">
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/getting-started"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/installation"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Installation
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/storage-drivers"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
This Package vs Others
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/usage"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Usage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/creating-tenants"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Creating Tenants
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-routes"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Routes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-storage"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Storage
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenant-manager"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenant Manager
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/console-commands"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Console Commands
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/digging-deeper"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Digging Deeper
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Middleware Configuration
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/custom-database-names"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Custom Database Names
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Filesystem Tenancy
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/jobs-queues"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Jobs & Queues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/event-system"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Event System
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Tenancy Initialization
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/application-testing"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Application Testing
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers"
|
|
||||||
class="lvl1 active font-semibold text-blue nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Writing Storage Drivers
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/development"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Development
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/integrations"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Integrations
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/telescope"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Telescope
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/horizon"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Horizon
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<p class="nav-menu__item text-grey-dark">Tips</p>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-reset my-0">
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https-certificates"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
HTTPS Certificates
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/misc-tips"
|
|
||||||
class="lvl1 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Misc
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/stay-updated"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
Stay Updated
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li class="list-reset pl-4">
|
|
||||||
|
|
||||||
<a href="https://tenancy.samuelstancl.me/docs/2.x/https://github.com/stancl/tenancy"
|
|
||||||
class="lvl0 nav-menu__item hover:text-blue"
|
|
||||||
>
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="w-full lg:w-3/5 break-words pb-16 lg:pl-4" v-pre>
|
|
||||||
<h1>Writing Storage Drivers</h1>
|
|
||||||
<p>If you don't want to use the provided DB/Redis storage drivers, you can write your own driver.</p>
|
|
||||||
<p>To create a driver, create a class that implements the <code>Stancl\Tenancy\Interfaces\StorageDriver</code> interface.</p>
|
|
||||||
<p>For historical reasons, the <code>TenantManager</code> will try to json encode/decode data coming from the storage driver. If you want to avoid this, set <code>public $useJson = false;</code>. That will make <code>TenantManager</code> encode/decode only <code>put()</code> and <code>get()</code> data, so that data types can be stored correctly.</p>
|
|
||||||
<p>The DB storage driver has <code>public $useJson = false;</code>, while the Redis storage driver doesn't use this property, so it's false by default.</p>
|
|
||||||
<p>Here's an example:</p>
|
|
||||||
<pre><code class="language-php">
|
|
||||||
namespace App\StorageDrivers\MongoDBStorageDriver;
|
|
||||||
|
|
||||||
use Stancl\Tenancy\Interfaces\StorageDriver;
|
|
||||||
|
|
||||||
class MongoDBStorageDriver implements StorageDriver
|
|
||||||
{
|
|
||||||
public $useJson = false;
|
|
||||||
|
|
||||||
public function identifyTenant(string $domain): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAllTenants(array $uuids = []): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTenantById(string $uuid, array $fields = []): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTenantIdByDomain(string $domain): ?string
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createTenant(string $domain, string $uuid): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deleteTenant(string $uuid): bool
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get(string $uuid, string $key)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMany(string $uuid, array $keys): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function put(string $uuid, string $key, $value)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function putMany(string $uuid, array $values): array
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}</code></pre> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const navMenu = {
|
|
||||||
toggle() {
|
|
||||||
const menu = document.getElementById('js-nav-menu');
|
|
||||||
menu.classList.toggle('hidden');
|
|
||||||
menu.classList.toggle('lg:block');
|
|
||||||
document.getElementById('js-nav-menu-hide').classList.toggle('hidden');
|
|
||||||
document.getElementById('js-nav-menu-show').classList.toggle('hidden');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
100
dist/docs/404/index.html
vendored
|
|
@ -1,100 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="description" content="A Laravel multi-database tenancy package that respects your code.">
|
|
||||||
|
|
||||||
<meta property="og:site_name" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:title" content="stancl/tenancy documentation"/>
|
|
||||||
<meta property="og:description" content="A Laravel multi-database tenancy package that respects your code."/>
|
|
||||||
<meta property="og:url" content="https://tenancy.samuelstancl.me/docs/404"/>
|
|
||||||
<meta property="og:image" content="/assets/img/logo.png"/>
|
|
||||||
<meta property="og:type" content="website"/>
|
|
||||||
|
|
||||||
<meta name="twitter:image:alt" content="stancl/tenancy documentation">
|
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
|
||||||
|
|
||||||
|
|
||||||
<title>stancl/tenancy documentation</title>
|
|
||||||
|
|
||||||
<link rel="home" href="https://tenancy.samuelstancl.me/docs">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Insert analytics code here -->
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="/assets/build/css/main.css?id=0e3d47a146ef55ad0760">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-screen bg-grey-lightest text-grey-darkest leading-normal font-sans">
|
|
||||||
<header class="flex items-center shadow bg-white border-b h-24 mb-8 py-4" role="banner">
|
|
||||||
<div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<a href="/" title="stancl/tenancy documentation home" class="inline-flex items-center">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 class="text-lg md:text-2xl text-blue-darkest font-semibold hover:text-blue-dark my-0 pr-4">stancl/tenancy documentation</h1>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-1 justify-end items-center text-right md:pl-10">
|
|
||||||
<select id="versionSelect">
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs1.x"
|
|
||||||
>
|
|
||||||
1.x
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="/https://tenancy.samuelstancl.me/docs2.x"
|
|
||||||
>
|
|
||||||
2.x (beta)
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main role="main" class="w-full flex-auto">
|
|
||||||
<div class="flex flex-col items-center mt-32 text-grey-darker">
|
|
||||||
<h1 class="text-6xl font-light leading-none mb-2">404</h1>
|
|
||||||
|
|
||||||
<h2 class="text-3xl">Page not found</h2>
|
|
||||||
|
|
||||||
<hr class="block w-full max-w-sm mx-auto my-8 border">
|
|
||||||
|
|
||||||
<p class="text-xl">
|
|
||||||
Need to update this page? See the <a title="404 Page Documentation" href="https://jigsaw.tighten.co/docs/custom-404-page/"> Jigsaw documentation</a>.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="/assets/build/js/main.js?id=559633482baac87a89b5"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<footer class="bg-white text-center text-sm mt-12 py-4" role="contentinfo">
|
|
||||||
<ul class="flex flex-col md:flex-row justify-center list-reset">
|
|
||||||
<li class="md:mr-2">
|
|
||||||
© <a href="https://github.com/stancl" title="Samuel Štancl">Samuel Štancl</a> 2019.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Built with <a href="http://jigsaw.tighten.co" title="Jigsaw by Tighten">Jigsaw</a>
|
|
||||||
and <a href="https://tailwindcss.com" title="Tailwind CSS, a utility-first CSS framework">Tailwind CSS</a>.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</footer>
|
|
||||||
<script>
|
|
||||||
document.getElementById('versionSelect').addEventListener('change', function () {
|
|
||||||
window.location = document.getElementById('versionSelect').value;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
2
dist/docs/assets/build/css/main.css
vendored
1
dist/docs/assets/build/css/main.css.map
vendored
2
dist/docs/assets/build/js/main.js
vendored
1
dist/docs/assets/build/js/main.js.map
vendored
5
dist/docs/assets/build/mix-manifest.json
vendored
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"/js/main.js": "/js/main.js?id=559633482baac87a89b5",
|
|
||||||
"/css/main.css": "/css/main.css?id=0e3d47a146ef55ad0760",
|
|
||||||
"/js/main.js.map": "/js/main.js.map?id=b4e687f67eff50c3fe64"
|
|
||||||
}
|
|
||||||
BIN
dist/docs/assets/images/jigsaw.png
vendored
|
Before Width: | Height: | Size: 25 KiB |
BIN
dist/docs/assets/img/docsearch.png
vendored
|
Before Width: | Height: | Size: 73 KiB |
16
dist/docs/assets/img/icon-stack.svg
vendored
|
|
@ -1,16 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="51px" height="44px" viewBox="0 0 51 44" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
|
||||||
<title>Group 7</title>
|
|
||||||
<desc>Created with Sketch.</desc>
|
|
||||||
<defs></defs>
|
|
||||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g id="04-docs-start-copy-3" transform="translate(-816.000000, -695.000000)">
|
|
||||||
<g id="Group-7" transform="translate(816.000000, 695.000000)">
|
|
||||||
<path d="M25.1572266,19.5799762 L1.12512399,31.5016008 L25.1572266,43.4232253 L49.1893291,31.5016008 L25.1572266,19.5799762 Z" id="Rectangle-3-Copy-3" stroke="#318AD3"></path>
|
|
||||||
<path d="M25.1572266,10.5986098 L1.12512399,22.5202343 L25.1572266,34.4418588 L49.1893291,22.5202343 L25.1572266,10.5986098 Z" id="Rectangle-3-Copy-5" stroke="#748294"></path>
|
|
||||||
<path d="M25.1572266,0.558141166 L1.12512399,12.4797657 L25.1572266,24.4013902 L49.1893291,12.4797657 L25.1572266,0.558141166 Z" id="Rectangle-3-Copy-6" stroke="#318AD3"></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB |
15
dist/docs/assets/img/icon-terminal.svg
vendored
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="37px" height="34px" viewBox="0 0 37 34" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
|
||||||
<title>terminal</title>
|
|
||||||
<desc>Created with Sketch.</desc>
|
|
||||||
<defs></defs>
|
|
||||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<g id="04-docs-start-copy-3" transform="translate(-497.000000, -699.000000)">
|
|
||||||
<g id="terminal" transform="translate(497.000000, 700.000000)">
|
|
||||||
<polyline id="Shape" stroke="#318AD3" points="0 27 14 13.5 0 0"></polyline>
|
|
||||||
<path d="M18,32 L36,32" id="Shape" stroke="#748294"></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 856 B |
20
dist/docs/assets/img/icon-window.svg
vendored
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="38px" height="31px" viewBox="0 0 38 31" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
|
||||||
<title>Group 6</title>
|
|
||||||
<desc>Created with Sketch.</desc>
|
|
||||||
<defs></defs>
|
|
||||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g id="04-docs-start-copy-3" transform="translate(-170.000000, -702.000000)" fill-rule="nonzero">
|
|
||||||
<g id="Group-6" transform="translate(170.000000, 702.000000)">
|
|
||||||
<rect id="Rectangle-2" stroke="#318AD3" x="0.5" y="0.5" width="37" height="30" rx="3"></rect>
|
|
||||||
<rect id="Rectangle-8" stroke="#318AD3" x="0.5" y="6.5" width="37" height="1"></rect>
|
|
||||||
<rect id="Rectangle-8" stroke="#748294" x="8.5" y="23.5" width="9" height="1"></rect>
|
|
||||||
<rect id="Rectangle-8" stroke="#748294" x="8.5" y="25.5" width="9" height="1"></rect>
|
|
||||||
<rect id="Rectangle-8" stroke="#748294" x="21.5" y="23.5" width="9" height="1"></rect>
|
|
||||||
<rect id="Rectangle-8" stroke="#748294" x="21.5" y="25.5" width="9" height="1"></rect>
|
|
||||||
<rect id="Rectangle-9" stroke="#748294" x="5.5" y="11.5" width="26" height="6"></rect>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB |
34
dist/docs/assets/img/logo-large.svg
vendored
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="318px" height="350px" viewBox="0 0 318 350" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
|
||||||
<title>Group 2</title>
|
|
||||||
<desc>Created with Sketch.</desc>
|
|
||||||
<defs>
|
|
||||||
<linearGradient x1="-83.2348064%" y1="106.401351%" x2="140.023112%" y2="-13.2029998%" id="linearGradient-1">
|
|
||||||
<stop stop-color="#F8FAFC" offset="0%"></stop>
|
|
||||||
<stop stop-color="#F8FAFC" offset="21.7972142%"></stop>
|
|
||||||
<stop stop-color="#BBDBF5" offset="100%"></stop>
|
|
||||||
<stop stop-color="#B9DAF5" offset="100%"></stop>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g id="04-docs-start-copy-3" transform="translate(-714.000000, -205.000000)">
|
|
||||||
<g id="Group-2" transform="translate(714.000000, 205.000000)">
|
|
||||||
<path d="M159.9,41.23566 L29.5,106.216315 L29.5,268.671884 L159.9,333.652539 L290.3,268.671884 L290.3,106.216315 L159.9,41.23566 Z" id="Rectangle-3-Copy" stroke="#B9DAF5"></path>
|
|
||||||
<polygon id="Rectangle-3-Copy-2" fill="url(#linearGradient-1)" points="129.8 186.334516 129.8 349.670807 0 284.336291 0 121"></polygon>
|
|
||||||
<path d="M317.3,186.64261 L188.5,121.811441 L188.5,284.028197 L317.3,348.859366 L317.3,186.64261 Z" id="Rectangle-3-Copy-4" stroke="#338CD6" transform="translate(252.900000, 235.335404) scale(1, -1) translate(-252.900000, -235.335404) "></path>
|
|
||||||
<path d="M159.9,41.2359725 L30.1185393,106.090062 L159.9,170.944152 L289.681461,106.090062 L159.9,41.2359725 Z" id="Rectangle-3" stroke="#B9DAF5"></path>
|
|
||||||
<path d="M159.9,0.558953879 L30.1185393,65.4130435 L159.9,130.267133 L289.681461,65.4130435 L159.9,0.558953879 Z" id="Rectangle-3-Copy-3" stroke="#338CD6"></path>
|
|
||||||
<path d="M160.175,170.953416 L160.175,332.562112" id="Line" stroke="#B9DAF5" stroke-linecap="square" fill-rule="nonzero"></path>
|
|
||||||
<path d="M160.358333,130.484509 L160.358333,165.798482" id="Line-2-Copy-3" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero"></path>
|
|
||||||
<path d="M290.158333,68.178117 L290.158333,103.49209" id="Line-2-Copy-4" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero"></path>
|
|
||||||
<path d="M133.55,185.742236 L159.95,172.549689" id="Line-2" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero"></path>
|
|
||||||
<path d="M133.55,348.742236 L159.95,335.549689" id="Line-2-Copy" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero"></path>
|
|
||||||
<path d="M292.35,283.586957 L318.75,270.39441" id="Line-2" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero" transform="translate(305.550000, 276.990683) scale(1, -1) translate(-305.550000, -276.990683) "></path>
|
|
||||||
<path d="M162.55,348.742236 L188.95,335.549689" id="Line-2-Copy-2" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero" transform="translate(175.750000, 342.145963) scale(1, -1) translate(-175.750000, -342.145963) "></path>
|
|
||||||
<path d="M291.55,119.742236 L317.95,106.549689" id="Line-2-Copy" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero" transform="translate(304.750000, 113.145963) scale(1, -1) translate(-304.750000, -113.145963) "></path>
|
|
||||||
<path d="M162.55,185.742236 L188.95,172.549689" id="Line-2-Copy-5" stroke="#C7CFDA" stroke-linecap="square" stroke-dasharray="2,4" fill-rule="nonzero" transform="translate(175.750000, 179.145963) scale(1, -1) translate(-175.750000, -179.145963) "></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 3.8 KiB |
BIN
dist/docs/assets/img/logo.png
vendored
|
Before Width: | Height: | Size: 551 B |
12
dist/docs/assets/img/logo.svg
vendored
|
|
@ -1,12 +0,0 @@
|
||||||
<svg width="40px" height="45px" viewBox="0 0 40 45" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<defs></defs>
|
|
||||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g id="04-docs-start" transform="translate(-170.000000, -28.000000)">
|
|
||||||
<g id="Group" transform="translate(170.000000, 28.000000)">
|
|
||||||
<polygon id="Rectangle-3-Copy" fill="#338CD6" points="20 0 40 10 40 35 20 45 0 35 0 10"></polygon>
|
|
||||||
<polygon id="Rectangle-3-Copy-2" fill="#1C3E5A" points="20 20 20 45 0 35 0 10"></polygon>
|
|
||||||
<polygon id="Rectangle-3" fill="#B9DAF5" points="20 0 40 10 20 20 0 10"></polygon>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 762 B |
8
dist/docs/assets/img/magnifying-glass.svg
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
<svg width="13px" height="13px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<defs></defs>
|
|
||||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g transform="translate(-829.000000, -42.000000)" fill="#748294" fill-rule="nonzero">
|
|
||||||
<path d="M843.319857,54.9056439 L848.707107,60.2928932 C849.097631,60.6834175 849.097631,61.3165825 848.707107,61.7071068 C848.316582,62.0976311 847.683418,62.0976311 847.292893,61.7071068 L841.905644,56.3198574 C840.55096,57.3729184 838.848711,58 837,58 C832.581722,58 829,54.418278 829,50 C829,45.581722 832.581722,42 837,42 C841.418278,42 845,45.581722 845,50 C845,51.8487115 844.372918,53.5509601 843.319857,54.9056439 Z M837,56 C840.313708,56 843,53.3137085 843,50 C843,46.6862915 840.313708,44 837,44 C833.686292,44 831,46.6862915 831,50 C831,53.3137085 833.686292,56 837,56 Z" id="Mask"></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 971 B |
BIN
dist/docs/favicon.ico
vendored
|
Before Width: | Height: | Size: 2.3 KiB |
8
dist/docs/index.html
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en-US">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="refresh" content="0; url=https://tenancy.samuelstancl.me/docs/1.x">
|
|
||||||
<title>stancl/tenancy</title>
|
|
||||||
</head>
|
|
||||||
</html>
|
|
||||||
288
dist/docs/sitemap.xml
vendored
|
|
@ -1,288 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/application-testing</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/configuration</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/console-commands</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/creating-tenants</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/custom-database-names</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/development</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/difference-between-this-package-and-others</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/digging-deeper</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/event-system</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/filesystem-tenancy</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/getting-started</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/horizon</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/https-certificates</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs1.x</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/installation</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/integrations</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/jobs-queues</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/middleware-configuration</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/misc-tips</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/stay-updated</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/storage-drivers</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/telescope</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/tenancy-initialization</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/tenant-manager</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/tenant-routes</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/tenant-storage</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/usage</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/1.x/writing-storage-drivers</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/application-testing</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/configuration</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/console-commands</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/creating-tenants</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/custom-database-names</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/development</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/difference-between-this-package-and-others</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/digging-deeper</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/event-system</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/filesystem-tenancy</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/getting-started</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/horizon</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/https-certificates</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs2.x</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/installation</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/integrations</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/jobs-queues</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/middleware-configuration</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/misc-tips</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/stay-updated</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/storage-drivers</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/telescope</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/tenancy-initialization</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/tenant-manager</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/tenant-routes</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/tenant-storage</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/usage</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs/2.x/writing-storage-drivers</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://tenancy.samuelstancl.me/docs</loc>
|
|
||||||
<lastmod>2019-09-18T16:31:30+02:00</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
</urlset>
|
|
||||||
|
|
@ -17,7 +17,7 @@ This lets you configure the driver for tenant storage, i.e. what will be used to
|
||||||
|
|
||||||
Available storage drivers:
|
Available storage drivers:
|
||||||
- `Stancl\Tenancy\StorageDrivers\RedisStorageDriver`
|
- `Stancl\Tenancy\StorageDrivers\RedisStorageDriver`
|
||||||
- `Stancl\Tenancy\StorageDrivers\DatabaseStorageDriver`
|
- `Stancl\Tenancy\StorageDrivers\Database\DatabaseStorageDriver`
|
||||||
|
|
||||||
### `tenant_route_namespace` {#tenant-route-namespace}
|
### `tenant_route_namespace` {#tenant-route-namespace}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
[build]
|
[build]
|
||||||
environment = { PHP_VERSION = "7.2" }
|
environment = { PHP_VERSION = "7.2" }
|
||||||
publish = "/dist"
|
publish = "/dist"
|
||||||
command = "./build.sh"
|
command = "./build.sh"
|
||||||
|
|
||||||
|
[[redirects]]
|
||||||
|
from = "/docs/master/*"
|
||||||
|
to = "/docs/2.x/:splat"
|
||||||