Commit c60a58ff by Colin Viebrock

Someone else can re-word this, but a easy-to-find paragraph on deleteing…

Someone else can re-word this, but a easy-to-find paragraph on deleteing Eloquent models seemed missing.
Signed-off-by: Colin Viebrock <colin@viebrock.ca>
parent 1db67d47
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
- [Setter & Getter Methods](#getter-and-setter-methods) - [Setter & Getter Methods](#getter-and-setter-methods)
- [Mass-Assignment](#mass-assignment) - [Mass-Assignment](#mass-assignment)
- [Converting Models To Arrays](#to-array) - [Converting Models To Arrays](#to-array)
- [Deleting Models](#delete)
<a name="the-basics"></a> <a name="the-basics"></a>
## The Basics ## The Basics
...@@ -537,3 +538,12 @@ Sometimes you may wish to limit the attributes that are included in your model's ...@@ -537,3 +538,12 @@ Sometimes you may wish to limit the attributes that are included in your model's
public static $hidden = array('password'); 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.
\ No newline at end of file
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