首页 > 解决方案 > Laravel 发布 302 重定向

问题描述

我有五个在 Windows、Apache2 服务器上运行的 Laravel 应用程序。这些应用程序是在 Laravel 5.2.43 中开发的。新应用程序是在 Laravel 5.5.46 中开发的。

将新应用程序迁移到同一台服务器后,我面临以下问题。

新应用程序问题 (Laravel 5.5.46)

将新应用程序迁移到同一台服务器后,当我在正常提交和 AJAX 调用中提交表单时,我会收到 302 重定向。 csrf_token是表单中可用的字段。

现有应用程序问题 (Laravel 5.2.43)

新应用程序数据库中的现有应用程序搜索表。

我没有使用php artisan serve. 所有应用程序都像http://host/project/public一样运行

请帮我。

public function store(Request $request) {
    $regsiteredVehicleDetails = TestVehicle::updateOrCreate(
        ['vehicle_type_id' => $request->vehicle_type_id,
        'registration_no' => $request->registration_no,
        'model_name' => $request->model_name,
        'engine_no' => $request->engine_no,
        'vehicle_identification_number' => $request->vehicle_identification_number
        ], 
        ['status' => $databaseStatusActive,
         'customer_id'=>null,
        'comments' => $comments]
    );

    if ($regsiteredVehicleDetails->id) {
        Session::flash('message', 'Test Vehicle is registered successfully!..'); 
        Session::flash('status', 'success');
    } else {
        Session::flash('message', 'Something went wrong....!');
        Session::flash('unicode', 'Unicode is not generated');
        Session::flash('status', 'failure');
    }
    return redirect('tvr');
}

标签: phplaravellaravel-5eloquent

解决方案


推荐阅读