I want to soft delete the records of this table.. Soft deleting record not working .Where am I making a mistake?
model file.
namespace Modules\Admin\Models;
use Modules\Admin\Models\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;
class test extends Model
{
use SoftDeletes;
protected $table = 'test';
protected $primaryKey = 'id';
public $incrementing = true;
public $timestamps = true;
protected $fillable = ['name'];
protected $dates = ['deleted_at'];
}
repository file.
public function deleteAction($inputs)
{
$id = $inputs['id'];
$testDetails = test::find($id);
if (!empty($testDetails)) {
$testDetails->delete();
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire