PHP code example of bots8 / nutgram-starter-kit

1. Go to this page and download the library: Download bots8/nutgram-starter-kit 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/ */

    

bots8 / nutgram-starter-kit example snippets


use App\Database\DB;

$qb = new DB();


// Select first data
$res = $qb->table('users')
    ->select('id')
    ->where('username', '=', $username)
    ->first();

// Select all data
$res = $qb->table('users')
    ->select('*')
    ->where('id', '>', 10)
    ->findAll();

// Insert data
$qb->table('users')->insert([
    'telegramId' => $from->id,
    'username' => $from->username,
    'name' => $from->first_name.' '.$from->last_name,
]);

...

bash
    php nutgram webhook set
    
bash
    php nutgram run
    
bash
    php nutgram webhook delete