Laravel Controller update method not working

前端 未结 1 1670
猫巷女王i
猫巷女王i 2021-01-23 12:31

I am new in Laravel.

I made controller, Model and views by way/generator by composer php artisan generate:scaffold cities and Its index p

1条回答
  •  时光说笑
    2021-01-23 13:07

    In your model you have protected $primaryKey='city_id'; but in your view you have:

    {{ Form::model($city,array('route'=>array('admin.cities.update',$city->id),'method'=>'PUT','files'=>true)) }}
    

    I mean $city->id should be $city->city_id

    0 讨论(0)
提交回复
热议问题