1. Go to this page and download the library: Download zidbih/laravel-deadlock library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zidbih / laravel-deadlock example snippets
use Zidbih\Deadlock\Attributes\Workaround;
#[Workaround(
description: 'Temporary bypass for legacy payment gateway',
expires: '2025-03-01'
)]
class PaymentService
{
// ...
}
namespace App\Http\Controllers;
use Zidbih\Deadlock\Attributes\Workaround;
#[Workaround(description: 'Legacy controller awaiting refactor', expires: '2025-06-01')]
final class UserController extends Controller
{
#[Workaround(description: 'Temporary validation bypass', expires: '2025-02-01')]
public function store()
{
// ...
}
}
namespace App\Services;
use Zidbih\Deadlock\Attributes\Workaround;
use Zidbih\Deadlock\Support\DeadlockGuard;
#[Workaround(description: 'Temporary legacy pricing service', expires: '2025-01-01')]
final class PricingService
{
public function __construct()
{
DeadlockGuard::check($this);
}
}
namespace App\Services;
use Zidbih\Deadlock\Attributes\Workaround;
use Zidbih\Deadlock\Support\DeadlockGuard;
final class PricingService
{
#[Workaround(description: 'Temporary calculation logic', expires: '2025-02-01')]
public function calculate()
{
DeadlockGuard::check($this, __FUNCTION__);
return 42;
}
}