이 오류를 해결하는 방법을 묻고 싶습니다. 나는 내가 userprofile\edit.blade.php
경로에 대한 필수 매개 변수가 누락되었습니다.
에 페이지를 재배치 할 내가보기 userprofile\create.blade.php
에서 사용자 정보를 가지고 [Route: userprofile.edit] [URI: userprofile/{userprofile}/edit]. (View: C:\xampp\htdocs\code\task1\resources\views\userprofile\create.blade.php)
과 버튼을 제출 한 후 필요한 매개 변수를 누락이 오류가이 또한 내 userProfileController
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\User;
class userProfileController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view("userprofile.create");
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$user = User::find($id);
return view('userprofile.edit')->withUser($user);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
입니다 이보기의 경로
Route::group(['namespace' => 'User'], function(){
Route::get('/userprofile/{id}/edit', ['as' => 'userprofile.edit', 'uses' => '[email protected]']);
});
Route::resource('userprofile','userProfileController');
create.blade.php
<input type="submit" class="btn btn-primary" action="{{ route('userprofile.edit') }}" value="Edit profile">
에서 버튼의 경로 액션이 오류가 왜 어떤 생각이 있다면, 저를 보내주십시오! 감사합니다.
경로 대신 URL을 사용하는 이유는 무엇입니까? – Devmasta
버튼을 전송하고 단추를 제출하면 같은보기가 있고이 http : // localhost : 8080/code/task1/public/userprofile/create? user_name = admin % 40example.com에 경로가 변경됩니다. – Devmasta