Create a route
Route::get('/database-optimize/','OptimizeController@database_optimize');
Add in a controller
Route::get('/database-optimize/','OptimizeController@database_optimize');
Add in a controller
use DB
public function database_optimize()
{
$users = DB::select('OPTIMIZE TABLE `users`');
$orders = DB::select('OPTIMIZE TABLE `orders`');
$orders_details = DB::select('OPTIMIZE TABLE `orders_details`');
$products = DB::select('OPTIMIZE TABLE `products`');
return back();
}
Great Info. Thanks for sharing.
ReplyDeleteHire Laravel Developers in USA