404未找到,这不是基于application_id重定向

时间:2019-06-16 11:55:25

标签: php laravel

我在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');

1 个答案:

答案 0 :(得分:0)

我认为您的$application->applications_id必须是$applications_id

public function create_user_applicationform2(Request $request, $applications_id)
{
   return redirect('soleproprietorship_applicationform3/'. $applications_id);
}