【发布时间】:2020-07-08 03:57:47
【问题描述】:
这是我的索引刀片,我想在其中单击用户名,它会在编辑用户刀片上重定向我
@extends('layouts.admin')
@section('content')
<h1><b>Users</b></h1>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Profile</th>
<th scope="col">Name</th>
</tr>
</thead>
<tbody>
@if($users)
@foreach($users as $user)
<tr>
<td>{{$user->id}}</td>
<td><img height="25" src="{{$user->photo ? $user->photo->file:'No photo exist'}}"></td>
<!-- Problem is here -->
<td><a href="{{route('admin.users.edit', $user->id)}}" style="text-decoration: none">
{{$user->name}}</a></td>
*it through an exception*
**Route [admin.users.edit] not defined**
</tr>
@endforeach
@endif
</tbody>
</table>
@endsection
如果我像这样使用url() 方法{{url('admin/users/edit',$user->id)}},它会将我重定向为admin/users/edit/1,但我的路线设置为admin/users/1/edit。如何打开这条路线?
【问题讨论】:
标签: laravel laravel-blade laravel-6