Download the PHP package alirezax5/telegram-base without Composer

On this page you can find all versions of the php package alirezax5/telegram-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package telegram-base

��# telegramBase

<div dir="rtl">

*

H,G: '�F ~1H�G 1' '(/' (1'� 1(' G'� .H/E H39G /'/E H 5E�E �1AE "F 1' EF41 �FE ' '�1 (1'� 4E' GE �'1(1/� (H/ 

(H'F�/ '2 "F '3A'/G �F�/.

/1 5H1 E4�D /1 �'1 (' ~1H�G '2 GH4 E5FH9� ,�EF'� (' D�F� 2�1 '3A'/G �F�/. '�+1 EH'1/ EH1/ F�'2 (G gem /'/G 4/G '3*.

https://gemini.google.com/gem/13NSCMFOipq6HMvSRPZ2NvhKGzuYVrTDS?usp=sharing

*

## <د� G/A ~1H�G

G/A '2 H39G '�F (�3  3'/�� /1 �/FH�3� H (G�FG 3'2� (1'� 31H�3 /G� (G 9/'/ ('D'� �'1(1 '3*.

39� �1/G 'E /1 -/ 'E�'F E51A EF'(9 (CPU / RAM / I/O) ~'��F ('4/ H 3'.'1 ~1H�G B'(D H39G H 'F97'A ~0�1 ('B� (E'F/.

/1 (.4 G'� E.DA ~1H�G '2 �E� GH4 E5FH9� GE '3A'/G 4/G '3. �E� �1AF G�� '�1'/� F/'1/  .1H,� FG'�� -'5D �F/ 3'D

,1(G /1 3'. 1(' G'� D�1'E� '3 H (' �E� AI 1H� (G�F�� H 'F.'( (G1�F 3'.'1 E1�2 4/G '3.

---

## ' 'E�'F'* (�3

- ~4�('F� '2 'FH'9 /�'(�3 G' (G H'37G illuminate/database

- E9E'1� ~D'��F E-H1

- ~4�('F� '2 �F/ 2('FG �1/F ~1H�G*

- B'(D�* 4.5� 3'2� /1 37- EF'3(

- 'E�'F 'F.'( -'D ',1'� 1('*:

- -'D* E9EHD�

- -'D* 5A (F/� (Queue)

- ~4*�('F� '2 Queue (':

- json

- redis

- rabbitmq

- ~4�('F� '2 ',1'� �F/ H1�1 (1'� ~1/'24 "~/� G' (/1 -'D* 5A)

- 3'.'1 (G�FG (1'� E/�1� /�EG G' H *1,EG G'

- D'� ��1� -1AG '� (' Monolog

- �4 EF'3( (1'� ,DH��1� '2 .H'F/F E,// A'�D G' H �'G4 I/O

- �D'3 Shared (1'� '4*1'� /'/G (�F ~D'��F G'

- 'E�'F 9��F 'HDH� H 1�( ',1'� ~D'��F G'

---

## S' '�F (�3 �G E4�D� 1' -D E� �F/

/1 -'D 3'/G  3'.'1 GE'F ��2� '3 �G ' 'D"F '-E'D'K '3A'/G E� �1/�/  AB7 (' 'E�'F' (�41 E'FF/ ~D'��F H �F/2('FG

4/F ~1H�G.

'E' B/1 '5D� '�F (�3 /1 5A (F/� /1.H'3 G'3.*

HB� 9/'/ �'1(1'F 2�'/ 4H/  /1.H'3 G'� (�41� (G 3E 3H13 '13'D E� 4H/ H EE�F '3 (1.� '2 "F G' E�3 (F'/�/G �1A*G)

4HF/. '�1 1(' 4DH:� /'4G ('4�/  '-E'D'K '2 71A BotFather ~�'E� /1�'A �1/G '�/ �G 319 1(' �'G4 �'AG '3.

/1 E�'F�2E 5A (F/� '�F (�3  �� A'�D FG' H8�AG � /1�'A "~/�* G' H B1'1 /'/F "F G' /1 5A 1' (1 9G/G /'1/ H �'1 /��1�

'F,'E FE� /G/. '�F EH6H9 ('9+ E� 4H/ D�1'E /1 GE'F D-8G ~'3. EHAB� "E�2 /1�'A �F/ H /1 A'�D G'� /��1  ~1/'24 "~/� G'

'F,'E 4H/.

### �1' 5A (F/� EGE '3*

- E� H'F�/ �F/�F H1�1 91�A �F�/

- ~1/'24 G' '2 /1.H'3* G' ,/' E� 4HF/

- E/�1� H �F1D DH/ (G*1 'F,'E E� 4H/

/1 5A (F/�  "~/� G'� D�1'E /1 ��� '2 EH'1/ 2�1 0.�1G E� 4HF/:

- json

- redis

- rabbitmq

H 3~3 H1�1G' (G 5H1* ,/'�'FG "FG' 1' ~1/'24 E� �FF/.

### E2�* '5D�:

' Load Balancing H'B9�

E� *H'F�/:

1. �� 31H1 AB7 (1'� /1�'A "~/� G' '2 D�1'E /'4G ('4�/

2. �F/ 31H1 /��1 AB7 (1'� ~1/'24 "~/�* G'

F�1'F ',1'� �1'1� "~/� G' F('4�/  /1 (.4 G'� E.DA 3H13 ,DH� '�F EH6H9 �1AG 4/G '3*.

### E2� G' '�1 '2 5A (F/� H 1H4 "~/� H(GH� '3*A'/G �F�/ :

- A'�D /1�'A "~/� *FG' H8�AG 0.�1G 3'2� /'1/  FG ',1'� �D 3H13

- 2E'F ~'3. /G� (G H(GH� (3�'1 31�9 *1 E� 4H/

- /'/G G' /1 -'A8G 0.�1G E� 4HF/ H /H('1G 3'.*G FE� 4HF/

- �'G4 E-3H3 E51A EF'(9 H 'A2'�4 1'F/E'F

---

# F5(

### 1H4 'HD :

'(/' (1F'EG composer 1H 1H� 3�3E .H/'F �' 31H1 F5( �F�/ H /1 1E�F'D /3*H1 2�1 1H ',1' �F�/:

`

composer create-project alirezax5/telegram-base folderName

`

~3 '2 F5( A'�D .env 1H H�1'�4 �F�/ GE�F�F /3*13� 9EHE� A'�D 1H ((F/�/.

### 1H4 /HE :

`

git clone https://github.com/alirezax5/telegramBase.git

`

F�'2G �G git 1H� 3�3*E F5( ('4G.

~3 '2 �DHF /3*H1 2�1 1H /1 ~H4G � 3H13 (2F�/ :

`

composer install

`

### 1H4 3HE

/'FDH/ '2 (.4 releases

~3 '2 /'FDH/ /3*H1 2�1 1H /1 ~H4G � 3H13 (2F�/ :

`

composer install

`

A1B� FE��FG '2 �/HE 1H4 '3*A'/G �F�/.

## -'D G'� 1('

(G 7H1 �D� 1(' 2 -'D /'1G �G /1 A'�D .env (' E*:��1 BOT_MODE FE'�4 /'/G E� 4H/.

-'D* G' :

- update

- webhook

1. -'D* update

/1 -'D Update Mode  (' '3A'/G '2 E/ getUpdates D�1'E  "~/� G' /1�'A H ~1/'24 E� 4HF/. /1 '�F -'D* F�'2� (G 0.�1G �

update_id F�3 .H/P (�3 (G 7H1 .H/�'1 "F 1' E/�1� E� �F/. AB7 �'A� '3 E4.5 �F�/ (1F'EG ��HFG ('�/ ',1' H �F1D 4H/ 

2�1' '�F -'D /1 �� -DBG � (� FG'� B1'1 F/'1/.

(1'� '�F -'D  E:�1 POLLING_LIMIT '3A'/G E� 4H/ �G 9/'/ "~/� G'�� 1' �G /1 G1 ('1 A1'.H'F� /1�'A E� 4HF/  *9��F

E� �F/.

2. -'D* webhook

/1 H(GH� /1HB /1.H'3 '2 3E D�1'E (�'/ ',1' E�4G.

## -'D G'� "~/� 1('*

9D'HG (1 9��F -'D 1(' (Webhook �' Update Method)  �� -'D (1'� F-HG � /1�'A "~/� G' F�2 H,H/ /'1/ �G /1 A'�D .env

(' F'E UPDATE_MODE F8�E E� 4H/. '�F EB/'1 E� H'F/ ��� '2 /H -'D* 2�1 ('4/:

1. normal

GE'F 7H1 �G '2 F'E '�F -'D E4.5 '3  GEG ��2 (G 5H1 9'/� 9ED E� �F/ H :��1� /1 1A'1 E9EHD 1(' F3(* (G 1H4 G'�

'3*'F/'1/ 4E' '�,'/ FE� 4H/.

'�1 /1.H'3 '2 71�B Webhook /1�'A 4H/  GE'F D-8G ',1' E� 4H/.

H '�1 -'D 1(' 1H� Update Method F8�E 4/G ('4/  E7'(B GE'F 1H4 1A'1 H ~1/'24 'F,'E E� ��1/.

2. queue

-'D (9/�  "~/� 5A (F/� 4/G (Queue Update Mode) '3. /1 '�F -'D  (1 '3'3 EB/'1 F8�E 4/G /1 BOT_MODE  "~/� G'

/1�'A 4/G H E7'(B FH9 0.�1G 3'2� �G H37 E:�1 QUEUE_SAVE_TYPE E4.5 E� 4H/  0.�1G E� 4HF/ ' (9/'K *H37 Worker

~1/'24 4HF/.

/1 1H4 Update Method  D'2E '3 -DBG � (� FG'� 1' .H/'F E/�1� �F�/ �HF /1 '�F -'D E1�2 '�F (�3 1H� E/�1� ',1'� E/

"~/� F�3 H FG' H8�AG � "F 0.�1G �1/F "~/� G' (' '3A'/G '2 E/ runFetchQueueUpdate '3*. 0.�1G 3'2� F�2 (1 '3'3 EB/'1

QUEUE_SAVE_TYPE 'F,'E E� 4H/.

## F8�E' ~�4FG'/� (1'� -'D* G'

'�1 '2 G'3�F� '3A'/G E� �F�/ H /3*13� (G Supervisor F/'1�/ :

`

BOT_MODE="webhook"

UPDATE_MODE="normal"

`

'�1 /1 G'3�F� (G redis H Supervisor /313� /'1�/ :

`

BOT_MODE="webhook"

UPDATE_MODE="queue"

QUEUESAVETYPE="redis"

`

'�1 31H1 /'1�/ rabbitmq H redis 1H 3 �F�/ H ((�F�/ �/HE EF'3( *1G

/1 31H1 -E' '2 Supervisor '3A'/G �F�/ ' H1�1 G'1' E/�1� �F/

`

BOT_MODE="webhook"

UPDATE_MODE="queue"

QUEUESAVETYPE="redis"

`

'�1 /1 G'3�F� .H/ Supervisor /1 /313 F/'1�/  E,(H1 .H'G�/ 4/ '2 Cron Job '3A'/G �F�/ /1 '�F -'D E/�1� 9/'/

~1/'24 G' (1 9G/G � .H/ 4E'3. D'4 E� �FE (1'� '�F /3G '2 �'1(1'F �� B'(D� (G�FG 3'2� A1'GE �FE.

(' '�F -'D  ~�4FG'/ EF '�F '3 �G 1(' 1' 1H� 31H1 (VPS) ',1' �F�/ H '2 Supervisor (G GE1'G ��� '2 -'D* G'� 0.�1G 3'2�

redis �' rabbit '3*A'/G �F�/.

/1 '/'EG  F-HG � 1'G 'F/'2� G1 -'D 1' H6�- E� /GE.

## 1'G 'F/'2� /1 31H1

(1'� 1'G 'F/'2� 1(' 1H� 31H1  ~�4FG'/ E� �FE '2 ~FD aaPanel '3A'/G �F�/ '�F ~FD 1'��'F '3*  '(2'1G'� EH1/F�'2 1' /'1/

H A1"�F/ �'1 (' "F (3�'1 3'/G '3*.

(1'� F5( aaPanel (G D�F� 2�1 E1',9G �F�/:

https://www.aapanel.com/new/download.html

~3 '2 F5(  '2 (.4 App Store (App) '(2'1G'� EH1/ F�'2 1' F5( �F�/.

3H13 ~1H�G 1' /1 E3�1 EH1/F81 "~DH/ �F�/.

3~3 '2 (.4 Supervisor �2�FG 'A2H/F 3� (Add Daemon) 1' 'F.'( �F�/ H A�D/G' 1' (G 4�D 2�1 *�E�D �F�/:

Name �� F'E /D.H'G (G 2('F 'F�D�3� H'1/ �F�/ ((/HF A'5DG).

Run User EB/'1 1' 1H� root B1'1 /G�/.

Process Directory E3�1 ~1H�G 1' H'1/ �F�/.

Start Command /3H1 ',1'� 1(' 1' H'1/ �F�/.

�HF '2 PHP '3A'/G E� �F�/  /3H1 E4'(G ��� '2 EH'1/ 2�1 .H'G/ (H/:

</div>

`

php /yourpath/bot.php

`

<div dir="rtl">

�' F3.G php EH1/ F81 :

</div>

`

/www/server/php/84/bin/php /yourpath/bot.php

`

<div dir="rtl">

F�G: /1 E3�1 ('D' (G ,'� 84 F3.G PHP F5( 4/G 1H� 31H1'F 1' B1'1 /G�/.

H (G ,'� E3�1  A'�D E1(H7 (G Worker 1' H'1/ �F�/ (/1 '/'EG 3H13 /3*H1 1' B1'1 E� /GE).

/1 '/'EG F8�E' *�E�D� Supervisor:

Processes *9/'/ WorkerG'� EH1/ F�'2. (1'� 41H9 EB/'1 2 ~�4FG'/ E� 4H/.

Startup Priority 1�( ',1'� (1F'EG G' F�'2� (G *:��1 F/'1/.

~3 '2 0.�1G  Worker 41H9 (G ',1' .H'G/ �1/ H (1F'EG (G 7H1 .H/�'1 E/�1�* ~1/'24 G' 1' 'F,'E E� /G/.

'�1 '2 cpanel H directadmin �' G1 1H4 (G ,2 aapanel E�.H'�/ '3*A'/G �F�/ '(2'1 G'� EH1/ F�'2 1H F5( �F�/ H '�G (G �'FA��

~�4FG'/� (1'� Supervisor F�'2 /'4*�/ :

</div>

`

[program:name]

command=/www/server/php/84/bin/php /www/wwwroot/domain/newBase/bot.php

directory=/www/wwwroot/domain/newBase

autorestart=true

startsecs=3

startretries=3

stdout_logfile=/www/server/panel/plugin/supervisor/log/test.out.log

stderr_logfile=/www/server/panel/plugin/supervisor/log/test.err.log

stdoutlogfilemaxbytes=2MB

stderrlogfilemaxbytes=2MB

user=root

priority=999

numprocs=2

stopsignal=QUIT

process_name=name

`

<div dir="rtl">

# A'�D G'� EH1/ F�'2

'�1 1H4 "~/� normal '3A'/G E� �F�/ :

</div>

`php

use alirezax5\TelegramBase\App\Core;

include './vendor/autoload.php';

$core = new Core();

$core->run();

`

<div dir="rtl">

'�1 '2 1H4 queue '3*A'/G E� �F�/

A'�D /1�'A "~/� G' :

</div>

`php

use alirezax5\TelegramBase\App\Core;

include './vendor/autoload.php';

$core = new Core();

$core->run();

`

<div dir="rtl">

'�1 B1'1G H(GH� 3* �F�/ 1H� GE�F A'�D ('�/ ('4G.

A'�D H1�1 G' :

</div>

`php

<?php

use alirezax5\TelegramBase\App\Core;

include './vendor/autoload.php';

$core = new Core(true);

$core->runFetchQueueUpdate();

`

<div dir="rtl">

'�F A'�D 1H ('�/ /1 Supervisor H �' cronjob 3* �F�/.

~�4FG'/ E��FE '2 GEHF Supervisor '3A'/G �F�/ �HF cronjob ('�/ .H/HF ~1H�33 G'1H E/�1�* �F�/ 'E' Supervisor .H/4 '�F

�'1' 1H 'F,'E EF�/G.

# ~D'��F G'

4E' /1 A'�D .env (' EB/'1 PLUGINS_DIR E�*HF�/ E3�1 ~D'��F G'1H E4.5 �F�/

~�4A16 /1 ~H4G Plugin ('�/ B1'1 (/�/.

FEHFG �/ :

</div>

`php

<?php

namespace alirezax5\TelegramBase\Plugin;

use alirezax5\TelegramBase\App\Plugin\PluginBase;

use alirezax5\TelegramBase\App\Shared\SharedManagement;

use telegramBotApiPhp\Telegram;

class Start implements PluginBase

{

public function getPriority(): int

{

return 1;

}

public function onMessage($update, Telegram $telegram)

{

SharedManagement::set('findCommand', 'na');

$telegram->sendMessage($update->from->id, $update->text, reply_markup: btn('start'));

}

public function onEditedMessage($update, Telegram $telegram)

{

}

public function onCallbackQuery($update, Telegram $telegram)

{

}

public function onInlineQuery($update, Telegram $telegram)

{

}

public function onPollAnswer($update, Telegram $telegram)

{

}

#.. 3'�1 "~/�* G'

public function before($update, Telegram $telegram)

{

}

public function after($update, Telegram $telegram)

{

}

}

`

<div dir="rtl">

F'E E/G' /1 3'.'1 PascalCase 91�A E� 4HF/ H G1 FH9 "~/�  (G E*/ E.5H5 .H/4 '13'D .H'G/ 4/.

~'1'E1G'� $update H $telegram /1 E'E E/G' (G 5H1 +'(* '13'D E� 4HF/.

E*/ getPriority

'�F E/ (1'� 9��F 'HDH� ',1'� ~D'��F '3A'/G E� 4H/.

~�4FG'/ E� 4H/ GF�'E /1�'A '7D'9' 'HD�G � �'1(1  EB/'1 'HDH�* 1' 1H� 0 B1'1 /G�/.

'�1 1�( ',1'� ~D'��F (1'� 4E' 'GE�� F/'1/  EB/'1 999 1' F8�E �F�/.

E*/G'� before H after

before B(D '2 ',1'� E/ E1(H7 (G "~/� A1'.H'F� E� 4H/.

after ~3 '2 ',1'� E/ "~/� ',1' .H'G/ 4/.

'�F 3'.'1 (G 4E' ','2G E� /G/ EF7B ~�4 ~1/'24 H ~3 ~1/'24 1' (G 5H1 E,2' H E�2 E/�1� �F�/.

# 2('F G'

(�3 (G 4E' '�F 'E�'F 1H E�/G �� 1(' �F/2('FG 1H H39G (/�/

/1 A'�D .env 4E' E� H'F�/ 2('F ~�4A16,E3�1 2('F G' H E/ 2E'F �4 2('F G' 1' *F8�E FE'��/.

~�4A16 /1 ~H4G Language H (' ~3HF/ json ('�/ E*HF .H/ 1H 0..�1G �F�/.

(1'� A1.H'F� EF H :��1 2('F E� H'F�/ '2 E+'D 2�1 '3A'/G �F�/ :

</div>

`php

<?php

# /1�'A 1,EG (1'3'3 F'E �D�/ /1 A'�D json

('name');

# (1'� *F8�E 2('F

Language::getInstance()->setLanguageDir( 'fa');

# (1'� ,'��2�F �1/F EB/'1 .'5 /1 EF 1,EG

('name',['id'=>1]);

`

<div dir="rtl">

FEHFG A'�D 2('F :

</div>

`json

{

"start": "E*F 41H9",

"id": "FEHFG EF (' E:��1 /'�F'E�� #id",

"btn_name": "F'E"

}

`

<div dir="rtl">

# /�EG G'

/�EG G' (G 5H1* ~�4 A16 /1 A'�D btn.php /1 1�4G � 3H13 B1'1 /'1F/.

/1 5H1 F�'2  E� H'F�/ E3�1 '�F A'�D 1' '2 71�B F8�E' .env *:��1 /G�/.

FEHFG � A'�D *91�A /�EG G':

</div>

`php

<?php

return [

"remove" => ['KeyboardRemove' => [], 'remove_keyboard' => true],

"start" => [

'keyboard' => [

[

['text' => ('btn_name')],

],

],

'resize_keyboard' => true

]

];

`

<div dir="rtl">

(1'� '3A'/G '2 ~D'��F G' '2 E/ btn '3*A'/G �F�/

E+'D (1'� '3*A'/G /1 ~D'��F G' :

</div>

`php

<?php

namespace alirezax5\TelegramBase\Plugin;

use alirezax5\TelegramBase\App\Plugin\PluginBase;

use alirezax5\TelegramBase\App\Shared\SharedManagement;

use telegramBotApiPhp\Telegram;

class Start implements PluginBase

{

public function getPriority(): int

{

return 1;

}

public function onMessage($update, Telegram $telegram)

{

$telegram->sendMessage($update->from->id, $update->text, reply_markup: btn('start'));

}

}

`

<div dir="rtl">

# /�*'(�3

F8�E' E1(H7 (G /�'(�3 1' E� H'F�/ /1 A'�D .env H�1'�4 �F�/.

'2 "F ,'�� �G '�F (�3 '2 illuminate/database '3A'/G E� �F/  E� H'F�/ (1'� F-HG � �'1 (' �H&1� G' H E/D G' '2 E3F/' D'1'HD �E� (��1�/:

=�� https://laravel.com/docs/12.x/queries

(G 7H1 �D�  A'�D G'� E1(H7 (G /�*'(�3 1' /1 ~H4G � Database B1'1 /G�/.

FEHFG � 3'.'1 H 91�A /�*'(�3:

</div>

`php

<?php

namespace Database;

use Carbon\Carbon;

use Illuminate\Database\Eloquent\Model;

use Illuminate\Database\Capsule\Manager as DB;

class Users extends Model

{

protected $table = 'users';

protected $primaryKey = 'chatid';

protected $casts = [

'active' => 'boolean',

'status' => 'boolean'

];

public $timestamps = false;

public static function checkAndInsert(int $chatid): bool

{

return !self::check($chatid) && self::insertOrIgnore(['chatid' => $chatid]);

}

public static function check(int $chatid): bool

{

return self::where('chatid', $chatid)->exists();

}

public static function getAllStatusActiveUser(bool $limit = true, int $page = 1, int $per = 20)

{

$query = self::where('status', true)->orderBy('id');

return $limit ? $query->paginate($per, ['*'], 'page', $page) : $query->get();

}

public static function getAllStatusActiveUserByLang($lang = 'all',bool $limit = true, int $page = 1, int $per = 20)

{

if ($lang == 'all')

$query = self::where('status', true)->orderBy('id');

else

$query = self::where('status', true)->where('lang', $lang)->orderBy('id');

return $limit ? $query->paginate($per, ['*'], 'page', $page) : $query->get();

}

public static function getAllActiveUser(bool $limit = true, int $page = 1, int $per = 20)

{

$query = self::where('active', true)->orderBy('id', 'DESC');

return $limit ? $query->paginate($per, ['*'], 'page', $page) : $query->get();

}

public static function getAll(bool $limit = true, int $page = 1, int $per = 20)

{

$query = self::orderBy('id');

return $limit ? $query->paginate($per, ['*'], 'page', $page) : $query->get();

}

public static function getByRole(string $role)

{

return self::where('role', $role)->get(['id', 'chatid']);

}

public static function getAdmins()

{

return self::getByRole('admin');

}

public static function getCountByField(string $field, $value): int

{

return self::where($field, $value)->count();

}

public static function getCountAll(): int

{

return self::count();

}

public static function getCountAdmin(): int

{

return self::getCountByField('role', 'admin');

}

public static function getUser(int $chatid)

{

return self::where('chatid', $chatid)->first();

}

public static function getUserById($id)

{

return self::where('id', $id)->first();

}

public static function updateFieldByChatId(int $chatid, string $field, $value): bool

{

return self::where('chatid', $chatid)->update([$field => $value]);

}

public static function getRecentUsers()

{

$twentyFourHoursAgo = Carbon::today();

$recentUsers = DB::table('users')

->where('create_at', '>=', $twentyFourHoursAgo)

->count();

return $recentUsers;

}

}

`

<div dir="rtl">

3'.'1 ('�/ GE�F 4�D ('4G 'E' E/ G'� EH1/ '3*A'/G 1H '2 D'1'HD E7'D9G �F�/

# '4*1'� /'/G G' (�F ~D'��F G'

7(B E+'D 2�1 E�HF�/ /'/G G'1H (�F ~D'��F G' (G '41'� (�0'1�/.

/'/G G' (9/ '2 ',1'� �� "~/�* ~'� E� 4HF/.

</div>

`php

<?php

use alirezax5\TelegramBase\App\Shared\SharedManagement;

#+(* /'/G

SharedManagement::set('findCommand', 'na');

#/1�'A* /'/G

SharedManagement::get('findCommand', 'default');

#+( /'/G '� �G (9/ '2 'F,'E "~/� ~'� F4H/.

SharedManagement::set('findCommand', 'na',true);

`

<div dir="rtl">

# D'� ��1�

(1'� F8�E E3�1 A'�D D'�  F'E A'�D  H GE�F�F A9'D �' :�1A9'D �1/F 3�3E D'�  E� H'F�/ EB'/�1 E1(H7G 1' /1 A'�D .env :��1 /G�/.

FEHFG '� '2 +(* D'�:

</div>

`php

<?php

use alirezax5\TelegramBase\App\Logger\LogHandler;

LogHandler::warning("warning");

LogHandler::info('info');

`

<div dir="rtl">

</div>


All versions of telegram-base with dependencies

PHP Build Version
Package Version
Requires alirezax5/telegram-bot-php Version ^3.0.1
vlucas/phpdotenv Version ^5.6
monolog/monolog Version ^3.9
illuminate/database Version ^10.0
php-amqplib/php-amqplib Version ^2.8
symfony/filesystem Version ^7.3
illuminate/cache Version ^10.49
illuminate/filesystem Version ^10.49
illuminate/events Version ^10.49
predis/predis Version ^3.4
illuminate/redis Version ^10.49
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alirezax5/telegram-base contains the following files

Loading the files please wait ...