Download the PHP package atldays/laravel-url without Composer

On this page you can find all versions of the php package atldays/laravel-url. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-url

Laravel URL

Latest Version on Packagist Total Downloads CI

atldays/laravel-url is a Laravel package for working with URLs in a more predictable, framework-friendly way.

At its core, the package builds on top of spatie/url, adds Laravel integration, supports browser-specific schemes, provides sanitizer pipelines for unsafe input, ships validation rules, request macros, and optional integration with spatie/laravel-data.

Why This Package Exists

Working with URLs in real applications is usually messier than simply parsing a clean string.

Inputs may come from:

This package gives you a single Laravel-oriented layer for those cases while still relying on the excellent parsing foundation provided by spatie/url.

Features

Requirements

Installation

Install the package:

If you want to customize sanitizer profiles, publish the config:

If you want to use spatie/laravel-data integration, install it separately:

Quick Start

Use the facade

Use the factory directly

The URL Value Object

The package provides Atldays\Url\Url, which extends Spatie's URL object and adds Laravel-oriented behavior.

Browser-specific schemes

Detect IP hosts

Get the base URL

Factory And Sanitizer Profiles

The recommended entry point for application code is UrlFactory or the Url facade.

Before the URL object is created, the factory runs the input through a configurable sanitizer pipeline.

Default behavior

When you do not pass a profile explicitly, the factory uses the configured default profile:

Explicit profile

Available profiles

The package currently ships with two profiles:

Built-in sanitizers

Configuration

You can add your own sanitizer classes as long as they implement:

Validation Rules

The package includes Laravel validation rules for both standard URLs and browser-specific URLs.

Generic URL rule

This rule:

Browser URL rule

This rule only accepts browser-specific schemes such as:

Request Macros

The service provider registers a few request macros that return typed URL objects.

getUrlFromHeader

getOriginUrl

getRefererUrl

getFullUrl

These macros:

spatie/laravel-data Integration

If your project uses spatie/laravel-data, the package provides casts and a transformer under src/Data.

UrlCast

Use UrlCast when the incoming value must already be a valid URL.

ToUrlCast

Use ToUrlCast when you want to coerce host-like values into full URLs.

Examples it can handle:

UrlTransformer

UrlTransformer converts the URL object back to its string representation when the data object is transformed.

Contracts

The package exposes a small set of contracts under Atldays\Url\Contracts, including:

These contracts are useful when you want to type against abstractions instead of the concrete URL implementation.

Translations

Validation messages are provided through the package translation namespace:

If you want to publish the package translations into your Laravel application and customize them, run:

After publishing, you can override the package translations in:

Testing

Run the test suite:

Check formatting:

Auto-fix formatting:

Credits

License

The MIT License. Please see LICENSE.md for more information.


All versions of laravel-url with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-iconv Version *
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/translation Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.93
spatie/url Version ^2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package atldays/laravel-url contains the following files

Loading the files please wait ...