Download the PHP package jobmetric/laravel-unit without Composer
On this page you can find all versions of the php package jobmetric/laravel-unit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jobmetric/laravel-unit
More information about jobmetric/laravel-unit
Files in jobmetric/laravel-unit
Package laravel-unit
Short Description This is a unit management package for Laravel that you can use in your projects.
License MIT
Homepage https://doc.jobmetric.net/package/laravel-unit-converter
Informations about the package laravel-unit
Laravel Unit Converter
Unit Management for Laravel. Flexible. Precise.
Laravel Unit Converter helps you manage and convert measurement units in a clean, consistent way—from Weight and Length to Currency, Volume, Temperature, and 30+ other unit types. It is designed to be used as a reusable package in real-world Laravel applications where unit conversion needs to be normalized and shared across multiple models.
Why Laravel Unit Converter?
Comprehensive Unit Type Support
Support for 30+ unit types out of the box:
- Physical Units: Weight, Length, Volume, Area, Temperature, Pressure, Speed, Force, Energy, Power, and more
- Digital Units: Data Storage, Data Transfer
- Scientific Units: Electric Current, Voltage, Resistance, Capacitance, Inductance, Magnetic Flux, Radiation
- Everyday Units: Currency, Time, Cooking measurements, Fuel Consumption
Flexible Base Unit System
Each unit type has a base unit (value = 1) that serves as the conversion reference. All other units in the same type are defined relative to this base, making conversions accurate and consistent.
Service-first API + Facade
The UnitConverter service provides a complete API for:
- Creating and managing units
- Converting values between units
- Changing base units dynamically
- Tracking unit usage across your application
Quick Start
Install via Composer:
Run migrations:
Optionally publish config/translations (if you need to override defaults):
Usage (Examples)
Store a unit using the Facade:
Convert between units:
Attach units to your models using traits:
Assign units to a model:
Available Artisan Commands
Documentation
Documentation for Laravel Unit Converter is available here:
The documentation includes:
- Getting Started - Installation and configuration
- Traits -
HasUnitfor attaching units to models - Services & Facades - Complete API reference for UnitConverter
- Unit Types - All 30+ supported unit types
- Requests & Resources - Validation and API responses
- Events - Hook into lifecycle events (
UnitStoreEvent,UnitUpdateEvent,UnitDeleteEvent) - Helper Functions -
unitConvert()and more - Testing - How to run package tests and expected patterns
Contributing
Thank you for participating in laravel-unit-converter. A contribution guide can be found here.
License
The laravel-unit-converter is open-sourced software licensed under the MIT license. See License File for more information.
All versions of laravel-unit with dependencies
laravel/framework Version >=9.19
jobmetric/laravel-package-core Version ^1.37
jobmetric/laravel-translation Version ^3.8
jobmetric/laravel-event-system Version ^2.8