Commit 06b3ed39 authored by duxet's avatar duxet

Fix soft deleting

parent f2a84b50
...@@ -292,13 +292,13 @@ You may also specify additional columns to update: ...@@ -292,13 +292,13 @@ You may also specify additional columns to update:
**Soft deleting** **Soft deleting**
When soft deleting a model, it is not actually removed from your database. Instead, a deleted_at timestamp is set on the record. To enable soft deletes for a model, apply the SoftDeletingTrait to the model: When soft deleting a model, it is not actually removed from your database. Instead, a deleted_at timestamp is set on the record. To enable soft deletes for a model, apply the SoftDeletes to the model:
use Jenssegers\Mongodb\Eloquent\SoftDeletingTrait; use Jenssegers\Mongodb\Eloquent\SoftDeletes;
class User extends Eloquent { class User extends Eloquent {
use SoftDeletingTrait; use SoftDeletes;
protected $dates = ['deleted_at']; protected $dates = ['deleted_at'];
......
<?php namespace Jenssegers\Mongodb\Eloquent; <?php namespace Jenssegers\Mongodb\Eloquent;
trait SoftDeletingTrait { trait SoftDeletes {
use \Illuminate\Database\Eloquent\SoftDeletingTrait; use \Illuminate\Database\Eloquent\SoftDeletes;
/** /**
* Get the fully qualified "deleted at" column. * Get the fully qualified "deleted at" column.
......
<?php <?php
use Jenssegers\Mongodb\Model as Eloquent; use Jenssegers\Mongodb\Model as Eloquent;
use Jenssegers\Mongodb\Eloquent\SoftDeletingTrait; use Jenssegers\Mongodb\Eloquent\SoftDeletes;
class Soft extends Eloquent { class Soft extends Eloquent {
use SoftDeletingTrait; use SoftDeletes;
protected $collection = 'soft'; protected $collection = 'soft';
protected static $unguarded = true; protected static $unguarded = true;
......
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