Weave 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

Orm Slug Field Laravel Package

mindy/orm-slug-field

A Laravel/PHP ORM field package that adds automatic URL-friendly slug generation and management to your models, with configurable source fields and uniqueness handling for clean, SEO-friendly routes.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What this actually is. mindy/orm-slug-field is a custom field-type extension for the MindyPHP ORM. It registers a slug field that derives a URL-safe value (typically from a title/name column) at the persistence layer, so models get slugs without callers writing slugify logic. It is not a Laravel package and carries no Illuminate dependencies, service providers, or extra.laravel auto-discovery metadata. It is a Mindy framework extension first and a PHP package second.

Architecture fit. Fit is binary. If the target system runs MindyPHP's ORM, the package slots in as a field type and the integration is a few lines of model configuration. If the target is Laravel — or any stack using Eloquent, Doctrine, or a standalone data mapper — there is no integration path short of porting the field logic onto the host ORM's mutators/casts. The concept (derive a slug on write, enforce uniqueness) is trivially portable; the package itself is not.

Integration feasibility. Low effort on Mindy, non-viable on Laravel. The package's total logic surface is small (slugification, collision suffixing, likely an update-on-change trigger). A TPM should treat this as a reference implementation, not a dependency. Budget half a day to read the source and re-implement the behaviour as an Eloquent trait or model observer rather than attempting to shim a foreign ORM's field system.

Technical risk. High on dependency risk, low on technical complexity:

  • 1 star, 0 dependents, effectively no external validation of correctness or edge cases.
  • Single-maintainer, no issue traffic → assume unmaintained; no expectation of fixes for new PHP versions.
  • Unknown behaviour for (a) Unicode/CJK titles, (b) duplicate-slug race conditions under concurrency, (c) slug regeneration on title edit (stable URLs vs. SEO churn), (d) maximum length and truncation, (e) reserved-word handling.
  • No test suite evidence in the signal; correctness of collision handling cannot be assumed.

Key questions for the maintainer/owner.

  1. Which Mindy ORM version does the field API target, and is the extension point still present upstream?
  2. What is the collision strategy — numeric suffix, hash, or silent overwrite?
  3. Does the slug regenerate on update, and is there an opt-out to keep URLs stable?
  4. How are non-ASCII characters transliterated, and what happens when transliteration yields an empty string?
  5. Is there a uniqueness index assumption baked in, or must the schema enforce it?
  6. Are there tests, and what PHP versions are exercised in CI?

Integration Approach

Stack fit. Misaligned with the stated "Laravel/PHP" framing. The package is Mindy-specific; the only realistic Laravel consumption model is pattern borrowing. For a Laravel codebase, the equivalent mature dependencies are spatie/laravel-sluggable (attribute-based, actively maintained) or cviebrock/eloquent-sluggable. Recommending either over this package is the correct product call.

Migration path (if a Mindy codebase is in scope).

  1. Vendor the package into packages/ rather than pulling from Packagist; pin to an explicit commit SHA.
  2. Register the field type in the ORM bootstrap and apply to one low-traffic model.
  3. Backfill existing rows: generate slugs offline, resolve collisions deterministically, then add the unique index after the backfill to avoid write failures.
  4. Add a compatibility shim only if the upstream field API drifts.

Migration path (Laravel — the likely case). Do not migrate the package. Re-implement:

  1. Add a HasSlug trait with slugSource, slugColumn, and slugSeparator properties.
  2. Hook saving to generate only when the slug is empty or the source changed (configurable).
  3. Implement collision suffixing as an indexed lookup loop, and rely on a DB unique constraint as the true guard.
  4. Cover with tests for Unicode, duplicates, empty source, and long titles.

Compatibility and sequencing. Confirm PHP version floor against the runtime first — a package of this vintage may not declare PHP 8.2/8.3 support and will emit deprecations. Sequence: (1) spike on a branch, (2) verify schema/index assumptions, (3) backfill in a transaction with a dry-run count, (4) deploy read-only, (5) enable writes. Do not couple this to a larger release; it is independent and reversible.

Operational Impact

Maintenance. Near-zero ongoing cost if vendored, because the code is small and self-contained — but also zero upstream fixes. Treat vendored code as owned code: assign an owner, add it to the internal fork inventory, and note the abandonment risk explicitly. Expect a PHP-version bump to require a manual patch.

Support. No community, no Stack Overflow corpus, no issue history to mine. Any incident is debugged from source by your own team. Do not let this land in a system with a support SLA that assumes vendor responsiveness.

Scaling. Slug generation is a per-write CPU cost and is negligible. The real scaling concern is the uniqueness check: a naive SELECT ... WHERE slug = ? before insert is a read-then-write race under concurrent creates. Enforce with a unique index plus bounded retry on constraint violation, not with an application-level pre-check. Also watch slug column width — long titles truncated naively can produce collisions and index bloat.

Failure modes.

  • Silent duplicate slugs if no unique index exists → broken routing, ambiguous lookups.
  • Empty slug on non-Latin titles → NULL/empty URLs and 404s.
  • Slug churn on title edits → dead inbound links, SEO regression, cached-URL 404s.
  • Deprecation warnings or fatal errors on PHP upgrade → write-path outage for affected models.
  • Backfill collisions discovered mid-migration → partial unique index failure.

Ramp-up. Minimal for a PHP developer: the concept is well understood and the source is short. The onboarding cost is not learning the package, it is discovering the implicit assumptions (collision policy, update semantics, transliteration) that were never documented. Surface those in a short internal README before the first dependent team touches it.

Bottom line. Score and adoption signals (1 star, 0 dependents) plus framework mismatch argue against adopting this as a dependency. The defensible use is as a design reference for a 100-line in-house slug trait on the host ORM, with a unique index and explicit collision policy. Opportunity is real — slug handling is a recurring need — but it is not captured by this artifact.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings