Vue3
import {useForm} from "@inertiajs/vue3";
const data = useForm({
user_id: 1, token: 'z3xppkdo0CLoFxy'
});
onBeforeMount(() => {
data.get(route('navigation'));
})
Laravel
public function __invoke()
{
return redirect()->back()->with(['data' => 'some data']);
}
the Navbar component needs to get the data (its not page)