Download the PHP package eslamfaroug/laravel-wordpress-sync without Composer

On this page you can find all versions of the php package eslamfaroug/laravel-wordpress-sync. 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-wordpress-sync

Laravel WordPress Sync

License: MIT

Laravel WordPress Sync is a Laravel package designed to sync Laravel posts with WordPress using the REST API based on specific conditions and publication status. You can easily customize the fields that are sent to WordPress and define the sync conditions.

Requirements

Installation

You can install the package via Composer:

Usage Instructions

1. Setting Up the Model

After installing the package, the first step is to set up your Laravel model. Let's assume you have a model named Post.

2. Implement WordpressSyncInterface and Use the SyncsWithWordpress Trait

Modify your Post model to implement WordpressSyncInterface and use the SyncsWithWordpress trait.

3. Defining the Fields to Send to WordPress

In getWordpressFieldsMapping(), you define the fields in the Post model that you want to send to WordPress and the corresponding fields in WordPress.

4. Defining the Sync Condition

In shouldSyncWithWordpress(), you define a specific condition that must be met for the post to be sent to WordPress. For example, syncing may occur only if the publish status is true and the views count is greater than 100.

5. Defining the Status Field

In getStatusField(), you define the name of the status field in the Post model. This field will be used to determine whether the post will be published (publish) or saved as a draft (draft) in WordPress.

6. Configuring the WordPress API Settings

To make the library more flexible, you can configure the WordPress domain and API path in the .env file of your Laravel project. Add the following entries to your .env file:

These environment variables will be used by the package to connect to your WordPress site.

7. Setting Up Migrations and Service Provider

The package includes migrations to create necessary database tables for managing WordPress posts. To ensure these migrations are run in your Laravel application, make sure the LaravelWordpressSyncServiceProvider is registered.

You can publish the migrations using the following command:

This will copy the migration files to your application's database/migrations directory. Once published, you can run the migrations with:

Alternatively, the migrations will be automatically loaded from the package when you run the migrate command if you prefer not to publish them.

8. Testing the Sync

After completing these steps, posts will automatically sync with WordPress when they are created, updated, or deleted, based on the conditions defined in the Post model.

License

This package is distributed under the MIT License. See the LICENSE file for more information.


All versions of laravel-wordpress-sync with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version ^7.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 eslamfaroug/laravel-wordpress-sync contains the following files

Loading the files please wait ....