Download the PHP package tanthammar/laravel-extras without Composer
On this page you can find all versions of the php package tanthammar/laravel-extras. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tanthammar/laravel-extras
More information about tanthammar/laravel-extras
Files in tanthammar/laravel-extras
Package laravel-extras
Short Description Custom validation rules for the Laravel Framework
License MIT
Homepage https://github.com/tanthammar/laravel-extras
Informations about the package laravel-extras
Helpers and Macros for Laravel
Requirements
- PHP 8.3+
- Laravel v11.0+
- MySQL or PostgreSQL database (for builder macros using raw SQL)
Installation
Migration Setup
This package publishes a migration file for the ocr_numbers
table, used to ensure cross-table uniqueness of OCR numbers.
Query Builder Macros
Search and Filter Macros
whereStartsWith / orWhereStartsWith
Case-insensitive prefix matching:
whereEndsWith / orWhereEndsWith
Case-insensitive suffix matching:
whereAllLike
Search multiple columns where ALL must match:
orWhereAnyLike
Search multiple columns where ANY can match:
whereContains / orWhereContains
Space-separated word searching:
whereRelationsLike
Search across model relationships:
Translatable Content Macros
whereTranslatableStartsWith / orWhereTranslatableStartsWith
Search JSON translation columns:
whereTranslatableLike / orWhereTranslatableLike
whereTranslatableContains / orWhereTranslatableContains
Utility Macros
whereOverlaps
Find overlapping date ranges:
existsById / existsByUuid
Quick existence checks:
orderByTranslation / orderByLocale
Locale-aware sorting:
Helper Classes
String and Text Processing
CleanNumber
Remove all non-numeric characters:
NoWhiteSpace
Remove all whitespace characters:
MarkdownToHtmlString
Convert Markdown to HTML:
Data Manipulation
Array Helper
Money Integer Cast
Store monetary values as integers:
Specialized Utilities
OCR3 (Swedish Bank References)
Generate OCR numbers with Luhn algorithm:
SKU Generator
Generate product SKUs:
Debug Utilities
PrettyPrint
Formatted debugging output:
Breaking Changes from Previous Versions
Query Macro Renames (v4.0+)
whereLike()
→whereAllLike()
orWhereLike()
→orWhereAnyLike()
Version Requirements (v4.0+)
- Minimum PHP version: 8.3+ (was 8.1+)
- Minimum Laravel version: 11.0+ (was 9.0+)
Implementation Changes (v4.0+)
- All query macros now use Laravel's native
whereLike()
method withcaseSensitive: false
- Removed custom database operator detection in favor of Laravel's built-in handling
- Improved query logic for proper OR condition chaining
All versions of laravel-extras with dependencies
laravel/framework Version ^11.0|^12.0
spatie/laravel-package-tools Version ^1.9.2