softdeleteの永久削除: forceDelete

mysql> select * from posts;
+—-+——————-+—————————————————+———————+———————+———-+———————+
| id | title | content | created_at | updated_at | is_admin | deleted_at |
+—-+——————-+—————————————————+———————+———————+———-+———————+
| 1 | Update tile | Laravel is the best thing that happen to PHP | NULL | 2019-12-06 06:07:16 | 0 | NULL |
| 4 | new ORM title 2 | wow eloquent is really cool, look at this content | 2019-12-05 18:23:33 | 2019-12-06 06:09:28 | 0 | 2019-12-06 06:09:28 |
| 6 | php create method | Wow I’m learning a lot | 2019-12-06 05:09:21 | 2019-12-06 06:07:16 | 0 | NULL |
| 7 | new ORM title | wow eloquent is really cool, look at this content | 2019-12-06 05:45:03 | 2019-12-06 06:07:16 | 0 | NULL |
+—-+——————-+—————————————————+———————+———————+———-+———————+
4 rows in set (0.00 sec)

Route::get('/forcedelete', function(){

		Post::withTrashed()->where('is_admin', 0)->forceDelete();
});

mysql> select * from posts;
Empty set (0.00 sec)

あれ? 全部削除?? あ、withTrashedはrecordとsoftdeleteが混じっているので、softdeleteのみの場合は、onlyTrashedですな。失敬