Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a18f643b
authored
May 22, 2019
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to new Inertia::share() callback
1 parent
f61d969a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
31 deletions
app/Providers/AppServiceProvider.php
composer.lock
app/Providers/AppServiceProvider.php
View file @
a18f643
...
@@ -28,30 +28,31 @@ class AppServiceProvider extends ServiceProvider
...
@@ -28,30 +28,31 @@ class AppServiceProvider extends ServiceProvider
Inertia
::
version
(
function
()
{
Inertia
::
version
(
function
()
{
return
md5_file
(
public_path
(
'mix-manifest.json'
));
return
md5_file
(
public_path
(
'mix-manifest.json'
));
});
});
Inertia
::
share
(
'app.name'
,
Config
::
get
(
'app.name'
));
Inertia
::
share
(
'flash'
,
function
()
{
Inertia
::
share
(
function
()
{
return
[
return
[
'success'
=>
Session
::
get
(
'success'
),
'app'
=>
[
'name'
=>
Config
::
get
(
'app.name'
),
],
'auth'
=>
[
'user'
=>
Auth
::
user
()
?
[
'id'
=>
Auth
::
user
()
->
id
,
'first_name'
=>
Auth
::
user
()
->
first_name
,
'last_name'
=>
Auth
::
user
()
->
last_name
,
'email'
=>
Auth
::
user
()
->
email
,
'role'
=>
Auth
::
user
()
->
role
,
'account'
=>
[
'id'
=>
Auth
::
user
()
->
account
->
id
,
'name'
=>
Auth
::
user
()
->
account
->
name
,
],
]
:
null
,
],
'flash'
=>
[
'success'
=>
Session
::
get
(
'success'
),
],
'errors'
=>
Session
::
get
(
'errors'
)
?
Session
::
get
(
'errors'
)
->
getBag
(
'default'
)
->
getMessages
()
:
(
object
)
[],
];
];
});
});
Inertia
::
share
(
'errors'
,
function
()
{
return
Session
::
get
(
'errors'
)
?
Session
::
get
(
'errors'
)
->
getBag
(
'default'
)
->
getMessages
()
:
(
object
)
[];
});
Inertia
::
share
(
'auth.user'
,
function
()
{
if
(
Auth
::
user
())
{
return
[
'id'
=>
Auth
::
user
()
->
id
,
'first_name'
=>
Auth
::
user
()
->
first_name
,
'last_name'
=>
Auth
::
user
()
->
last_name
,
'email'
=>
Auth
::
user
()
->
email
,
'role'
=>
Auth
::
user
()
->
role
,
'account'
=>
[
'id'
=>
Auth
::
user
()
->
account
->
id
,
'name'
=>
Auth
::
user
()
->
account
->
name
,
],
];
}
});
$this
->
registerLengthAwarePaginator
();
$this
->
registerLengthAwarePaginator
();
$this
->
registerCarbonMarcos
();
$this
->
registerCarbonMarcos
();
...
...
composer.lock
View file @
a18f643
...
@@ -216,16 +216,16 @@
...
@@ -216,16 +216,16 @@
},
},
{
{
"name": "egulias/email-validator",
"name": "egulias/email-validator",
"version": "2.1.
7
",
"version": "2.1.
8
",
"source": {
"source": {
"type": "git",
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
"url": "https://github.com/egulias/EmailValidator.git",
"reference": "
709f21f92707308cdf8f9bcfa1af4cb26586521e
"
"reference": "
c26463ff9241f27907112fbcd0c86fa670cfef98
"
},
},
"dist": {
"dist": {
"type": "zip",
"type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/
709f21f92707308cdf8f9bcfa1af4cb26586521e
",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/
c26463ff9241f27907112fbcd0c86fa670cfef98
",
"reference": "
709f21f92707308cdf8f9bcfa1af4cb26586521e
",
"reference": "
c26463ff9241f27907112fbcd0c86fa670cfef98
",
"shasum": ""
"shasum": ""
},
},
"require": {
"require": {
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
"validation",
"validation",
"validator"
"validator"
],
],
"time": "201
8-12-04T22:38:2
4+00:00"
"time": "201
9-05-16T22:02:5
4+00:00"
},
},
{
{
"name": "erusev/parsedown",
"name": "erusev/parsedown",
...
@@ -427,12 +427,12 @@
...
@@ -427,12 +427,12 @@
"source": {
"source": {
"type": "git",
"type": "git",
"url": "https://github.com/inertiajs/inertia-laravel.git",
"url": "https://github.com/inertiajs/inertia-laravel.git",
"reference": "
1c9acd0f69587013c2c24889f6b67ef0c31e0233
"
"reference": "
cb019592946bc939f61291039b8e893da66dd6eb
"
},
},
"dist": {
"dist": {
"type": "zip",
"type": "zip",
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/
1c9acd0f69587013c2c24889f6b67ef0c31e0233
",
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/
cb019592946bc939f61291039b8e893da66dd6eb
",
"reference": "
1c9acd0f69587013c2c24889f6b67ef0c31e0233
",
"reference": "
cb019592946bc939f61291039b8e893da66dd6eb
",
"shasum": ""
"shasum": ""
},
},
"require-dev": {
"require-dev": {
...
@@ -467,7 +467,7 @@
...
@@ -467,7 +467,7 @@
"inertia",
"inertia",
"laravel"
"laravel"
],
],
"time": "2019-05-2
1T19:24:05
+00:00"
"time": "2019-05-2
2T11:08:52
+00:00"
},
},
{
{
"name": "jakub-onderka/php-console-color",
"name": "jakub-onderka/php-console-color",
...
@@ -2268,7 +2268,7 @@
...
@@ -2268,7 +2268,7 @@
},
},
{
{
"name": "Gert de Pagter",
"name": "Gert de Pagter",
"email": "
backendt
ea@gmail.com"
"email": "
BackEndT
ea@gmail.com"
}
}
],
],
"description": "Symfony polyfill for ctype functions",
"description": "Symfony polyfill for ctype functions",
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment