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

Kinger's avatar

Inertia not updating data after a redirect()->back()

Hi there, A problem I am having is that when I make a change to a model and when I redirect back, Inertia does not update the data. It updates the data only after a page refresh.

This is my code:

Index.vue

<td v-if="!school.deleted_at" class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-3">
     <Link method="delete" :href="route('school.destroy', [school])" class="text-red-500 hover:text-red-600">
          Delete
     </Link>
</td>
<td v-else class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-3">
    <Link method="put" :href="route('school.restore', [school])" class="text-green-500 hover:text-green-700/90">
        Restore
    </Link>
</td>

SchoolController.php

public function restore(School $school)
{
     $school->restore();

      return redirect()
          ->back()
          ->with('success', 'School restored successfully');
  }

Thanks for your help.

0 likes
1 reply
Tiskiel's avatar

Hi @kinger

Maybe you can to check the partial reload here

I hope this will be helpful to you.

Please or to participate in this conversation.