Download the PHP package williamson/laragram without Composer

On this page you can find all versions of the php package williamson/laragram. 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 laragram

Laravel Wrapper for telegram-cli

This project was originally forked from: php-telegram-cli-client and credit to zyberspace for the start I needed to get this project working.

What is new in 1.0?

What is it?

This project allows you to use the lovely Laravel syntax you are familar with to quickly and easily send messages / images / documents / audio files / location via Telegram Messenger with the aid of telegram-cli running on your server.

It allows you do things like:

or

or

Of course if you don't like using Facades you can always revert to

Requirements

Installing Telegram-cli

Setup telegram-cli

Telegram-cli needs to run on a unix-socket (-S) or a port (-P), so laragram can connect to it. Please read the instructions at telegram-cli on how to configure and then make

If your build was successful you can continue!

First time running telegram-cli

If you never started telegram-cli before, you need to start it first in normal mode, so you can type in your telegram-phone-number and register it.

Assuming you installed telegram in ~/telegram your command should look like this: ~/telegram/bin/telegram-cli.

Once registered, you can exit telegram-cli (safe_quit) and launch it as a daemon.

Running telegram-cli as a daemon

To run telegram-cli as a daemon you need to use the -d flag and set a unix socket -S.

Or instead you may use a TCP port

The -W switch means the contact-list gets loaded on startup - this allows you to send messages straight away. The & at the ends means that the command will load in the background allowing you to continue with the script.

To stop the daemon use killall telegram-cli or kill -TERM [telegram-pid].

You now have Telegram-cli working and waiting to be told what to send!

To ensure your daemon does not exit unexpectantly, you can use something like supervisor to make sure the process always is running. See notes at the end of how this can be set up.

Installing Laragram

Install Laragram with composer

In your laravel project-root:

Service Providers and Facades

Open config/app.php file, find the providers array and add to the bottom

If you're running Laravel 5.1 or greater you can use this syntax instead in the config/app.php file:

Note the lack of single quotes for the laravel 5 version.

Now you add the following line to the Alias array in config/app.php to register the shorthand TG facade

Open config/services.php file, add the following array to specify what type of socket you would like to connect to the telegram daemon.

Other values include unix sockets. ie 'socket' => 'unix:///tmp/tg.sck'

You're done!

Using Laragram

Now anywhere in your app you can send a telegram message quickly and easily like follows:

Remember that the name should have underscores instead of spaces eg firstname_lastname, OR you can use user#and then the persons telegram ID directly. This method is far more reliable. eg user#123456789

In addition to sendMessage, the following commands are available to you:

License

This software is licensed under the Mozilla Public License v. 2.0. For more information, read the file LICENSE.

Using Supervisor

Assuming that you have

Then create a new file /etc/supervisor/conf.d/telegram.conf

and copy the following into it, adding/replacing any log files you wish to create

Save the file and restart supervisor (make sure that telegram-cli is NOT running before you do this, supervisor will now take care of insuring that the process always runs even if it crashes).

You can view how the process is doing by using the monitoring program


All versions of laragram with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-curl Version *
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 williamson/laragram contains the following files

Loading the files please wait ....