I am using SoftDeletes
for a model in Laravel5.
But in some cases (Keeping history is not useful),I want to do physical delete (Removing row from table)instead of softDelete
.
class PaymentInvoices extends Model {
use SoftDeletes;
}
Is there any method for forcing physical delete?
Of course there is. Use
forceDelete
method instead of justdelete
.Keep in mind,
forceDelete
is only available if you use theSoftDeletes
trait.Example
More info here (scroll down to Permanently Deleting Models)