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.
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
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai