Download the PHP package apptank/horusync without Composer

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

Horusync Logo
Build Status Latest Stable Version License Ask DeepWiki

Please note: This library currently is in testing stage until publish the version 1.0.0.

Horus Sync

This library provides an easy way to manage data synchronization between a remote database on a server and a local database on a mobile device. It defines a set of synchronizable entities by specifying their parameters and relationships with other entities.

Features

📦 Installation

This library must be used with Laravel version 11 or higher.

Use the following command to install the package using Composer:

🔨 Usage

All synchronizable models with editable records must inherit from WritableEntitySynchronizable, defining the properties they contain. If you want a read-only entity, you should inherit from ReadableEntitySynchronizable.

You can use an artisan command to generate a synchronizable model for you. You just need to specify the path where the model should be stored. The following example will create a model in App/Models/Sync/MyModelSync:

If you want to create a read-only entity, you can add the --readable option to the artisan command.

🚀 Quick Start

1. Initialization

It is necessary to initialize the Horus container in the AppServiceProvider of Laravel by passing an array with the hierarchical map of entities.

You can optionally

2. Run Migrations

Once the Horus container has been initialized, you need to run the synchronization tables migrations.

⬆️ Enable upload files

To enable the upload files feature, you need setup a file handler in horus initialization, implementing the IFileHandler interface.

In your writable entity synchronizable model, you can define the file attribute using the SyncParameter::createReferenceFile method.

Local File Handler example

The following example shows how to implement a file handler for local file storage using Laravel's storage system.

Prune files

If you want to delete files that are no longer referenced by any entity, you can use the following command:

↔️ Middlewares

If you want to implement custom middlewares for the synchronization routes, you can do so in your Service Provider as follows:

🔒 Authentication and Permissions

The following code shows how to configure user authentication and the permissions associated with entities. Using the UserAuth class, you define an authenticated user along with the entities they have access to and the corresponding permissions.

(Recommend) Setup entity granted on validate entity was granted to void sync issues.

⛔ Entity Restrictions

If you want to apply a restriction to an entity, you can use the next restriction classes:

Setup after initialization

By default, the setup is set the Config class in the Horus initialization, but if you want to change the restrictions after you can use the next code:

🍒 Shared entities

If you want to share records from specific entities, you can use the method setSharedEntities or setupOnSharedEntities in the Horus instance like this:

(Recommend) This way, only setup the shared entities when Horus needs it.

✉️ Events

If you want to listen to events that occur during synchronization, you can use the following code:

Insert Event

Update Event

Delete Event


All versions of horusync with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^11.0
illuminate/console Version ^11.0
illuminate/http Version ^11.0
illuminate/database Version ^11.0
league/commonmark Version ^2.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 apptank/horusync contains the following files

Loading the files please wait ...