Replace provide/inject with new $page property

This commit is contained in:
Jonathan Reinink 2019-05-15 09:06:24 -04:00
parent a4c502e64d
commit 279a38798b
4 changed files with 97 additions and 95 deletions

45
composer.lock generated
View File

@ -427,12 +427,12 @@
"source": {
"type": "git",
"url": "https://github.com/inertiajs/inertia-laravel.git",
"reference": "110ea11509d90e9c4e0005e3b2636fe7d81f786a"
"reference": "13bc1e0802a0d6d590fc3f3a0e865817a8f70f02"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/110ea11509d90e9c4e0005e3b2636fe7d81f786a",
"reference": "110ea11509d90e9c4e0005e3b2636fe7d81f786a",
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/13bc1e0802a0d6d590fc3f3a0e865817a8f70f02",
"reference": "13bc1e0802a0d6d590fc3f3a0e865817a8f70f02",
"shasum": ""
},
"require": {
@ -471,7 +471,7 @@
"inertia",
"laravel"
],
"time": "2019-05-08T13:48:08+00:00"
"time": "2019-05-14T09:33:16+00:00"
},
{
"name": "jakub-onderka/php-console-color",
@ -563,16 +563,16 @@
},
{
"name": "laravel/framework",
"version": "v5.8.16",
"version": "v5.8.17",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "83d57f9f9162ab476c43b9ec00d463ff12c578fd"
"reference": "33c04dd2a431adeeb49926a4f2b20590cc033ca2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/83d57f9f9162ab476c43b9ec00d463ff12c578fd",
"reference": "83d57f9f9162ab476c43b9ec00d463ff12c578fd",
"url": "https://api.github.com/repos/laravel/framework/zipball/33c04dd2a431adeeb49926a4f2b20590cc033ca2",
"reference": "33c04dd2a431adeeb49926a4f2b20590cc033ca2",
"shasum": ""
},
"require": {
@ -706,7 +706,7 @@
"framework",
"laravel"
],
"time": "2019-05-07T14:37:11+00:00"
"time": "2019-05-14T16:02:41+00:00"
},
{
"name": "laravel/tinker",
@ -1718,16 +1718,16 @@
},
{
"name": "symfony/contracts",
"version": "v1.0.2",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/contracts.git",
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf"
"reference": "d3636025e8253c6144358ec0a62773cae588395b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf",
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf",
"url": "https://api.github.com/repos/symfony/contracts/zipball/d3636025e8253c6144358ec0a62773cae588395b",
"reference": "d3636025e8253c6144358ec0a62773cae588395b",
"shasum": ""
},
"require": {
@ -1735,19 +1735,22 @@
},
"require-dev": {
"psr/cache": "^1.0",
"psr/container": "^1.0"
"psr/container": "^1.0",
"symfony/polyfill-intl-idn": "^1.10"
},
"suggest": {
"psr/cache": "When using the Cache contracts",
"psr/container": "When using the Service contracts",
"symfony/cache-contracts-implementation": "",
"symfony/event-dispatcher-implementation": "",
"symfony/http-client-contracts-implementation": "",
"symfony/service-contracts-implementation": "",
"symfony/translation-contracts-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "1.1-dev"
}
},
"autoload": {
@ -1782,7 +1785,7 @@
"interoperability",
"standards"
],
"time": "2018-12-05T08:06:11+00:00"
"time": "2019-04-27T14:29:50+00:00"
},
{
"name": "symfony/css-selector",
@ -4106,16 +4109,16 @@
},
{
"name": "phpunit/phpunit",
"version": "7.5.9",
"version": "7.5.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "134669cf0eeac3f79bc7f0c793efbc158bffc160"
"reference": "64cb33f5b520da490a7b13149d39b43cf3c890c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/134669cf0eeac3f79bc7f0c793efbc158bffc160",
"reference": "134669cf0eeac3f79bc7f0c793efbc158bffc160",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/64cb33f5b520da490a7b13149d39b43cf3c890c6",
"reference": "64cb33f5b520da490a7b13149d39b43cf3c890c6",
"shasum": ""
},
"require": {
@ -4186,7 +4189,7 @@
"testing",
"xunit"
],
"time": "2019-04-19T15:50:46+00:00"
"time": "2019-05-14T04:53:02+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",

133
package-lock.json generated
View File

@ -846,9 +846,9 @@
"dev": true
},
"@types/node": {
"version": "12.0.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.0.tgz",
"integrity": "sha512-Jrb/x3HT4PTJp6a4avhmJCDEVrPdqLfl3e8GGMbpkGGdwAV5UGlIs4vVEfsHHfylZVOKZWpOqmqFH8CbfOZ6kg==",
"version": "12.0.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz",
"integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==",
"dev": true
},
"@types/q": {
@ -1486,15 +1486,15 @@
}
},
"babel-loader": {
"version": "8.0.5",
"resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.5.tgz",
"integrity": "sha512-NTnHnVRd2JnRqPC0vW+iOQWU5pchDbYXsG2E6DMXEpMfUcQKclF9gmf3G3ZMhzG7IG9ji4coL0cm+FxeWxDpnw==",
"version": "8.0.6",
"resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz",
"integrity": "sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw==",
"dev": true,
"requires": {
"find-cache-dir": "^2.0.0",
"loader-utils": "^1.0.2",
"mkdirp": "^0.5.1",
"util.promisify": "^1.0.0"
"pify": "^4.0.1"
}
},
"babel-merge": {
@ -1838,14 +1838,14 @@
}
},
"browserslist": {
"version": "4.5.6",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.6.tgz",
"integrity": "sha512-o/hPOtbU9oX507lIqon+UvPYqpx3mHc8cV3QemSBTXwkG8gSQSK6UKvXcE/DcleU3+A59XTUHyCvZ5qGy8xVAg==",
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.0.tgz",
"integrity": "sha512-Jk0YFwXBuMOOol8n6FhgkDzn3mY9PYLYGk29zybF05SbRTsMgPqmTNeQQhOghCxq5oFqAXE3u4sYddr4C0uRhg==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30000963",
"electron-to-chromium": "^1.3.127",
"node-releases": "^1.1.17"
"caniuse-lite": "^1.0.30000967",
"electron-to-chromium": "^1.3.133",
"node-releases": "^1.1.19"
}
},
"buffer": {
@ -2030,9 +2030,9 @@
"dev": true
},
"chokidar": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz",
"integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==",
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz",
"integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==",
"dev": true,
"requires": {
"anymatch": "^2.0.0",
@ -2416,14 +2416,14 @@
"dev": true
},
"cosmiconfig": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz",
"integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
"integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==",
"dev": true,
"requires": {
"import-fresh": "^2.0.0",
"is-directory": "^0.3.1",
"js-yaml": "^3.13.0",
"js-yaml": "^3.13.1",
"parse-json": "^4.0.0"
},
"dependencies": {
@ -3128,9 +3128,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.133",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.133.tgz",
"integrity": "sha512-lyoC8aoqbbDqsprb6aPdt9n3DpOZZzdz/T4IZKsR0/dkZIxnJVUjjcpOSwA66jPRIOyDAamCTAUqweU05kKNSg==",
"version": "1.3.134",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.134.tgz",
"integrity": "sha512-C3uK2SrtWg/gSWaluLHWSHjyebVZCe4ZC0NVgTAoTq8tCR9FareRK5T7R7AS/nPZShtlEcjVMX1kQ8wi4nU68w==",
"dev": true
},
"elliptic": {
@ -5154,7 +5154,7 @@
"dev": true
},
"inertia": {
"version": "github:inertiajs/inertia#65d51180879f9626855e7f623132f864f748354e",
"version": "github:inertiajs/inertia#9e4c326b717943da29eedbb0939c8131f385c025",
"from": "github:inertiajs/inertia",
"dev": true,
"requires": {
@ -5163,11 +5163,11 @@
}
},
"inertia-vue": {
"version": "github:inertiajs/inertia-vue#238261939fd51c2ccbdf8bcabd064c0fef7f6a35",
"version": "github:inertiajs/inertia-vue#8e418a8cf23514250c62d156249e560a20125321",
"from": "github:inertiajs/inertia-vue",
"dev": true,
"requires": {
"inertia": "github:inertiajs/inertia#65d51180879f9626855e7f623132f864f748354e"
"inertia": "github:inertiajs/inertia#9e4c326b717943da29eedbb0939c8131f385c025"
}
},
"inflight": {
@ -6255,9 +6255,9 @@
"dev": true
},
"neo-async": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz",
"integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==",
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
"dev": true
},
"nice-try": {
@ -6343,9 +6343,9 @@
}
},
"node-releases": {
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.18.tgz",
"integrity": "sha512-/mnVgm6u/8OwlIsoyRXtTI0RfQcxZoAZbdwyXap0EeWwcOpDDymyCHM2/aR9XKmHXrvizHoPAOs0pcbiJ6RUaA==",
"version": "1.1.19",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.19.tgz",
"integrity": "sha512-SH/B4WwovHbulIALsQllAVwqZZD1kPmKCqrhGfR29dXjLAVZMHvBjD3S6nL9D/J9QkmZ1R92/0wCMDKXUUvyyA==",
"dev": true,
"requires": {
"semver": "^5.3.0"
@ -7863,9 +7863,9 @@
}
},
"range-parser": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz",
"integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
"dev": true
},
"raw-body": {
@ -7970,9 +7970,9 @@
"dev": true
},
"regenerate-unicode-properties": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz",
"integrity": "sha512-SbA/iNrBUf6Pv2zU8Ekv1Qbhv92yxL4hiDa2siuxs4KKn4oOoMDHXjAf7+Nz9qinUQ46B1LcWEi/PhJfPWpZWQ==",
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz",
"integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==",
"dev": true,
"requires": {
"regenerate": "^1.4.0"
@ -8275,9 +8275,9 @@
}
},
"rxjs": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
"integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
@ -9056,9 +9056,9 @@
}
},
"table": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz",
"integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==",
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/table/-/table-5.3.3.tgz",
"integrity": "sha512-3wUNCgdWX6PNpOe3amTTPWPuF6VGvgzjKCaO1snFj0z7Y3mUPWf5+zDtxUVGispJkDECPmR29wbzh6bVMOHbcw==",
"dev": true,
"requires": {
"ajv": "^6.9.1",
@ -9163,19 +9163,20 @@
}
},
"terser-webpack-plugin": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.2.3.tgz",
"integrity": "sha512-GOK7q85oAb/5kE12fMuLdn2btOS9OBZn4VsecpHDywoUC/jLhSAKOiYo0ezx7ss2EXPMzyEWFoE0s1WLE+4+oA==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.2.4.tgz",
"integrity": "sha512-64IiILNQlACWZLzFlpzNaG0bpQ4ytaB7fwOsbpsdIV70AfLUmIGGeuKL0YV2WmtcrURjE2aOvHD4/lrFV3Rg+Q==",
"dev": true,
"requires": {
"cacache": "^11.0.2",
"cacache": "^11.3.2",
"find-cache-dir": "^2.0.0",
"is-wsl": "^1.1.0",
"schema-utils": "^1.0.0",
"serialize-javascript": "^1.4.0",
"serialize-javascript": "^1.7.0",
"source-map": "^0.6.1",
"terser": "^3.16.1",
"webpack-sources": "^1.1.0",
"worker-farm": "^1.5.2"
"terser": "^3.17.0",
"webpack-sources": "^1.3.0",
"worker-farm": "^1.7.0"
},
"dependencies": {
"schema-utils": {
@ -9626,9 +9627,9 @@
"dev": true
},
"v8-compile-cache": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz",
"integrity": "sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz",
"integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==",
"dev": true
},
"vary": {
@ -9638,9 +9639,9 @@
"dev": true
},
"vendors": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz",
"integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.3.tgz",
"integrity": "sha512-fOi47nsJP5Wqefa43kyWSg80qF+Q3XA6MUkgi7Hp1HQaKDQW4cQrK2D0P7mmbFtsV1N89am55Yru/nyEwRubcw==",
"dev": true
},
"vm-browserify": {
@ -9760,9 +9761,9 @@
}
},
"webpack": {
"version": "4.30.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.30.0.tgz",
"integrity": "sha512-4hgvO2YbAFUhyTdlR4FNyt2+YaYBYHavyzjCMbZzgglo02rlKi/pcsEzwCuCpsn1ryzIl1cq/u8ArIKu8JBYMg==",
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.31.0.tgz",
"integrity": "sha512-n6RVO3X0LbbipoE62akME9K/JI7qYrwwufs20VvgNNpqUoH4860KkaxJTbGq5bgkVZF9FqyyTG/0WPLH3PVNJA==",
"dev": true,
"requires": {
"@webassemblyjs/ast": "1.8.5",
@ -9824,14 +9825,14 @@
}
},
"webpack-dev-middleware": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.6.2.tgz",
"integrity": "sha512-A47I5SX60IkHrMmZUlB0ZKSWi29TZTcPz7cha1Z75yYOsgWh/1AcPmQEbC8ZIbU3A1ytSv1PMU0PyPz2Lmz2jg==",
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.0.tgz",
"integrity": "sha512-qvDesR1QZRIAZHOE3iQ4CXLZZSQ1lAUsSpnQmlB1PBfoN/xdRjmge3Dok0W4IdaVLJOGJy3sGI4sZHwjRU0PCA==",
"dev": true,
"requires": {
"memory-fs": "^0.4.1",
"mime": "^2.3.1",
"range-parser": "^1.0.3",
"mime": "^2.4.2",
"range-parser": "^1.2.1",
"webpack-log": "^2.0.0"
},
"dependencies": {

View File

@ -36,7 +36,6 @@ export default {
props: {
errors: Object,
},
inject: ['page'],
data() {
return {
sending: false,
@ -48,7 +47,7 @@ export default {
}
},
mounted() {
document.title = `Login | ${this.page.props.app.name}`
document.title = `Login | ${this.$page.app.name}`
},
methods: {
submit() {

View File

@ -16,17 +16,17 @@
</dropdown>
</div>
<div class="bg-white border-b w-full p-4 md:py-0 md:px-12 text-sm md:text-base flex justify-between items-center">
<div class="mt-1 mr-4">{{ page.props.auth.user.account.name }}</div>
<div class="mt-1 mr-4">{{ $page.auth.user.account.name }}</div>
<dropdown class="mt-1" placement="bottom-end">
<div class="flex items-center cursor-pointer select-none group">
<div class="text-grey-darkest group-hover:text-indigo-dark focus:text-indigo-dark mr-1 whitespace-no-wrap">
<span>{{ page.props.auth.user.first_name }}</span>
<span class="hidden md:inline">{{ page.props.auth.user.last_name }}</span>
<span>{{ $page.auth.user.first_name }}</span>
<span class="hidden md:inline">{{ $page.auth.user.last_name }}</span>
</div>
<icon class="w-5 h-5 group-hover:fill-indigo-dark fill-grey-darkest focus:fill-indigo-dark" name="cheveron-down" />
</div>
<div slot="dropdown" class="mt-2 py-2 shadow-lg bg-white rounded text-sm">
<inertia-link class="block px-6 py-2 hover:bg-indigo hover:text-white" :href="route('users.edit', page.props.auth.user.id)">My Profile</inertia-link>
<inertia-link class="block px-6 py-2 hover:bg-indigo hover:text-white" :href="route('users.edit', $page.auth.user.id)">My Profile</inertia-link>
<inertia-link class="block px-6 py-2 hover:bg-indigo hover:text-white" :href="route('users')">Manage Users</inertia-link>
<inertia-link class="block px-6 py-2 hover:bg-indigo hover:text-white" :href="route('logout')" method="post">Logout</inertia-link>
</div>
@ -59,7 +59,6 @@ export default {
Logo,
MainMenu,
},
inject: ['page'],
props: {
title: String,
},
@ -79,7 +78,7 @@ export default {
},
methods: {
updatePageTitle(title) {
document.title = title ? `${title} | ${this.page.props.app.name}` : this.page.props.app.name
document.title = title ? `${title} | ${this.$page.app.name}` : this.$page.app.name
},
hideDropdownMenus() {
this.showUserMenu = false