In the following code I used {!! URL::route('editCatForm',['id'=>$row->id]) !!} to go to named route editCatForm with query string ?id=5 or whatever that comes dynamically on $row->id
@foreach($categories as $row)
<tr>
<td>{{ $count++ }}</td>
<td>{{ $row->category_name }}</td>
<td>{{ $row->category_status }}</td>
<td><a href="{!! URL::route('editCatForm',['id'=>$row->id]) !!}">edit</a> / <a href="{!! URL::route('destroyCat',$row->id) !!}">delete</a></td>
</tr>
@endforeach
My route for this is
Route::get('editCatForm/{id?}',array('uses'=>'Categories@editCat','as'=>'editCatForm'));
but still it shows url like
http://localhost/projects/brainlaratest/editCatForm/2
instead of
http://localhost/projects/brainlaratest/editCatForm?id=2
The route points to function
public function editCat($id)
{
$catEdit = Category::find(Input::get('id'));
$categories = $this->getCat();
return view('categoriesAddForm',compact('categories','catEdit'));
}
What may be the issue that query string isn't working here?