axn/tool-kit-for-laravel
Tool Kit for Laravel
Includes a set of useful tools for the Laravel framework.
Documentation
- Helpers - Global helper functions
- Blade Directives - @nltobr, @nltobrcompact, @nltop, @nltopflat
- Components - Required field marker
- Enums - AppEnv, BytesConvention, Civilities
Installation
With Composer:
composer require axn/tool-kit-for-laravel
To use some of these tools you must have correctly installed the package forxer/generic-term-translations-for-laravel already prerequisite by this package (therefore present).
Use the locales publisher of Laravel Lang to add/update/reset or remove translations:
- If you have never used Laravel Lang: add locales
- If you are already using Laravel Lang: just update the locales
Quick Reference
Helpers
| Helper | Description |
|---|---|
app_env_enum() |
Get standardized environment enum |
app_env_name() |
Get standardized environment name |
carbon() |
Create Carbon instance from various formats |
collect_models() |
Create Eloquent collection |
str_html() |
Create HtmlString instance |
linebreaks() |
Normalize line endings to UNIX format |
nl_to_br() |
Alias of nl2br() |
nl_to_br_compact() |
Convert consecutive newlines to single <br> |
nl_to_p() |
Convert newlines to paragraphs |
nl_to_p_flat() |
Convert text to single paragraph with <br> |
number_formatted() |
Format number with locale |
compute_dec_to_time() |
Decimal to time array |
convert_dec_to_time() |
Decimal to time string |
human_readable_bytes_size() |
Format bytes to human readable (legacy default, accepts BytesConvention) |
human_readable_bytes_size_si() |
Format bytes using SI convention (1000-based, kB/MB/GB/TB) |
human_readable_bytes_size_iec() |
Format bytes using IEC convention (1024-based, KiB/MiB/GiB/TiB) |
mime_type_to_fa5_class() |
MIME type to FontAwesome 5 icon |
mime_type_to_fa6_class() |
MIME type to FontAwesome 6 icon |
mime_type_to_fa7_class() |
MIME type to FontAwesome 7 icon |
trans_lcfirst() |
Translate with first char lowercase |
trans_ucfirst() |
Translate with first char uppercase |
is_valid_model() |
Check if class is valid Eloquent model |
semver_to_id() |
Convert semver to numeric ID |
Blade Directives
| Directive | Description |
|---|---|
@nltobr() |
Convert newlines to <br> |
@nltobrcompact() |
Convert consecutive newlines to single <br> |
@nltop() |
Convert newlines to paragraphs |
@nltopflat() |
Convert to single paragraph with <br> |
Components
| Component | Description |
|---|---|
<x-required-field-marker /> |
Display required field indicator |
Enums
| Enum | Description |
|---|---|
AppEnv |
Standardized environment names |
BytesConvention |
Byte size conventions (SI / IEC) |
Civilities |
Form civilities (Mrs, Mr) |
Requirements
- PHP 8.4+
- Laravel 12.x or 13.x
License
MIT
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 11.8.0 | ^8.4 | ^12.0 || | MIT | |
| 11.7.1 | ^8.4 | ^12.0 || | MIT | |
| 11.7.0 | ^8.4 | ^12.0 || | MIT | |
| 11.6.0 | ^8.4 | ^12.0 || | MIT | |
| 11.5.2 | ^8.4 | ^12.0 || | MIT | |
| 11.5.1 | ^8.4 | ^12.0 || | MIT | |
| 11.5.0 | ^8.4 | ^12.0 || | MIT | |
| 11.4.0 | ^8.4 | ^12.0 | MIT | |
| 11.3.1 | ^8.4 | ^12.0 | MIT | |
| 11.3.0 | ^8.4 | ^12.0 | MIT | |
| 11.2.1 | ^8.4 | ^12.0 | MIT | |
| 11.2.0 | ^8.4 | ^12.0 | MIT | |
| 11.1.0 | ^8.4 | ^12.0 | MIT | |
| 11.0.0 | ^8.4 | ^12.0 | MIT | |
| 10.3.2 | ^8.2 | ^10.0 || | MIT | |
| 10.3.1 | ^8.2 | ^10.0 || | MIT | |
| 10.3.0 | ^8.2 | ^10.0 || | MIT | |
| 10.2.0 | ^8.2 | ^10.0 || | MIT | |
| 10.1.0 | ^8.2 | ^10.0 || | MIT | |
| 10.0.3 | ^8.2 | ^10.0 || | MIT | |
| 10.0.2 | ^8.2 | ^10.0 || | MIT | |
| 10.0.1 | ^8.2 | ^10.0 || | MIT | |
| 10.0.0 | ^8.2 | ^10.0 || | MIT | |
| 9.1.0 | ^8.0 | ^8.0 || | MIT | |
| 9.0.4 | ^8.0 | ^8.0 || | MIT | |
| 9.0.3 | ^8.0 | ^8.0 || | MIT | |
| 9.0.2 | ^8.0 | ^8.0 || | MIT | |
| 9.0.1 | ^8.0 | ^8.0 || | MIT | |
| 9.0.0 | ^8.0 | ^8.0 || | MIT | |
| 8.1.0 | ^8.0 | ^8.0 || | MIT |
Showing the latest 30 of 89. See every release on Packagist