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

atif-bashir-1998's avatar

Getting Error: Ziggy error: 'slider' parameter is required for route 'sliders.show'

I am having Laravel 9 and Inertia Vue(3). I used resource controller. I am getting the following issue:

Uncaught (in promise) Error: Ziggy error: 'slider' parameter is required for route 'sliders.show'.

Laravel's resource controller function responsible for rendering the inertia component is as below:

public function show($locale, Slider $slider) {
    return Inertia::render('Admin/Slider/Show', [
      'slider' => $slider,
    ]);
  }

I am accepting the props inside the Show page as shown below:

<script setup>
defineProps({
  slider: Object
})
</script>
0 likes
3 replies
atif-bashir-1998's avatar

@Sinnbeck I am using a vue Layout file which is at the location: /resources/js/Layouts/Authenticated.vue

I have routes in this file. Below are those routes. When I remove these routes from the layout, the issue goes away. I think I now understand why I am getting the error. It is because when I navigate to the show page, I must have a slider parameter :

<a :href="route(route().current(), {locale: 'de'})">
		Deutsch
</a>
<a :href="route(route().current(), {locale: 'fr'})">
		French
</a>
atif-bashir-1998's avatar

@Sinnbeck Is there a way to redirect back to the same page without having to pass the slider variable in the route()?

Please or to participate in this conversation.