PHP code example of smartcode / turbokit

1. Go to this page and download the library: Download smartcode/turbokit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

smartcode / turbokit example snippets


use TurboKit;

// Retrieve all records with caching
$users = TurboKit::turboModel(User::class)->turboAll();

// Chunk processing
TurboKit::turboModel(User::class)->turboChunk(1000, function($chunk){
    // process each chunk
});

$users = TurboKit::turboQuery(User::query()->where('status', 'active'))->cache('active_users');

TurboKit::forgetCache('active_users');

$data = [
    ['name' => 'John', 'phone' => '12345'],
    ['name' => 'Jane', 'phone' => '67890'],
];

TurboKit::insertBulk($data, User::class);

return TurboKit::message("Data saved successfully!", $data);