Download the PHP package mateusz-peczkowski/nova-heartbeat-resource-field without Composer
On this page you can find all versions of the php package mateusz-peczkowski/nova-heartbeat-resource-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mateusz-peczkowski/nova-heartbeat-resource-field
More information about mateusz-peczkowski/nova-heartbeat-resource-field
Files in mateusz-peczkowski/nova-heartbeat-resource-field
Package nova-heartbeat-resource-field
Short Description Heartbeat for resources to block editing same resource with 2 or more people
License MIT
Informations about the package nova-heartbeat-resource-field
Heartbeat Resource Field
This package provides a custom Nova field that will like heartbeat monitor watch who is editing currently the resource.
On a listing/details there will be information who is currently editing and as well another person will be blocked from editing the same resource to not overlap changes.
Package is made for Laravel Nova ^4.
Installation
You can install the package via composer:
Migrations
After installation, you need to run the migration to create the table that will store the heartbeat data.
Publish package (optional)
Publish the configuration file to customize the settings of the package (check bellow for more details).
Configuration
The package provides a configuration file that allows you to customize the settings of the package.
Usage
Nova Resource Field
To install this field in your Nova resource, you need to add the following code to the fields
method of your resource.
Optionally you can allow to retake the resource by adding the following code
Then on details view you will have additional button to retake the resource.
Nova Resource Trait
Add this trait to your Nova resource
Model Trait
Add this trait to your Model
Clearing expired heartbeats (recommended)
In case of failure of removing the heartbeat, you can use the following command to remove all the heartbeats that are older than the timeout.