How to get soft deleted records in laravel?

I want to get soft deleted records and display into table. But i don’t know how to get soft deleted records from database.

Starter Asked on February 2, 2018 in Laravel.
Add Comment
1 Answer(s)

Using following  laravel eloquent we can get easily soft deleted data from database.

Method 1 :


Product::withTrashed()->get();

 

Method 2 :


Product::onlyTrashed()->get();

 

I hope this solution useful for you..

Starter Answered on February 2, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.