11Delete helper
22-----------
3+ #### drop multi tables
34Suppose you want to drop multiple tables by their names in the database, you can do it with the following implementation.
45``` php
56
67 QueryHelperFacade::deleteInstance()
7- ->setTables(['posts', 'users' , 'comments']) // tables names.
8+ ->setTables(['posts', 'users' , 'comments'])
9+ // tables names.
10+ // or you can select all tables that exists in the database from the below function
11+ // ->setAllTablesFromDatabase()
812 ->dropMultiTables()
913 ->executeAll();
1014
1115```
16+ #### truncate multi tables
17+
18+ Suppose you want to truncate multiple tables by their names in the database, you can do it with the following implementation.
19+ ``` php
20+
21+ QueryHelperFacade::deleteInstance()
22+ // tables names.
23+ ->setTables(['posts', 'users' , 'comments'])
24+ // or you can select all tables that exists in the database from the below function
25+ // ->setAllTablesFromDatabase()
26+ ->truncateMultiTables()
27+ ->executeWithoutPrepare();
28+
29+ ```
30+
31+ #### delete large data
1232If you have a table that contains a large number of data (maybe millions of records)
1333and you want to delete everything contained in this table,
1434if you execute the command with one query,
@@ -31,6 +51,8 @@ so this function divides the large query into more queries with an easy-to-use s
3151 return $table->where('id', '<', 100)->pluck('id')->toArray();
3252 }); // this will implement the delete process only on the result of this callback.
3353```
54+
55+ #### drop all tables
3456If you want to drop all tables from the database.
3557``` php
3658
0 commit comments