Wouldn't you just use the SoftDeletes Trait? It seems pointless to use scopes to do soft deletes. Plus the question says how to do Soft Deletes but does not show anything to do with it. That would be a fail in my books and would show the person can't read.
Fair enough - I must admit I don't do Laravel on a daily basis so wasn't aware of the SoftDeletes trait - was just working out from the context of the OP's article that they were implying scopes could be used for soft deletes...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Wouldn't you just use the SoftDeletes Trait? It seems pointless to use scopes to do soft deletes. Plus the question says how to do Soft Deletes but does not show anything to do with it. That would be a fail in my books and would show the person can't read.
Fair enough - I must admit I don't do Laravel on a daily basis so wasn't aware of the SoftDeletes trait - was just working out from the context of the OP's article that they were implying scopes could be used for soft deletes...