eloquent - Record Not Being Deleted In Laravel -


hello having weird issue not understand, trying delete record in laravel. destroy method in resource controller:

public function destroy($id) {     $ins = institution::find($id);     $success = $ins->delete();      return [         'success' => $success     ]; } 

this model:

namespace app\models;  use illuminate\database\eloquent\model; use illuminate\database\eloquent\softdeletingtrait;  class institution extends model {      use softdeletingtrait;      protected $dates = ['deleted_at'];      protected $table = 'sys_institutions';  } 

now success returns true indicating record indeed has been deleted when check db not case.

i have tried returning $ins after delete well, column deleted_at seems have date not saved database. in database table deleted_at null.

now did not create tables migrations dunno if might have current problem.

i have checked $id , indeed correct.

i have tried using:

$success = institution::destroy($id); 

that didn't work either.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -