Posts

Laravel Server Side Yajra DataTable - Load Large Data Within Few Seconds

Image
  Large Data or 1 million Data Quick Load within few seconds in Laravel Server Side DataTables  Run the following in the  command/terminal to create a new laravel project , 1 composer create-project laravel/laravel yajra-table-large-data-handle Run the following in the  command/terminal to install yajra datatables package , 1 composer require yajra / laravel - datatables - oracle Check  composer.json 1 2 3 4 "require" : { ………………          "yajra/laravel-datatables-oracle" : "~9.0" } ,   Add the following code file to  config/app.php 1 2 3 4 5 6 7 8 9 'providers' = > [      . . . ,      Yajra \ DataTables \ DataTablesServiceProvider :: class , ]   'aliases' = > [      . . . ,      'DataTables' = > Yajra \ DataTables \ Facades \ DataTables :: class , ] publish the configuration, run the following line in the  terminal , 1   php artisan vendor : publish in  .env  for database setup 1 2 3 4 5 6 DB_CONNECTION = mysql

Laravel Database Transactions

Database Transactions You may use the  transaction  method provided by the  DB  facade to run a set of operations within a database transaction. If an exception is thrown within the transaction closure, the transaction will automatically be rolled back and the exception is re-thrown. If the closure executes successfully, the transaction will automatically be committed. You don't need to worry about manually rolling back or committing while using the  transaction  method: use Illuminate\Support\Facades\ DB ;   DB :: transaction ( function () { DB :: update ( ' update users set votes = 1 ' );   DB :: delete ( ' delete from posts ' ); }); Handling Deadlocks The  transaction  method accepts an optional second argument which defines the number of times a transaction should be retried when a deadlock occurs. Once these attempts have been exhausted, an exception will be thrown: use Illuminate\Support\Facades\ DB ;   DB :: transaction ( function () { DB ::