PHPackages                             seisigmasrl/momentum-lock - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. seisigmasrl/momentum-lock

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

seisigmasrl/momentum-lock
=========================

A Laravel package that lets you handle Laravel authorizations on the frontend level.

1.0.0(5mo ago)03.2k↑276.2%MITPHPPHP ^8.1

Since Jan 15Pushed 5mo agoCompare

[ Source](https://github.com/seisigmasrl/momentum-lock)[ Packagist](https://packagist.org/packages/seisigmasrl/momentum-lock)[ GitHub Sponsors](https://github.com/lepikhinb)[ RSS](/packages/seisigmasrl-momentum-lock/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Momentum Lock (Folked from lepekhinb/momentum-lock - Not updated and maybe abandoned)
=====================================================================================

[](#momentum-lock-folked-from-lepekhinbmomentum-lock---not-updated-and-maybe-abandoned)

Momentum Lock is a Laravel package that lets you handle Laravel authorizations on the frontend level.

The package is only intended to work with [Laravel Data](https://github.com/spatie/laravel-data) objects and [TypeScript Transformer](https://github.com/spatie/laravel-typescript-transformer).

- [**Installation**](#installation)
    - [**Laravel**](#laravel)
    - [**Frontend**](#frontend)
- [**Usage**](#usage)
- [**Advanced Inertia**](#advanced-inertia)
- [**Momentum**](#momentum)

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

[](#installation)

### Laravel

[](#laravel)

Install the package into your Laravel app.

```
composer require seisigmasrl/momentum-lock
```

### Frontend

[](#frontend)

The frontend package is framework-agnostic and will work great within any TypeScript-powered workflow.

Install the [frontend package](https://github.com/lepikhinb/momentum-lock-helper).

```
npm i momentum-lock
# or
yarn add momentum-lock
```

Usage
-----

[](#usage)

Extend your data classes from `DataResource` instead of `Data` provided by [Laravel Data](https://github.com/spatie/laravel-data).

```
use Momentum\Lock\Data\DataResource;

class UserData extends DataResource
{
    public function __construct(
        public int $id,
        public string $username
    ) {
    }
}
```

You can either specify the list of abilities manually, or let the package resolve them from the corresponding policy class.

```
class UserData extends DataResource
{
    protected $permissions = ['update', 'delete'];
}
```

Register `DataResourceCollector` in the TypeScript Transformer configuration file — `typescript-transformer.php`. This class helps TypeScript Transformer handle `DataResource` classes and append permissions to generated TypeScript definitions.

```
return [
    'collectors' => [
+       Momentum\Lock\TypeScript\DataResourceCollector::class,
        Spatie\TypeScriptTransformer\Collectors\DefaultCollector::class,
        Spatie\LaravelData\Support\TypeScriptTransformer\DataTypeScriptCollector::class,
    ],
]
```

On the frontend, you can use the helper `can`. This function checks whether the required permission is set to true on the passed object, and can be used in both scripts or templates.

```

import { can } from "momentum-lock"

const props = defineProps()

     Edit

```

Advanced Inertia
----------------

[](#advanced-inertia)

[![](https://camo.githubusercontent.com/6d303aa5ddd234c4e468400424ebf0c4267e6c5dba44e51f96dec88dc6e8b29f/68747470733a2f2f616476616e6365642d696e65727469612e636f6d2f6f672e706e67)](https://advanced-inertia.com)

Take your Inertia.js skills to the next level with my book [Advanced Inertia](https://advanced-inertia.com/). Learn advanced concepts and make apps with Laravel and Inertia.js a breeze to build and maintain.

Momentum
--------

[](#momentum)

Momentum is a set of packages designed to improve your experience building Inertia-powered apps.

- [Modal](https://github.com/lepikhinb/momentum-modal) — Build dynamic modal dialogs for Inertia apps
- [Preflight](https://github.com/lepikhinb/momentum-preflight) — Realtime backend-driven validation for Inertia apps
- [Paginator](https://github.com/lepikhinb/momentum-paginator) — Headless wrapper around Laravel Pagination
- [Trail](https://github.com/lepikhinb/momentum-trail) — Frontend package to use Laravel routes with Inertia
- [Lock](https://github.com/lepikhinb/momentum-lock) — Frontend package to use Laravel permissions with Inertia
- [Layout](https://github.com/lepikhinb/momentum-layout) — Persistent layouts for Vue 3 apps
- [Vite Plugin Watch](https://github.com/lepikhinb/vite-plugin-watch) — Vite plugin to run shell commands on file changes

Credits
-------

[](#credits)

- [Boris Lepikhin](https://twitter.com/lepikhinb)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance70

Regular maintenance activity

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.2% 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

Unknown

Total

1

Last Release

169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dbf2b5563c4ce6ead1b041f6d25526054fd443dddba5d161b72d01708ddc611?d=identicon)[seisigma](/maintainers/seisigma)

---

Top Contributors

[![lepikhinb](https://avatars.githubusercontent.com/u/17538801?v=4)](https://github.com/lepikhinb "lepikhinb (13 commits)")[![ricardov03](https://avatars.githubusercontent.com/u/2243870?v=4)](https://github.com/ricardov03 "ricardov03 (2 commits)")[![raymondmuller](https://avatars.githubusercontent.com/u/3808818?v=4)](https://github.com/raymondmuller "raymondmuller (1 commits)")[![ycs77](https://avatars.githubusercontent.com/u/38133356?v=4)](https://github.com/ycs77 "ycs77 (1 commits)")[![Yiddishe-Kop](https://avatars.githubusercontent.com/u/36875437?v=4)](https://github.com/Yiddishe-Kop "Yiddishe-Kop (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/seisigmasrl-momentum-lock/health.svg)

```
[![Health](https://phpackages.com/badges/seisigmasrl-momentum-lock/health.svg)](https://phpackages.com/packages/seisigmasrl-momentum-lock)
```

###  Alternatives

[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84611.1M63](/packages/php-open-source-saver-jwt-auth)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6804.7k6](/packages/hasinhayder-tyro)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2014.5k](/packages/alajusticia-laravel-logins)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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