Error in render: "Error: Ziggy error: 'project' parameter is required for route 'projectPage'."
See original GitHub issueZiggy version
v1.2.0
Laravel version
7.30.4
Description
ziggy is incorrectly asking for a parameter being passed to the route() function
this is especially odd because the code causing this error is nearly identical, varying only in the name of the prop array being stepped through, to a page which is working as expected
Ziggy call and context
route call
<inertia-link :href="route('projectPage', projects(r, c))">
<ProjectCard :project="projects(r,c)"/>
</inertia-link>
route definition in web.php
Route::get('projects/{project:id}', [ProjectController::class, 'projectPage'])->name('projectPage'); //*
projects() function which is passing the project param to the named route
methods: {
projects(r,c) {
if(r > 1) {
var index;
index = ((r * 3) - (3 - (c - 1)));
return this.$page.props.officeProjects[index];
}
return this.$page.props.officeProjects[c - 1];
}
}
officeProjects is a properly populated array of database records, and as i said, this code exists identically, except stepping though this.$page.props.schoolProjects
, which is populated in the same way, yet it does not return this error on the other page and the links route to the correct page
### Ziggy configuration
```js
projectPage:
bindings:
project: "id"
__proto__: Object
methods: (2) ["GET", "HEAD"]
uri: "projects/{project}"
__proto__: Object
### Route definition
```php
route definition in web.php
Route::get('projects/{project:id}', [ProjectController::class, 'projectPage'])->name('projectPage'); //*
Issue Analytics
- State:
- Created 2 years ago
- Comments:19
Top Results From Across the Web
Ziggy error: 'id' parameter is required for route - Laracasts
Hi I am working inertia and laravel single page app. I am getting error as Uncaught (in promise) Error: Ziggy error: 'id' parameter...
Read more >Error: Ziggy error: 'id' parameter is required for route
I am working on single SPA using laravel and inertia js. I am using multi language as well. So I am passing language...
Read more >Ziggy error: 'project' parameter is required for route 'projectPage'.
Error in render : "Error: Ziggy error: 'project' parameter is required for route 'projectPage'."(Neatstudio.COM)
Read more >Ziggy error: 'id' parameter is required for route 'page.profile
Has anyone encountered this error? I'm using the latest Laravel install with Vue 3.0.5. I'm not really certain what the issue here is, ......
Read more >Ziggy error: 'blog' parameter is required for route 'blogs.show ...
Coding example for the question Uncaught Error: Ziggy error: 'blog' parameter is required for route 'blogs.show'-laravel.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hey when the db is populated with at least 8 records for each table being queried the pages work as they are supposed to and your
<pre>...
code prints as expected, so just a problem with my math, thanks for the help and happiness your way my friendno it does not, and right now no, i need to just find another way thanks for all the help