skip to Main Content

My present table structure :

enter image description here

I just added the "product_name" column recently & tried to do the same PUT which has been successfully adding values to the table earlier. For some reason, the newly added product_name field is not getting updated(Rest all columns are getting the values through the same PUT request).

Am i missing any steps after adding a new column to the existing tables, after which it could accept values via API PUT ? I added this new column from the Structure tab

URL : MY URL
headers: {HttpHeaders.contentTypeHeader: 'application/json'},
body: json.encode({id: null, quantity: 1.0, product_id: 113, product_name: cumin, user_id: 72, options: []})

2

Answers


  1. you need to add that column in your model.

    protected $fillable = ['product_name', and other columns];
    

    or if you don’t want to write fillable then simply replace this line with

    protected $guarded = [];
    
    Login or Signup to reply.
  2. Please update your $fillable array in your modal.

    $fillable = ['product_name'];
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search