initial commit
This commit is contained in:
commit
4fc3bb0a01
202 changed files with 41729 additions and 0 deletions
41
start/inertia.ts
Normal file
41
start/inertia.ts
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Inertia Preloaded File
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Any code written inside this file will be executed during the application
|
||||
| boot.
|
||||
|
|
||||
*/
|
||||
|
||||
import Inertia from '@ioc:EidelLev/Inertia';
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
|
||||
|
||||
Inertia.share({
|
||||
errors: (ctx) => {
|
||||
return ctx.session.flashMessages.get('errors');
|
||||
},
|
||||
|
||||
flash: (ctx) => {
|
||||
return {
|
||||
message: ctx.session.flashMessages.get('message'),
|
||||
};
|
||||
},
|
||||
|
||||
// params: ({ params }) => params,
|
||||
authUser: ({ auth }: HttpContextContract) => {
|
||||
if (auth.user) {
|
||||
return auth.user;
|
||||
// {
|
||||
// 'id': auth.user.id,
|
||||
// 'login': auth.user.login,
|
||||
// };
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
}).version(() => Inertia.manifestFile('public/assets/manifest.json'));
|
||||
|
||||
// 'flash' => [
|
||||
// 'message' => fn () => $request->session()->get('message'),
|
||||
// ],
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue