Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

redactuk's avatar

redactuk liked a comment+100 XP

1w ago

Build Modern Laravel Apps Using Inertia.js: Ep 19, Inertia Forms 101

In case anyone has an issue to import { Inertia } from "@intertiajs/inertia"; use this one instead

import { router } from "@inertiajs/vue3";

let submit = () => {
    router.post('/users', form)
};
redactuk's avatar

redactuk liked a comment+100 XP

1w ago

Build Modern Laravel Apps Using Inertia.js: Ep 18, Filtering, State, and Query Strings

@Harold de Groot the import inertia replaced with router as th below cade:

<script setup>
import { router } from '@inertiajs/vue3'
import { ref, watch } from 'vue'
import Pagination from '../Shared/Pagination.vue'

let props = defineProps({
    users: Object,
    filters: Object,
})

let search = ref(props.filters.search)

watch(search, value => {
    router.get(
        '/users', { search: value }, {
            preserveState: true,
            replace: true,
        }
    )    					
})
</script>
redactuk's avatar

redactuk liked a comment+100 XP

1w ago

Build Modern Laravel Apps Using Inertia.js: Ep 17, Pagination

At least for me (using the latest version of Vue3/Inertia) binding the is directive, I can't use'Link' with quotes in the ternary, the paginator won't display. Removing the quotes from Link makes it work as intended.

<component
      :is="link.url ? Link : 'span'"
      v-for="link in users.links"
      :href="link.url"
      v-html="link.label"
      :key="link.label"
    />