Download the PHP package laravel-notification-channels/twitter without Composer

On this page you can find all versions of the php package laravel-notification-channels/twitter. 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 twitter

image

Twitter notification channel for Laravel

Latest Version on Packagist StyleCI Quality Score Code Coverage Total Downloads

This package makes it easy to send Laravel notifications using Twitter. (Laravel 8+)

PS: v8 now uses the new Twitter API V2. Please read the upgrade guide for your app here.

Contents

About

This package is part of the Laravel Notification Channels project. It provides additional Laravel Notification channels to the ones given by Laravel itself.

The Twitter channel makes it possible to send out Laravel notifications as a Twitter tweet (post on the timeline) or as a direct message.

Installation

If you prefer a video, there is also an introduction video available for you. If not, just read on.

You can install this package via composer:

The service provider gets loaded automatically.

Twitter App & Credentials

You will need to create a Twitter app to use this channel. Within this app, you will find the keys and access tokens.

Your Twitter app must be within a project. Also, make sure to activate the user authentication settings:

image

After that, you have to regenerate your access token and secret. If done correctly, you should see the right permissions for your access tokens:

image

Make sure to copy the right credentials and place them inside your .env file.

image

To load them, add this to your config/services.php file:

Usage

To use this package, you need to create a notification class, like NewsWasPublished from the example below, in your Laravel application. Make sure to check out Laravel's documentation for this process.

Publish a Twitter status update

Take a closer look at the toTwitter method. Here, we define what kind of Twitter message we want to trigger. In this case, it is a status update message, which is just a new message in your timeline.

``

Publish Twitter status update with images

It is possible to publish images with your status update too. You have to pass the image path to the withImage method. If you want to use multiple images, just pass an array of paths.

Publish Twitter status update with videos

It is possible to publish videos with your status update too. You have to pass the video path to the withVideo method. If you want to use multiple videos, just pass an array of paths.

Publish Twitter status update with both images and videos

It is also possible to publish both images and videos with your status by using a mixture of the two methods. ``

Publish a Twitter status update in reply to another tweet

Additionally, you can publish a status update in reply to another tweet. This is possible by using the inReplyTo method. ``

Note that the reply status ID will be ignored if you omit the author of the original tweet, according to Twitter docs.

Send a direct message (NOT working with the FREE Twitter API plan!)

To send a Twitter direct message to a specific user, you will need the TwitterDirectMessage class. Provide the Twitter user handler as the first parameter and the message as the second one. ``

You can also provide the user ID instead of the screen name. This would prevent an extra Twitter API call. Make sure to pass it as an integer when you do.

``

Handle multiple Twitter Accounts

There might be cases where you need to handle multiple Twitter accounts. This means you need to be able to change the provided keys and tokens of your Twitter app. Luckily, Laravel can help you here. In your notifiable model, you can define the routeNotifiactionForTwitter method. Here you can override the provided settings.

``

Changelog

Please see CHANGELOG for more information about what has changed recently.

Testing

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of twitter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
abraham/twitteroauth Version ^5.0|^6.0
illuminate/notifications Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
kylewm/brevity Version ^0.2.9
ext-fileinfo 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 laravel-notification-channels/twitter contains the following files

Loading the files please wait ....