Update dependencies and to new Inertia share format

This commit is contained in:
Jonathan Reinink 2019-08-10 09:12:50 -04:00
parent 4b8849ac43
commit 9626b9b0e0
3 changed files with 112 additions and 64 deletions

View File

@ -35,9 +35,9 @@ class AppServiceProvider extends ServiceProvider
return md5_file(public_path('mix-manifest.json'));
});
Inertia::share(function () {
return [
'auth' => [
Inertia::share([
'auth' => function () {
return [
'user' => Auth::user() ? [
'id' => Auth::user()->id,
'first_name' => Auth::user()->first_name,
@ -49,15 +49,19 @@ class AppServiceProvider extends ServiceProvider
'name' => Auth::user()->account->name,
],
] : null,
],
'flash' => [
];
},
'flash' => function () {
return [
'success' => Session::get('success'),
],
'errors' => Session::get('errors')
];
},
'errors' => function () {
return Session::get('errors')
? Session::get('errors')->getBag('default')->getMessages()
: (object) [],
];
});
: (object) [];
},
]);
}
protected function registerGlide()

66
composer.lock generated
View File

@ -507,12 +507,12 @@
"source": {
"type": "git",
"url": "https://github.com/inertiajs/inertia-laravel.git",
"reference": "9e68492dac3bae0e0fc6fe5bfc237b3b8105c755"
"reference": "5b5f9b38d83c6dd20fd18b04c948149408d850ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/9e68492dac3bae0e0fc6fe5bfc237b3b8105c755",
"reference": "9e68492dac3bae0e0fc6fe5bfc237b3b8105c755",
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/5b5f9b38d83c6dd20fd18b04c948149408d850ce",
"reference": "5b5f9b38d83c6dd20fd18b04c948149408d850ce",
"shasum": ""
},
"require-dev": {
@ -550,7 +550,7 @@
"inertia",
"laravel"
],
"time": "2019-08-08T14:19:31+00:00"
"time": "2019-08-10T12:37:10+00:00"
},
{
"name": "intervention/image",
@ -3310,8 +3310,8 @@
"authors": [
{
"name": "Tijs Verkoyen",
"email": "css_to_inline_styles@verkoyen.eu",
"role": "Developer"
"role": "Developer",
"email": "css_to_inline_styles@verkoyen.eu"
}
],
"description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.",
@ -3794,20 +3794,20 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.9.1",
"version": "1.9.2",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72"
"reference": "8d0a041a565fc1e927e75f1d1bea5f34edf6e7d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72",
"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8d0a041a565fc1e927e75f1d1bea5f34edf6e7d1",
"reference": "8d0a041a565fc1e927e75f1d1bea5f34edf6e7d1",
"shasum": ""
},
"require": {
"php": "^7.1"
"php": "^7.2"
},
"replace": {
"myclabs/deep-copy": "self.version"
@ -3815,6 +3815,8 @@
"require-dev": {
"doctrine/collections": "^1.0",
"doctrine/common": "^2.6",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.9.4",
"phpunit/phpunit": "^7.1"
},
"type": "library",
@ -3838,7 +3840,7 @@
"object",
"object graph"
],
"time": "2019-04-07T13:18:21+00:00"
"time": "2019-08-09T12:38:39+00:00"
},
{
"name": "nunomaduro/collision",
@ -3942,18 +3944,18 @@
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
"role": "Developer",
"email": "arne@blankerts.de"
},
{
"name": "Sebastian Heuer",
"email": "sebastian@phpeople.de",
"role": "Developer"
"role": "Developer",
"email": "sebastian@phpeople.de"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "Developer"
"role": "Developer",
"email": "sebastian@phpunit.de"
}
],
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
@ -3989,18 +3991,18 @@
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
"role": "Developer",
"email": "arne@blankerts.de"
},
{
"name": "Sebastian Heuer",
"email": "sebastian@phpeople.de",
"role": "Developer"
"role": "Developer",
"email": "sebastian@phpeople.de"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "Developer"
"role": "Developer",
"email": "sebastian@phpunit.de"
}
],
"description": "Library for handling version information and constraints",
@ -4271,8 +4273,8 @@
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
"role": "lead",
"email": "sebastian@phpunit.de"
}
],
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
@ -4322,8 +4324,8 @@
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
"role": "lead",
"email": "sebastian@phpunit.de"
}
],
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
@ -4364,8 +4366,8 @@
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
"role": "lead",
"email": "sebastian@phpunit.de"
}
],
"description": "Simple template engine.",
@ -5115,8 +5117,8 @@
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
"role": "lead",
"email": "sebastian@phpunit.de"
}
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",

