PHPackages                             desmart/laravel-padlock - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. desmart/laravel-padlock

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

desmart/laravel-padlock
=======================

Script locking mechanism for Laravel. Enables blocking scripts execution for given period, for example to avoid cron jobs overlapping

1.2.2(9y ago)3814MITPHPPHP &gt;=7.0.0

Since Feb 14Pushed 9y ago5 watchersCompare

[ Source](https://github.com/DeSmart/laravel-padlock)[ Packagist](https://packagist.org/packages/desmart/laravel-padlock)[ RSS](/packages/desmart-laravel-padlock/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

Padlock Script Locker for Laravel framework
===========================================

[](#padlock-script-locker-for-laravel-framework)

[![Build Status](https://camo.githubusercontent.com/d71e8c63ef40b27a7f7b040e85902c2654ddcae1142fd53263c63342fe12ee99/68747470733a2f2f7472617669732d63692e6f72672f4465536d6172742f6c61726176656c2d7061646c6f636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/DeSmart/laravel-padlock)

This package allows for easily temporarily locking your scripts execution.

It might come in handy in cases such as CRON jobs that connect with unreliable APIS, where you're not 100% sure if your script won't fail at some point.

Requirements
------------

[](#requirements)

This package requires:

- PHP &gt;= 7.0.0
- Laravel 5.3 || 5.4

Installation
------------

[](#installation)

1. `$ composer require desmart/laravel-padlock`
2. Add `DeSmart\Padlock\ServiceProvider` to your `config/app.php`:

```
        /*
         * Package Service Providers...
         */
        DeSmart\Padlock\ServiceProvider::class,

```

3. `$ php artisan vendor:publish --provider="DeSmart\Padlock\ServiceProvider"`
4. Configure in `config/padlock.php` - choose between Database and Filesystem driver

Example usage
-------------

[](#example-usage)

This package's purpose is to protect your script from being run on multiple threads.

It is useful for long-time backend jobs such as handling queries, or harvesting data from external APIs.

```
class FooCommand extends \Illuminate\Console\Command
{
    protected $signature = 'foo:bar';

    protected $description = 'Foo command utilizing Padlock';

    /** @var PadlockHandler */
    private $padlockHandler;

    const PADLOCK_SCRIPT = 'FooCommand';

    /** 30 seconds padlock time to live - after that your padlock will be unlocked */
    const PADLOCK_TTL = 30;

    /**
     * FooCommand constructor.
     * @param \DeSmart\Padlock\PadlockHandler $padlockHandler
     */
    public function __construct(\DeSmart\Padlock\PadlockHandler $padlockHandler)
    {
        parent::__construct();

        $this->padlockHandler = $padlockHandler;
    }

    public function handle()
    {
        if (true === $this->padlockHandler->isLocked(self::PADLOCK_SCRIPT, self::PADLOCK_TTL)) {
            echo "Padlock exists, script locked." . PHP_EOL;

            return;
        }

        $this->padlockHandler->lock(self::PADLOCK_SCRIPT);

        // do your stuff

        $this->padlockHandler->unlock(self::PADLOCK_SCRIPT);
    }
}

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

6

Last Release

3368d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92bc27fc8f1cba837cef419eee0fae358f52c804cd5450cf994f9095fa387a5c?d=identicon)[DeSmart](/maintainers/DeSmart)

---

Top Contributors

[![muberman](https://avatars.githubusercontent.com/u/5789184?v=4)](https://github.com/muberman "muberman (10 commits)")[![radmen](https://avatars.githubusercontent.com/u/1190255?v=4)](https://github.com/radmen "radmen (1 commits)")

---

Tags

laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/desmart-laravel-padlock/health.svg)

```
[![Health](https://phpackages.com/badges/desmart-laravel-padlock/health.svg)](https://phpackages.com/packages/desmart-laravel-padlock)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
