-
Notifications
You must be signed in to change notification settings - Fork 283
Open
Labels
needs more info/workNeeds more info from the author or additional work to get mergedNeeds more info from the author or additional work to get merged
Description
PHP package version
2.x-dev
Inertia adapter(s) affected (if any)
- React
- Vue 3
- Svelte
- Not Applicable
Backend stack
Laravel 12
PHP 8.2
Describe the problem
I have a simple route that do:
Route::post('/', function (InstallRequest $request) {
Artisan::call('migrate:fresh --seed');
return Inertia::flash('toast', [
'message' => 'Database installed successfully',
])->back();
})->name('send');I tried to get flash messager by many ways. (usePage hook, global event) and i'm not getting any network answer.
Steps to reproduce
post(route('install.send'), {
onFlash: ({ toast }) => {
console.log('Toast:', toast)
// toast = { message: 'Database installed successfully' }
},
onFinish: () => {
//reset('password', 'password_confirmation')
},
});and
useEffect(() => {
const removeSuccess = router.on('success', (event) => {
console.log('Success event:', event.detail.page)
})
const removeFlash = router.on('flash', (event) => {
console.log('Flash event:', event.detail.flash)
})
return () => {
removeSuccess()
removeFlash()
}
}, [])I get success but not flash.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs more info/workNeeds more info from the author or additional work to get mergedNeeds more info from the author or additional work to get merged