php - 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');
}
解决方案
推荐阅读
- symfony - Symfony 控制台部分未清除所有行
- python-3.x - How to print class variables in a list
- java - java中如何将一个对象映射到另一个对象
- c# - JSON写入文件问题如何删除引号
- android - Unity 中的 Android 插件 - 无返回值
- java - PostgreSQL '数据库不存在' - Java Spring Boot、Flyway、Docker/PostgreSQL
- java - 使用 Jackson 从 XML 创建自定义对象
- python - Python等效于省略三元运算符的第二部分(a if a else b)
- c# - 如何在 C# 中使用 Web API 而不是 json 响应返回和打开文件
- docker - Can I install Docker by windows 8.1?