1๐
1: set redirect back with message data in the controller.
return redirect()->back()->with([
'messaage' => 'Installer was successfully deleted',
])
2: HandleInertiaRequests middleware.
public function share(Request $request)
{
return array_merge(parent::share($request), [
'flash' => [
'message' => fn () => $request->session()->get('message'),
],
]);
}
3: in component.
<template>
{{ $page.props.flash.message }}
</template>
<script setup>
import { usePage } from '@inertiajs/inertia-vue3'
const message = usePage().props.value.flash.message
</script>
๐คhanafi naufal
Source:stackexchange.com