Commit f7e7fa62 authored by Dayle Rees's avatar Dayle Rees

Merge pull request #995 from cviebrock/eloquent-delete-doc

Deleting Eloquent models
parents 3b09f99f c60a58ff
......@@ -15,6 +15,7 @@
- [Setter & Getter Methods](#getter-and-setter-methods)
- [Mass-Assignment](#mass-assignment)
- [Converting Models To Arrays](#to-array)
- [Deleting Models](#delete)
<a name="the-basics"></a>
## The Basics
......@@ -537,3 +538,12 @@ Sometimes you may wish to limit the attributes that are included in your model's
public static $hidden = array('password');
}
<a name="delete"></a>
## Deleting Models
Because Eloquent inherits all the features and methods of Fluent queries, deleting models is a snap:
$author->delete();
Note, however, than this won't delete any related models (e.g. all the author's Book models will still exist), unless you have set up [foreign keys](/docs/database/schema#foreign-keys) and cascading deletes.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment