当用户必须编辑其个人资料时,它会显示如Click to see the photo
的ID这不是我想要的。我想用配置文件用户名替换它并删除编辑部分。我真的希望有人理解我要求的东西。让我告诉你我在寻找像这样的东西" localhost / lary / quickstart / public / profile / username"
这是我的代码中的内容
public function edit($id)
{
$pro=Profile::find($id);
return view('layouts.profileedit')->with('pro',$pro);
}
<a href="{{route('profile.edit',$use->id)}}" style="color:#F88B22;"><span class="glyphicon glyphicon-pencil"></span></a>
答案 0 :(得分:1)
更改路线文件,如下所示:
Route::resource('profile', 'ProfileController', ['except' => ['edit']]);
Route::get('/profile/{username}', 'ProfileController@edit');
然后按如下所示更改 ProfileController
public function edit($username)
{
$pro=Profile::where('username', $username)->firstOrFail();
return view('layouts.profileedit')->with('pro',$pro);
}