简体   繁体   中英

Laravel $request->all() not retuning anything

Laravel form request not working this $request->all(); return empty array.

I am using Laravel FormRequest and its not working when I am updating the record with put method and sending multipart data in ajax request

Try to copy paste your form and controller code. Check if you have Request $request as parameter in your controller method. If not you can use request()->all();

如果您使用 ajax 发送,您应该为您的数据(您正在发送的)设置一个名称,也尝试在控制器中返回该名称

return $request->your_data_name;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM