Download the PHP package accordsync/laravel without Composer

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

accordsync/laravel

The Accord sync server inside a Laravel app: a service provider, config/accord.php, the sync routes, php artisan accord:migrate / accord:compact, and compaction in the scheduler. All sync behaviour comes from accordsync/server; this package only wires it in. Laravel 11+ (tested with 13), PHP 8.3+, PostgreSQL.

Install

The provider is auto-discovered.

Declare the server

config/accord.php points at your definition: what AccordServer::define() returns (schema, a scope function per record type, access from JWT claims, auth, limits). Use an invokable class so that php artisan config:cache keeps working; its __invoke() parameters are injected by the container.

A closure returning the definition also works, but closures cannot be cached by config:cache.

Configuration

Key Env Default
definition ACCORD_DEFINITION none class name or closure (above)
prefix ACCORD_PREFIX accord routes are /{prefix}/health, /{prefix}/v1/push, /{prefix}/v1/pull; clients use https://your-app/{prefix} as their server URL. Empty: served at the root
middleware [] extra route middleware (keep it stateless)
database.url ACCORD_DATABASE_URL none postgres://user:password@host:5432/db: Accord opens its own persistent connection
database.connection ACCORD_DB_CONNECTION default connection otherwise the PDO of this Laravel connection, which must use the pgsql driver
rate_limit.store ACCORD_RATE_LIMIT_STORE default store cache store holding the rate-limit buckets; it must support atomic locks
schedule ACCORD_SCHEDULE true register accord:compact with the scheduler

Run

Serve the app as usual (PHP-FPM, FrankenPHP...). Each PHP worker handles one request at a time, so the worker pool size bounds concurrent pushes.

Use a persistent database connection ('options' => [PDO::ATTR_PERSISTENT => true] on the pgsql connection, or ACCORD_DATABASE_URL, which is always persistent). Otherwise every sync request opens a PostgreSQL connection, about 10 ms with SCRAM authentication. Laravel also runs set names and set search_path when it opens a connection, persistent or not, if the connection config has charset or search_path: leave them out when the database defaults are right.

Compaction

php artisan accord:compact runs compaction once. When the definition's compaction.intervalMs is above 0 (default one hour) and schedule is on, the provider registers accord:compact with Laravel's scheduler (withoutOverlapping(); intervals are rounded to whole minutes under an hour, whole hours above), so the usual * * * * * php artisan schedule:run cron entry runs it. Compaction takes PostgreSQL's exclusive advisory lock, so two servers compacting at once do not conflict.

Security notes

The tested setup is examples/laravel-app, which passes the Accord server conformance suite (68 tests) in CI; see docs/adr/0010-example-apps-and-serving.md.


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
accordsync/server Version ^0.3
illuminate/support Version ^11.0 || ^12.0 || ^13.0
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
illuminate/cache Version ^11.0 || ^12.0 || ^13.0
nyholm/psr7 Version ^1.8
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 accordsync/laravel contains the following files

Loading the files please wait ...