Sunday, March 12, 2017

How to set on delete cascade on laravel-mongodb? (Laravel 5.3)

My delete method on controller is like this :

public function delete($id)
{
    MessageThread::destroy($id);
}

When the code executed, It success delete a record by id

But, the data on child table not deleted

Seems it must set on delete cascade

How can I set it?

I get the reference from here : https://github.com/jenssegers/laravel-mongodb



via moses toh

Advertisement