Download the PHP package patrikjak/utils without Composer
On this page you can find all versions of the php package patrikjak/utils. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package utils
Utils Package
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
- Installation
- Setup
- Usage
- CSS
- JavaScript
- Auto-initialization
- Programmatic API
-
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.
Installation
Install the package via Composer:
Setup
After installing the package, add the package provider to the providers array in bootstrap/providers.php.
Next, publish the pre-built assets:
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:
Usage
The Utils package offers a variety of useful classes and functions.
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:
JavaScript
The package ships a pre-built ES module bundle. Include it as a <script> tag before your own scripts:
type="module" is required. The bundle auto-initializes all components and exposes a window.pjutils global.
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
| Symbol | Type | Description |
|---|---|---|
Form |
class | AJAX form submission with validation error handling |
Modal |
class | Programmatic modal creation and control |
notify |
function | Show notification messages |
getData |
function | Read HTML data attributes from elements |
doAction |
function | Bind custom row actions on a table |
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:
Make sure resources/js is included in your tsconfig.json:
To load the correct language for JS components, set the lang attribute on the <html> tag:
Currently supported languages: en, sk.
Your vite.config.js must target esnext:
All versions of utils with dependencies
blade-ui-kit/blade-heroicons Version ^1.0
blade-ui-kit/blade-icons Version ^1.0
laravel/framework Version ^12.1.1