I need to add the Telegram madelineproto library to my Laravel project. How can I do it via composer and How can I call it in my controllers
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
3
Answers
You can’t add it via composer.
https://packagist.org/packages/danog/madelineproto
It’s not a package. It’s whole project.
If you look at https://github.com/danog/MadelineProto/blob/master/composer.json
You will see it’s not a package.
for faster code, use these steps:
Step 1:
download the
danog/MadelineProto
as a zip file, export the content of the zip file on a folder named ‘lib/MadelineProto-master’,Step 2:
use terminal to compose the
MadelineProto
venders--ignore-platform-reqs
is needed to ignore the PHP version and so on.the composer will download all the vender on
lib/MadelineProto-master/vendor
Step 3:
on your controller call the project lib like this:
Slow Solution:
this solution will take 3-4s per call:
https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-existing-project
Register
danogMadelineProtoAPI
class to Laravel Service ContainerOr use ready wrapper
https://github.com/setiawanhu/laravel-madeline-proto