dou47732 2019-06-28 05:42
浏览 46

Laravel 5.7如果仅在实时环境中通过POST发送,则会对“selected”关键字造成错误

I am having issue with laravel 5.7, when I try to add the below mentioned description in any of POST forms, I am getting error (whoops something went wrong) without any log trace . this error is only happening in my live server, local environment is working fine.

"The raw material for shelled cooked Chinese chestnuts is fine selected from Yanshan chestnuts."

I noticed this 'selected' keyword is causing issue, but I am unable to resolve.

PS: I am using laravel 5.7 with PHP 7.1 and MariaDB 10

I tried debugging and found out the the code control is not present in POST method handler function, so it must be causing issue with laravel Request.

I got an alternate solution to this issue that replaces 'select', 'insert', 'update' and 'delete' with some alternate keywords while sending from forms (frontend) while posting and then replacing them back with original keyword from backend (laravel).

Whoops, looks like something went wrong.

The error page is also weird (not of laravel 5.7) here is the link, https://imgur.com/a/82UBqwy

FrontEnd Code Sample

{!! Form::model($company,['route' => 'member.company.store']) !!}

<div class="form-row">
  <div class="form-group col-md-6">
    <label>Company Name</label>
    {{Form::text('name',null,['class' => 'form-control', 'placeholder' => 'Company name'])}} 
  </div>
</div>

<div class="form-row" >
  <div class="form-group col-md-6">
    <label>Introduction</label>
    {{Form::textarea('description',null,['placeholder' => 'Company introduction..'])}} 
  </div>
</div>

<button type="submit" class="btn btn-accent">Update</button>
{{Form::close()}}

Backend Code Sample

public function store(Request $request){
    $uid = auth()->id();
    $company_profile = Company::where('user_id',$uid)->first();
    if($company_profile)
    {
        $company_profile->name = $request->name;
        $company_profile->description = $request->description;
        $company_profile->save();
    }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大