Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Model Hashid Laravel Package

deligoez/laravel-model-hashid

View on GitHub
Deep Wiki
Context7
v4.1.0

Laravel 13 support — a drop-in upgrade from v4.0.x. No code changes required; just run composer update. Laravel 11 and 12 remain fully supported alongside Laravel 13.

Added

  • Laravel 13 supportilluminate/contracts constraint now accepts ^13.0
  • CI pest matrix expanded to cover Laravel 13 on PHP 8.3 and 8.4 across both prefer-lowest and prefer-stable dependency resolutions

Changed

  • orchestra/testbench dev constraint widened to include ^11.0 for Laravel 13 testing
  • Applied Pint 1.29 style rules (fully_qualified_strict_types, phpdoc_line_span, ordered_imports) — pure formatting, no behavioral change

Compatibility

Supported
PHP 8.3, 8.4
Laravel 11, 12, 13

Full Changelog: https://github.com/deligoez/laravel-model-hashid/compare/v4.0.1...v4.1.0

v4.0.1

Fixed

  • DecryptsHashIds trait now makes decoded values available via validated() in addition to input(). Previously, merge() only updated the input bag while validated() returned the original hash strings from the validator snapshot.
v4.0.0

Breaking Changes

  • Require PHP ^8.3 (dropped 8.2)
  • Require Laravel ^11.0|^12.0 (dropped 9, 10)
  • ConfigParameters is now final with a private constructor
  • HashIdDTO is now a readonly class
  • Config::checkIfModelClassExist() renamed to Config::checkIfModelClassExists()
  • HasHashIdRouting::getRouteKey() return type changed from string to mixed

Added

  • HashId utility class — generic encode/decode without a model (HashId::encode(), HashId::decode(), HashId::buildGenerator())
  • Blueprint::hashId() macro — schema sugar for nullable, unique hash id columns in migrations
  • HashIdCast — Eloquent cast for transparent hash id attribute storage
  • SerializesHashId trait — replaces primary key with hash id in toArray() / toJson() output
  • [@hashid](https://github.com/hashid) Blade directive — XSS-safe hash id output in templates
  • DecryptsHashIds trait — auto-decodes hash id inputs to integer keys in FormRequest
  • hashid:encode Artisan command — encode a key to a hash id via CLI
  • hashid:decode Artisan command — decode a hash id to its key via CLI
  • ValidHashId validation rule — format validation with optional model-specific check (no DB hit)
  • HashIdExists validation rule — database existence check for Hash Ids
  • Rector with PHP 8.3 target and Laravel rule sets
  • Architecture tests (Pest Arch)
  • Pest type coverage plugin
  • Unified CI workflow with tiered quality gates

Fixed

  • Type casts in Generator::build() preventing TypeError with string config values
  • Type casts in Generator::parseHashIDForModel() generic path for strict comparison
  • Null guard in Generator::parseHashIDForModel() when prefix_length is -1
  • HasHashIdRouting::resolveRouteBindingQuery() simplified to use static::keyFromHashId() directly
  • HasHashId::getHashIdRawAttribute() removed redundant getKey() call
  • HasHashId::keyFromHashId() returns null when decode yields empty array (#25)
  • FindOrByHashIdMixin callback parameter position corrected

Changed

  • Test framework migrated from PHPUnit to Pest 4
  • ConfigParameters constants are now typed (PHP 8.3 typed constants)
  • ConfigParameters::$parameters static property replaced with ConfigParameters::PARAMETERS const array
  • Larastan upgraded from v2 to v3
  • PHPStan ignoreErrors migrated to identifier-based format

Removed

  • SonarCloud integration
  • Deprecated .php-cs-fixer.php config (replaced by Pint)
  • Separate run-tests.yml, phpstan.yml, pint.yml workflows (unified into ci.yml)

Full Changelog: https://github.com/deligoez/laravel-model-hashid/compare/v3.1.1...v4.0.0

3.1.1

Bug Fix

  • fix(HasHashId): Return null instead of throwing Undefined array key 0 when keyFromHashId() receives a hash ID that decodes to an empty array (#25)

Thanks to @Falkan3 for reporting and @ramonmalcolm10 for the initial fix in #23.

v3.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/deligoez/laravel-model-hashid/compare/2.4.1...v3.0.0

2.4.1
2.4.0

What's Changed

  • Fix if prefix and separator are both empty by @terranc in #18
  • Feat: resolve route binding query using resolveRouteBindingQuery() by @bensherred in #16
  • Test: Return null if the hash ID prefix does not match the model prefix @bensherred in #17

New Contributors

Full Changelog: https://github.com/deligoez/laravel-model-hashid/compare/2.3.0...2.4.0

2.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/deligoez/laravel-model-hashid/compare/2.1.0...2.2.0

2.0.0
  • Add PHP 8.1 support
  • Add Laravel 9 support
  • Drop Laravel 8 support (Continue to use v1 if you're on Laravel 8)
1.0.2
  • Fixes, Type Hints
1.0.1
  • Fix config parameter for model generators
1.0.0
  • Initial release 🎉
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium