PHPackages                             patrikjak/utils - 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. patrikjak/utils

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

patrikjak/utils
===============

A simple utility package for Laravel

v2.14.2(2mo ago)01.1k[1 PRs](https://github.com/patrikjak/utils/pulls)2MITPHPPHP ^8.4CI passing

Since Oct 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/patrikjak/utils)[ Packagist](https://packagist.org/packages/patrikjak/utils)[ RSS](/packages/patrikjak-utils/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (24)Versions (51)Used By (2)

Utils Package
=============

[](#utils-package)

[![codecov](https://camo.githubusercontent.com/3daf66c9e86bd6de29618cccaa4fc5ae06a9faf7c6db30ede40fafa8751d258b/68747470733a2f2f636f6465636f762e696f2f67682f70617472696b6a616b2f7574696c732f67726170682f62616467652e7376673f746f6b656e3d4e4f4c3059314e423253)](https://codecov.io/gh/patrikjak/utils)

The **Utils** package is a versatile utility toolkit designed to enhance Laravel applications. It provides a variety of reusable classes and functions to streamline development, including CSS and JavaScript assets to support frontend components like buttons, modals, and tables. Easily integrate the package into your project, publish assets, and selectively include only the styles and functions you need for a highly customizable setup. Perfect for Laravel developers seeking to simplify their workflow with ready-to-use utilities.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Setup](#setup)
- [Usage](#usage)
    - [CSS](#css)
    - [JavaScript](#javascript)
        - [Auto-initialization](#auto-initialization)
        - [Programmatic API](#programmatic-api)
        - [TypeScript](#typescript)

---

What's included:

- **CSS** - A collection of reusable styles for buttons, modals, tables, and more.
- **JavaScript** - A variety of functions to enhance user experience and streamline development.
- **Forms** - A set of form components to simplify form creation.
- **Tables** - A collection of table components to enhance data presentation.
- **Modals** - A set of modal components to display content in a modal window.
- **Notifications** - A collection of notification components to display messages to users.

### You can find the full documentation [here](https://utils.patrikjakab.sk).

[](#you-can-find-the-full-documentation-here)

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

[](#installation)

Install the package via Composer:

```
composer require patrikjak/utils
```

Setup
-----

[](#setup)

After installing the package, add the package provider to the providers array in bootstrap/providers.php.

```
use Patrikjak\Utils\UtilsServiceProvider;

return [
    ...
    UtilsServiceProvider::class,
];
```

Next, publish the pre-built assets:

```
php artisan vendor:publish --tag="pjutils-assets" --force
```

This copies the compiled CSS and JS files to `public/vendor/pjutils/`. Re-run it with `--force` after every package update.

If you want to customize the SCSS or TypeScript source files, publish them separately:

```
php artisan vendor:publish --tag="pjutils-sources"
```

Usage
-----

[](#usage)

The Utils package offers a variety of useful classes and functions.

### CSS

[](#css)

To include all component styles, add the main.css file:

```

```

You need to set border-box box-sizing for all elements in your CSS file to prevent layout issues:

```
* {
    box-sizing: border-box;
}
```

### JavaScript

[](#javascript)

The package ships a pre-built ES module bundle. Include it as a `` tag **before** your own scripts:

```

```

`type="module"` is required. The bundle auto-initializes all components and exposes a `window.pjutils` global.

#### Auto-initialization

[](#auto-initialization)

These components initialize automatically on page load — no manual calls needed: password visibility switch, table functions (pagination, sorting, filtering, search), dropdowns, file uploaders, accordions, tabs, clipboard, number inputs, comboboxes, tag inputs, repeaters.

#### Programmatic API

[](#programmatic-api)

SymbolTypeDescription`Form`classAJAX form submission with validation error handling`Modal`classProgrammatic modal creation and control`notify`functionShow notification messages`getData`functionRead HTML data attributes from elements`doAction`functionBind custom row actions on a table```
window.pjutils.notify('Saved', 'Success', 'success');

new window.pjutils.Form().bindSubmit();

const modal = new window.pjutils.Modal();
modal.setTitle('Hello').setBody('Content').open();
```

#### TypeScript

[](#typescript)

Add a declaration file at `resources/js/pjutils.d.ts` for full type safety — the `import type` imports are erased at build time, nothing from the vendor directory gets bundled:

```
import type Form from '../../vendor/patrikjak/utils/resources/assets/js/form/Form';
import type notify from '../../vendor/patrikjak/utils/resources/assets/js/utils/notification';
import type Modal from '../../vendor/patrikjak/utils/resources/assets/js/utils/Modal';
import type {getData} from '../../vendor/patrikjak/utils/resources/assets/js/helpers/general';
import type {doAction} from '../../vendor/patrikjak/utils/resources/assets/js/table/actions';

export {};

declare global {
    interface Window {
        pjutils: {
            Form: typeof Form;
            notify: typeof notify;
            Modal: typeof Modal;
            getData: typeof getData;
            doAction: typeof doAction;
        };
    }
}
```

Make sure `resources/js` is included in your `tsconfig.json`:

```
{
    "compilerOptions": {
        "target": "ESNext",
        "module": "ESNext",
        "moduleResolution": "bundler",
        "strict": true,
        "noEmit": true,
        "skipLibCheck": true
    },
    "include": [
        "resources/js/**/*"
    ]
}
```

To load the correct language for JS components, set the `lang` attribute on the `` tag:

```

```

Currently supported languages: `en`, `sk`.

Your `vite.config.js` must target **esnext**:

```
export default defineConfig({
    ...
    build: {
        target: 'esnext',
    },
});
```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~12 days

Total

45

Last Release

49d ago

Major Versions

0.3.1 → 1.0.02024-12-01

1.5.0 → 2.0.02025-02-25

v2.14.2 → v3.x-dev2026-05-14

PHP version history (2 changes)0.2.0PHP ^8.3

2.2.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49360467?v=4)[Patrik Jakab](/maintainers/patrikjak)[@patrikjak](https://github.com/patrikjak)

---

Top Contributors

[![patrikjak](https://avatars.githubusercontent.com/u/49360467?v=4)](https://github.com/patrikjak "patrikjak (50 commits)")

---

Tags

packagelaravelutilityutilstables

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/patrikjak-utils/health.svg)

```
[![Health](https://phpackages.com/badges/patrikjak-utils/health.svg)](https://phpackages.com/packages/patrikjak-utils)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[code16/sharp

Laravel Content Management Framework

79164.7k8](/packages/code16-sharp)[firefly-iii/data-importer

Firefly III Data Import Tool.

8035.8k](/packages/firefly-iii-data-importer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[rapidez/core

Rapidez Core

1823.5k72](/packages/rapidez-core)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2085.6k31](/packages/ronasit-laravel-helpers)

PHPackages © 2026

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