Download the PHP package keepsuit/laravel-temporal without Composer

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

Laravel temporal.io

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package allow an easy integration of a Laravel app with a temporal.io, which is a distributed, scalable, durable, and highly available orchestration engine for asynchronous long-running business logic in a microservice architecture.

This package provides:

Installation

You can install the package via composer:

Then download the latest roadrunner executable for your platform:

or

[!NOTE] You should run this command after every update to ensure that you have the latest version of roadrunner executable.

You can publish the config file with:

This is the contents of the published config file:

Usage

Here we will see the utilities provided by this package. For more information about Temporal and Workflow/Activity options please refer to the official documentation.

Create workflows and activities

To create a new workflow, you can use the temporal:make:workflow {name} command, which will create a new workflow interface & relative class in the app/Temporal/Workflows directory.

To create a new activity, you can use the temporal:make:activity {name} command, which will create a new activity interface & relative class in the app/Temporal/Activities directory.

[!NOTE] If you already have workflow/activities in app/Workflows and app/Activities directories, the make commands will create the new workflow/activity in the these directories.

Workflows in app/Temporal/Workflows and app/Workflows and activities in app/Temporal/Activities, app/Activities, app/Temporal/Workflows and app/Workflows are automatically registered. If you put your workflows and activities in other directories, you can register them manually in the workflows and activities config keys or with TemporalRegistry in your service provider.

Build and start a workflow

To start a workflow, you must build a stub through the Temporal Facade.

Build and start an activity

To start an activity, you must build a stub through the Temporal Facade (note that activities must be built inside a workflow). Activity methods returns a Generator, so you must use the yield keyword to wait for the result.

Build and start a child workflow

Child workflows works like activity and like activities must be built inside a workflow.

Input and output payloads

Payloads provided to workflows/activities as params and returned from them must be serialized, sent to the Temporal server and deserialized by the worker. Activities can be executed by workers written in different languages, so the payload must be serialized in a common format. Out of the box temporal sdk supports native php types and protobuf messages. This package adds some laravel specific options for serialization/deserialization of objects:

Spatie/Laravel-Data support

spatie/laravel-data is a package that provides a simple way to work with data objects in Laravel. In order to take full advantage of laravel-data, it is suggested to use v4.3.0 or higher.

[!NOTE] The provided TemporalSerializableCastAndTransformer is compatible only with laravel-data v4.3 or higher, if you are using an older version you can create your cast/transform.

Changes to be made in config/data.php:

Interceptors

Temporal interceptors are similar to laravel middleware and can be used to modify inbound and outbound SDK calls. Interceptors can be registered in the interceptors config key. See temporal sdk v2.7 release notes for more information. To create a new interceptor, you can use the temporal:make:interceptor {name} command, which will create a new interceptor class in the app/Temporal/Interceptors directory.

Run the temporal worker

To run the temporal worker, you can use the temporal:work {queue?} command.

If you want to customize the options of the temporal worker, you can call Temporal::buildWorkerOptionsUsing in your service provider:

Testing utilities

In order to test workflows end-to-end, you need a temporal server running. This package provides two options to run a temporal server for testing purposes:

When using WithTemporal trait, you can set TEMPORAL_TESTING_SERVER env variable to false to disable the testing server and run only the worker.

Time skipping

The default temporal server implementation is the dev server included in the temporal cli and this doesn't support time skipping. In order to enable time skipping, you must:

Mocking workflows

Mocking a workflow can be useful when the workflow should be executed in another service or simply when you want to test other parts of your code without running the workflow. This works for child workflows too.

Mocking activities

Mocking activities works like workflows, but for activity you must provide interface and the method to mock.

Assertions

Dispatches assertions can be done through the Temporal facade but there are some downsides compared to the options above:

PHPStan

This package provides a PHPStan extension to improve the experience when working with Temporal proxy classes.

If you have phpstan/extension-installer installed, you are ready to go. Otherwise, you have to add the extension to your phpstan.neon file:

Testing

Changelog

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

Credits

License

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


All versions of laravel-temporal with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
composer/class-map-generator Version ^1.0
illuminate/contracts Version ^10.0 || ^11.0
spatie/laravel-package-tools Version ^1.14.0
spiral/roadrunner Version ^2023.2 || ^2024.0
spiral/roadrunner-cli Version ^2.5
symfony/process Version ^6.0 || ^7.0
temporal/sdk Version ~2.7.4 || ~2.8.0 || ~2.9.0 || ~2.10.0 || ~2.11.0
thecodingmachine/safe Version ^2.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 keepsuit/laravel-temporal contains the following files

Loading the files please wait ....