From f92c646ae94681dcf3e12a6fc02eac29328cfb15 Mon Sep 17 00:00:00 2001 From: Abrar Ahmad Date: Mon, 25 Jul 2022 13:56:13 +0500 Subject: [PATCH] sail notes --- source/assets/build/js/extsb.js | 2 +- source/assets/build/js/extsb.js.map | 2 +- source/docs/v3/configuration.blade.md | 1 + source/docs/v3/quickstart.blade.md | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/assets/build/js/extsb.js b/source/assets/build/js/extsb.js index bc2d422..9167ccd 100644 --- a/source/assets/build/js/extsb.js +++ b/source/assets/build/js/extsb.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=2)}({2:function(e,t,n){e.exports=n("j7ye")},j7ye:function(e,t,n){"use strict";n.r(t);var r="undefined"!=typeof window,o=[],i=function(){r&&!window.splitbee||(a.track=window.splitbee.track,a.user=window.splitbee.user,a.enableCookie=window.splitbee.enableCookie,a.reset=window.splitbee.reset,o.forEach((function(e){"track"===e.type?window.splitbee.track.apply(null,e.payload):"user"===e.type?window.splitbee.user.set.apply(null,e.payload):"enableCookie"===e.type?window.splitbee.enableCookie.apply(null,e.payload):"reset"===e.type&&window.splitbee.reset()})),o=[])},l=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),l=0;l {\n window.location.replace('https://github.com/tenancy-for-laravel/saas-boilerplate');\n });\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@splitbee/web/dist/web.esm.js","webpack:///./source/_assets/js/extsb.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isBrowser","window","queue","handleLoad","splitbee","track","user","enableCookie","reset","forEach","ev","type","apply","payload","set","createAddToQueue","_len","arguments","length","args","Array","_key","push","Promise","resolve","e","reject","init","options","document","scriptUrl","injectedScript","querySelector","onload","script","createElement","src","async","apiUrl","dataset","api","token","disableCookie","noCookie","head","appendChild","auth","username","location","replace","userId","substr"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,W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IAAI,CACdoC,OAAQH,EAASI,OAAO,KAD5B,SAEW,WACPlD,OAAO+C,SAASC,QAAQ","file":"/js/extsb.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","var isBrowser = typeof window !== 'undefined';\nvar SCRIPT_URL = 'https://cdn.splitbee.io/sb.js';\nvar queue = [];\n\nvar handleLoad = function handleLoad() {\n if (isBrowser && !window.splitbee) return;\n splitbee.track = window.splitbee.track;\n splitbee.user = window.splitbee.user;\n splitbee.enableCookie = window.splitbee.enableCookie;\n splitbee.reset = window.splitbee.reset;\n queue.forEach(function (ev) {\n if (ev.type === 'track') window.splitbee.track.apply(null, ev.payload);else if (ev.type === 'user') window.splitbee.user.set.apply(null, ev.payload);else if (ev.type === 'enableCookie') window.splitbee.enableCookie.apply(null, ev.payload);else if (ev.type === 'reset') window.splitbee.reset();\n });\n queue = [];\n};\n\nvar createAddToQueue = function createAddToQueue(type) {\n return function () {\n try {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n queue.push({\n type: type,\n payload: args\n });\n\n if (isBrowser && window.splitbee) {\n handleLoad();\n }\n\n return Promise.resolve();\n } catch (e) {\n return Promise.reject(e);\n }\n };\n};\n\nvar initSplitbee = function initSplitbee(options) {\n if (!isBrowser || window.splitbee) return;\n var document = window.document;\n var scriptUrl = options !== null && options !== void 0 && options.scriptUrl ? options.scriptUrl : SCRIPT_URL;\n var injectedScript = document.querySelector(\"script[src='\" + scriptUrl + \"']\");\n\n if (injectedScript) {\n injectedScript.onload = handleLoad;\n return;\n }\n\n var script = document.createElement('script');\n script.src = scriptUrl;\n script.async = true;\n\n if (options) {\n if (options.apiUrl) script.dataset.api = options.apiUrl;\n if (options.token) script.dataset.token = options.token;\n if (options.disableCookie) script.dataset.noCookie = '1';\n }\n\n script.onload = handleLoad;\n document.head.appendChild(script);\n};\n\nvar splitbee = {\n track: /*#__PURE__*/createAddToQueue('track'),\n user: {\n set: /*#__PURE__*/createAddToQueue('user')\n },\n init: initSplitbee,\n enableCookie: /*#__PURE__*/createAddToQueue('enableCookie'),\n reset: /*#__PURE__*/createAddToQueue('reset')\n};\n\nexport default splitbee;\n//# sourceMappingURL=web.esm.js.map\n","import splitbee from '@splitbee/web';\n\nsplitbee.init({\n scriptUrl: \"https://tenancyforlaravel.com/bee.js\",\n apiUrl: \"https://tenancyforlaravel.com/_hive\",\n})\n\nwindow.auth = function (username) {\n if (! username) return window.location.replace('https://github.com/tenancy-for-laravel/saas-boilerplate');\n\n splitbee.user.set({\n userId: username.substr(1),\n }).finally(() => {\n window.location.replace('https://github.com/tenancy-for-laravel/saas-boilerplate');\n });\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/source/docs/v3/configuration.blade.md b/source/docs/v3/configuration.blade.md index ba4d1aa..1f0d90f 100644 --- a/source/docs/v3/configuration.blade.md +++ b/source/docs/v3/configuration.blade.md @@ -60,6 +60,7 @@ The list of domains that host your [central app]({{ $page->link('the-two-applica This config array lets you enable, disable or add your own [tenancy bootstrappers]({{ $page->link('tenancy-bootstrappers') }}). ### Database {#database} +> Note: If you're using Laravel [Sail](https://laravel.com/docs/9.x/sail), ensure that `DB_USERNAME` has the necessary permissions to create databases. You can grant access to users by running the following command in MySQL console `grant create on *.* to 'sail'@'%';`. `tenancy.database.*` diff --git a/source/docs/v3/quickstart.blade.md b/source/docs/v3/quickstart.blade.md index c95a833..1e8367f 100644 --- a/source/docs/v3/quickstart.blade.md +++ b/source/docs/v3/quickstart.blade.md @@ -176,6 +176,8 @@ To have users in tenant databases, let's move the `users` table migration (the f ## Creating tenants {#creating-tenants} +> Note: If you're using Laravel [Sail](https://laravel.com/docs/9.x/sail), ensure that `DB_USERNAME` has the necessary permissions to create databases. You can grant access to users by running the following command in MySQL console `grant create on *.* to 'sail'@'%';`. + For testing purposes, we'll create a tenant in `tinker` — no need to waste time creating controllers and views for now. ```php