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 Url Laravel Package

atldays/laravel-url

View on GitHub
Deep Wiki
Context7
v1.0.0

Laravel URL v1.0.0

First public release of atldays/laravel-url.

Laravel URL is a Laravel-friendly package for working with URLs through typed value objects, sanitizer pipelines, validation rules, request macros, and optional spatie/laravel-data integration.

Built on top of spatie/url, this release provides a clean foundation for handling regular web URLs, browser-specific URLs, and messy real-world input inside Laravel applications.

Highlights

  • Atldays\Url\Url value object built on top of spatie/url
  • browser-specific scheme support: chrome-extension, moz-extension, chrome, opera, edge
  • UrlFactory and Url facade for creating URLs consistently
  • configurable sanitizer profiles for different input sources
  • built-in sanitizers for:
    • header value cleanup
    • control character cleanup
    • UTF-8 normalization
  • Laravel validation rules:
    • Atldays\Url\Rules\Url
    • Atldays\Url\Rules\BrowserUrl
  • request macros:
    • getUrlFromHeader
    • getOriginUrl
    • getRefererUrl
    • getFullUrl
  • optional spatie/laravel-data integration:
    • UrlCast
    • ToUrlCast
    • UrlTransformer
  • package translations for validation messages
  • Laravel config publishing and translations publishing support

Included In This Release

Core URL layer

  • custom URL class with browser scheme support
  • IP-host detection
  • base URL extraction with port support
  • package contracts for typed integrations

Sanitization pipeline

  • configurable profile-based sanitizer registry
  • default profile for general input
  • header profile for Origin and Referer-style values
  • clean separation between URL creation and input preprocessing

Laravel integration

  • service provider with package registration
  • facade alias for short usage
  • request macros for typed URL extraction
  • translation namespace support

Validation

  • standard URL validation rule
  • browser URL validation rule
  • nullable-friendly Laravel behavior

Data objects

  • casts for strict URL casting and URL coercion
  • transformer for serializing URL objects back to strings

Developer experience

  • PHPUnit test suite
  • Laravel Pint formatting
  • publishable config
  • publishable translations
  • production-ready README and contribution guide

Installation

composer require atldays/laravel-url

Optional:

composer require spatie/laravel-data

Publishing

Publish config:

php artisan vendor:publish --tag="url-config"

Publish translations:

php artisan vendor:publish --tag="url-translations"

Notes

  • supported PHP version: ^8.2
  • supported Laravel versions: ^11.0|^12.0|^13.0
  • package name: atldays/laravel-url

Thanks

Special thanks to Spatie URL for providing the parsing foundation that this package builds on.

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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle