Questions tagged [inertiajs]

Inertia.js allows developers to write single-page applications (SPAs) using classic server-side routing and controllers. Inertia tightly couples the backend to the frontend so that developers need not write APIs. Developers can use battle-tested server-side frameworks (e.g., Laravel, Ruby on Rails, Django, AspNetCore). On the client, developers can use React, Svelte, or Vue to implement the user interface.

1066 questions
51
votes
5 answers

Cleanup memory leaks on an Unmounted Component in React Hooks

I'm new using React, so this might be really simple to achieve but I can't figure it out by myself even though I've done some research. Forgive me if this is too dumb. Context I'm using Inertia.js with the Laravel (backend) and React (front-end)…
Kenny Horna
  • 13,485
  • 4
  • 44
  • 71
14
votes
2 answers

Laravel + Inertia + Vuejs: Pagination

When I get all the records it works: ... $items = Item::all(); return Inertia::render('Rentals/Items', ['items' => $items] ); But when I try to paginate, it breaks down: ... $items = Item::paginate(15); return…
No One
  • 553
  • 2
  • 9
  • 24
14
votes
2 answers

Laravel Jetstream Inertia Shared Global App Data

I want to share something I figured out since there's not much info out there (that I couldn't find). Laravel 8 with Jetstream Inertia has a few shared objects, like user, current route... You can access them in your components using the $page…
phoenix
  • 1,629
  • 20
  • 11
12
votes
5 answers

Default Persistent Layout In Laravel + Inertia + Vite

In the previous way of setting up inertia in a laravel app, I could tweak the resolve property in the `createInertiaApp function from: { ..., resolve: name => import("./Pages/${name}"), ... } To { ..., resolve: name => { const…
Willower
  • 1,099
  • 8
  • 22
12
votes
4 answers

All Inertia requests must receive a valid Inertia response, however a plain JSON response was received

i am trying to understand and resolve this InertiaJs error without success i hope i can get some help here.
Ismael Kourouma
  • 139
  • 1
  • 1
  • 6
12
votes
7 answers

Change InertiaJS-Laravel default RootView

I am using Laravel 8 and I have installed InertiaJS, but in my directory resources/views/ I have a single file called index.blade.php which I plan to use with InertiaJS. By default, InertiaJS looks for a file inside that directory called…
leo95batista
  • 699
  • 9
  • 27
11
votes
4 answers

add root class to Laravel / Inertia

ok, I am going MAD... I need to add class="h-full" to the root div inside Laravel Jetstream using Inertia. The reason for this is inside a vue file using Tailwind UI, it wants the following However, anytime I change anything inside app.blade.php,…
ArcticMediaRyan
  • 687
  • 8
  • 32
10
votes
2 answers

Laravel 8 - Jetstream + inertia.js - Vue dev tools not working

I have a project using Laravel 8, inertia js, Vue.js and webpack. The VueJs chrome dev tools aren't working for this project. It keeps showing as not detected, i've tried restarting it, removing and readding the dev tools. I've checked in both dev…
Ashler2
  • 149
  • 1
  • 11
9
votes
1 answer

Inertiajs - Laravel: How to Throw custom Error

How isit possible to throw an custom Error from Laravel in Inertiajs.vue without redirecting then? Vue Component: Inertia.post('company-organisations-create', { name: this.newOrganisation.name, description:…
Carlson
  • 183
  • 2
  • 11
9
votes
3 answers

Tailwindcss @apply directive doesn't work inside vue component

I create a laravel application with jetstream and inertia-vue stack for my new project problem is Tailwindcs version 2 using postCss and it doesn't support @apply directive inside vue components but inside .css file it works fine I don't want that…
Shekh Saifuddin
  • 470
  • 2
  • 6
  • 27
8
votes
3 answers

Tailwind CSS unnecessary whitespace

I'm trying to use this admin starter template I found on the tailwind toolbox and I am trying to customise it to my liking. I've split the code from the template down into 3 separate files, shown below, and when I replace the children variable in…
hcphoon
  • 538
  • 5
  • 24
8
votes
3 answers

how to access the relationships via models in laravel 8 inertia

I have a relation one to many between users table and areas table , when i return profile data i get area_id from users table, i need to get area name using models. Is there a way to get area name in profile view ? I tried to call model function in…
samarsamy92
  • 113
  • 1
  • 10
8
votes
5 answers

Accessing Laravel's .env variables inside Inertia.js Vue files

I am starting with the Inertia Laravel example https://github.com/drehimself/inertia-example which is nothing but Laravel with Vue in one monolithic codebase, using…
kp123
  • 1,250
  • 1
  • 14
  • 24
7
votes
4 answers

how can I use bootstrap instead of tailwind CSS in vue.js welcome component

I install jetstream+inertia.js into my laravel project and everything is working perfectly but I need to use bootstrap 5 in only welcome. vue component so how can I handle it? My app.js file; require('./bootstrap'); // Import modules... import…
ORHAN ERDAY
  • 1,020
  • 8
  • 31
7
votes
3 answers

All Laravel routes exposed. How to move it to app.js or minify if possible

I am using Ziggy for my Laravel, Vue.js and Inertia js project. In the view page source, I can clearly see all of the Laravel routes.