user5313398
user5313398

Reputation: 753

Laravel 5.3 url pass query string but not appearing on calling

I have grid with multiple column and one of it for me to press the edit button so I can pass the id and on the route I will call the sql and get the relevant values and call the edit view. Below is my codes how I pass the id value.

<td><a href="{{url('/edittestdetails/',{{$test->ID}})}}>Edit</a></td>. I prefer the url to be edittestdetails?id=value? but now nothing is appearing when I call the url the paramereter is not appearing.

Upvotes: 1

Views: 66

Answers (2)

Alexey Mezenin
Alexey Mezenin

Reputation: 163748

The correct syntax is:

<a href="{{ url('/edittestdetails/', $test->id) }}>Edit</a>

{{}} will be converted to the echo() clause, so you can't use {{}} inside another {{}} construction.

Also, property name is id by default and not ID.

Upvotes: 1

Cong Chen
Cong Chen

Reputation: 2436

<td><a href="{{ url('/edittestdetails/', $test->ID) }}">Edit</a></td>

Upvotes: 1

Related Questions