我在laravel中有一个更新查询,但是没有基于applications_id
进行重定向。
下面是我的控制器代码SoleProprietorController.php:
public function create_user_applicationform2(Request $request, $applications_id)
{
return redirect('soleproprietorship_applicationform3/'.$applications->applications_id);
}
public function soleproprietorship_applicationform3($applications_id)
{
$applications_id = \DB::table('applications')->where('applications_id', $applications_id)->get();
return view('soleproprietorship_applicationform3')->with('applications_id', $applications_id);
}
还有我的模型Applications.php
class Applications extends Authenticatable
{
use Notifiable;
protected $primaryKey = 'applications_id';
/*
* Important records to be filled
*/
public $fillable = [
'applications_id'
];
}
web.php
Route::get('/soleproprietorship_applicationform3/{applications_id}', 'SoleProprietorController@soleproprietorship_applicationform3')->name('home');
答案 0 :(得分:0)
我认为您的$application->applications_id
必须是$applications_id
public function create_user_applicationform2(Request $request, $applications_id)
{
return redirect('soleproprietorship_applicationform3/'. $applications_id);
}