axn / laravel-extension
Includes a set of useful tools for the Laravel framework.
Installs: 2 853
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/axn/laravel-extension
Requires
- php: ^8.4
- composer/semver: ^3.0.0
- forxer/generic-term-translations-for-laravel: ^1.8
- laravel/framework: ^12.0
Requires (Dev)
- driftingly/rector-laravel: ^2.1.8
- laravel/pint: ^1.26.0
- rector/rector: ^2.2.14
- dev-master
- 11.3.0
- 11.2.1
- 11.2.0
- 11.1.0
- 11.0.0
- 10.x-dev
- 10.3.2
- 10.3.1
- 10.3.0
- 10.2.0
- 10.1.0
- 10.0.3
- 10.0.2
- 10.0.1
- 10.0.0
- 9.x-dev
- 9.1.0
- 9.0.4
- 9.0.3
- 9.0.2
- 9.0.1
- 9.0.0
- 8.x-dev
- 8.1.0
- 8.0.0
- 7.7.2
- 7.7.1
- 7.7.0
- 7.6.0
- 7.5.2
- 7.5.1
- 7.5.0
- 7.4.0
- 7.3.0
- 7.2.0
- 7.1.1
- 7.1.0
- 7.0.1
- 7.0.0
- 6.9.0
- 6.8.0
- 6.7.0
- 6.6.0
- 6.5.0
- 6.4.0
- 6.3.0
- 6.2.0
- 6.1.0
- 6.0.1
- 6.0.0
- v5.x-dev
- 5.4.2
- 5.4.1
- 5.4.0
- 5.3.0
- 5.2.0
- 5.1.1
- 5.1.0
- 5.0
- v4.x-dev
- 4.2.0
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 3.2.0
- 3.1.0
- 3.0.1
- 3.0.0
- 2.2.1
- 2.2.0
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- dev-develop
This package is auto-updated.
Last update: 2025-12-20 11:45:12 UTC
README
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, 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 |
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_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 |
Civilities |
Form civilities (Mrs, Mr) |
Requirements
- PHP 8.4+
- Laravel 12.x
License
MIT