1. Go to this page and download the library: Download deminua/laravel-tgbot 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/ */
routes/web.php
/**
* routes/web.php
* For example, you can define your route:
*/
Route::get('send', function () {
$data = [
'title' => 'Test',
'name' => 'Bob',
'email' => '[email protected]',
'phone' => '+380960000000',
'url' => url()->previous()
];
$response = response()->json(['message' => __('Thank you, has been successfully, we will contact you soon!')]);
return LaravelTgbot::send($data, $response);
});
php artisan route:list
GET|HEAD send .......................................
GET|HEAD telegram ...................................
POST telegram ...................................
GET|HEAD telegram/edit/{bot} ........................
POST telegram/edit/{bot} ........................
GET|HEAD telegram/edit/{bot}/delete_client/{client} .
POST telegram/edit/{bot}/new_client .............
GET|HEAD telegram/edit/{bot}/test_client/{client} ...