Download the PHP package hamzahassanm/laravel-social-auto-post without Composer

On this page you can find all versions of the php package hamzahassanm/laravel-social-auto-post. 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 laravel-social-auto-post

Laravel Social Auto Post

A Laravel package to facilitate automatic social media posting on platforms like Facebook and Telegram.

Available Languages

Installation

To install the package, run the following command:

Configuration

After installing the package, publish the configuration file using the following command:

This command will create a config/autopost.php file where you can configure your social media credentials and other settings.

Example Configuration

In your config/autopost.php file, add your Facebook and Telegram credentials:

Ensure you update your .env file with the necessary credentials:

Usage

The package provides two facades for simple interaction with Facebook and Telegram.

Facebook Methods

The FaceBook facade provides the following methods:

1. share(string $caption, string $url)

Posts a status update with a URL to your Facebook page.

2. shareImage(string $caption, string $image_url)

Posts an image with a caption to your Facebook page.

3. shareVideo(string $caption, string $video_url)

Posts a video with a caption to your Facebook page.

4. getPageInsights(array $metrics = [], array $additionalParams = [])

Retrieves insights (metrics) about your Facebook page. You can specify an array of metrics to retrieve or leave it empty to get default metrics.

This method returns various insights depending on the metrics requested. The metrics can include page impressions, page views, page engagement, and more.

5. getPageInfo()

Retrieves basic information about your Facebook page, such as name, category, and other details.

This method is useful when you want to fetch the current details of your Facebook page, such as the number of likes, category, or description.


Telegram Methods

The Telegram facade offers the following methods for interacting with Telegram:

1. share(string $caption, string $url)

Posts a message with a caption and link to your Telegram chat.

2. shareImage(string $caption, string $image_url)

Posts an image with a caption to your Telegram chat.

3. shareDocument(string $caption, string $document_url)

Shares a document with a caption in your Telegram chat.

4. shareVideo(string $caption, string $video_url)

Posts a video with a caption to your Telegram chat.

5. getUpdates()

Retrieves updates (messages and events) from your Telegram bot.


Error Handling

When using the package to post on social media, exceptions might occur if the API tokens are invalid, the API limits are exceeded, or there's an error with the request. You can handle such exceptions as follows:

Facades

The package provides two facades for easy access to social media platforms:

Facebook Facade Methods

Telegram Facade Methods

Service Provider (Optional for Laravel 11)

For Laravel 11, you need to manually register the service provider in the bootstrap/providers.php file if auto-discovery isn't enabled:

For Laravel versions that support package auto-discovery, this step is unnecessary.

Testing the Package

Using Docker for Testing

To ensure that the package works correctly in all environments, you can use Docker to build a consistent testing environment.

1. Clone the Repository

2. Build the Docker Image

Use Docker to build the testing environment:

3. Run the Tests

After building the Docker image, you can run the tests:

This command will start a container and execute the tests using PHPUnit.

4. Manually Access the Docker Container (Optional)

For debugging purposes, you can manually enter the container:

Within the container, you can run additional tests or commands:

5. Clean Up Docker Containers

Once testing is complete, remove the containers:


License

This package is licensed under the MIT License.

Contributing

Feel free to open issues or submit pull requests to improve this package. Please ensure that your contributions adhere to the existing code style and pass all tests.

Contact

For any questions or issues, feel free to reach out to HamzaHassanM.


Additional Notes

1.Future Enhancements: The package could be expanded to support additional platforms such as Twitter, LinkedIn, or Instagram.


All versions of laravel-social-auto-post with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^11.0
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 hamzahassanm/laravel-social-auto-post contains the following files

Loading the files please wait ....