86
package-lock.json generated
View File

@ -1402,6 +1402,12 @@
"integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==",
"dev": true
},
"async-limiter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==",
"dev": true
},
"atob": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
@ -3176,9 +3182,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.221",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.221.tgz",
"integrity": "sha512-YbNA7KgCvLq9ZaEa7wpYP7IP4LrJ4+b36oeF1lYBSJ0zVGVN7uo3Ct9qDUm/M3VDOWj03RVgsMFF8PdL8UjhzA==",
"version": "1.3.222",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.222.tgz",
"integrity": "sha512-Kv3rvtJELafNfgVBVNaDIdV0aWV7O1RlYqqAhg+s+OwpiXFYPsIvONYgAopmR/gpyxSYbHi0EKJmPOvaL7UzMg==",
"dev": true
},
"elliptic": {
@ -4088,7 +4094,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -4109,12 +4116,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4129,17 +4138,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -4256,7 +4268,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -4268,6 +4281,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -4282,6 +4296,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -4289,12 +4304,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -4313,6 +4330,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4393,7 +4411,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -4405,6 +4424,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -4490,7 +4510,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -4526,6 +4547,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -4545,6 +4567,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -4588,12 +4611,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@ -5202,7 +5227,7 @@
"dev": true
},
"inertia": {
"version": "github:inertiajs/inertia#f29224a1d8fb909dfccb869702067f4806343689",
"version": "github:inertiajs/inertia#d0fc74fb85525d2fa1c1ed05439ad23b5943c1b1",
"from": "github:inertiajs/inertia",
"dev": true,
"requires": {
@ -5215,7 +5240,7 @@
"from": "github:inertiajs/inertia-vue",
"dev": true,
"requires": {
"inertia": "github:inertiajs/inertia#f29224a1d8fb909dfccb869702067f4806343689"
"inertia": "github:inertiajs/inertia"
}
},
"infer-owner": {
@ -10233,9 +10258,9 @@
}
},
"webpack-dev-server": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.7.2.tgz",
"integrity": "sha512-mjWtrKJW2T9SsjJ4/dxDC2fkFVUw8jlpemDERqV0ZJIkjjjamR2AbQlr3oz+j4JLhYCHImHnXZK5H06P2wvUew==",
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.8.0.tgz",
"integrity": "sha512-Hs8K9yI6pyMvGkaPTeTonhD6JXVsigXDApYk9JLW4M7viVBspQvb1WdAcWxqtmttxNW4zf2UFLsLNe0y87pIGQ==",
"dev": true,
"requires": {
"ansi-html": "0.0.7",
@ -10251,23 +10276,25 @@
"import-local": "^2.0.0",
"internal-ip": "^4.3.0",
"ip": "^1.1.5",
"is-absolute-url": "^3.0.0",
"killable": "^1.0.1",
"loglevel": "^1.6.3",
"opn": "^5.5.0",
"p-retry": "^3.0.1",
"portfinder": "^1.0.20",
"portfinder": "^1.0.21",
"schema-utils": "^1.0.0",
"selfsigned": "^1.10.4",
"semver": "^6.1.1",
"semver": "^6.3.0",
"serve-index": "^1.9.1",
"sockjs": "0.3.19",
"sockjs-client": "1.3.0",
"spdy": "^4.0.0",
"spdy": "^4.0.1",
"strip-ansi": "^3.0.1",
"supports-color": "^6.1.0",
"url": "^0.11.0",
"webpack-dev-middleware": "^3.7.0",
"webpack-log": "^2.0.0",
"ws": "^6.2.1",
"yargs": "12.0.5"
},
"dependencies": {
@ -10286,6 +10313,12 @@
"ms": "^2.1.1"
}
},
"is-absolute-url": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.0.tgz",
"integrity": "sha512-3OkP8XrM2Xq4/IxsJnClfMp3OaM3TAatLPLKPeWcxLBTrpe6hihwtX+XZfJTcXg/FTRi4qjy0y/C5qiyNxY24g==",
"dev": true
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@ -10501,6 +10534,15 @@
"integrity": "sha1-wlLXx8WxtAKJdjDjRTx7/mkNnKE=",
"dev": true
},
"ws": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
"dev": true,
"requires": {
"async-limiter": "~1.0.0"
}
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",