| Package Data | |
|---|---|
| Maintainer Username: | Sukohi |
| Maintainer Contact: | test@example.com (Sukohi) |
| Package Create Date: | 2016-12-15 |
| Package Last Update: | 2017-01-30 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-06 15:09:09 |
| Package Statistics | |
|---|---|
| Total Downloads: | 32 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 0 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
A Laravel package to generate absolute URL.
Execute the following composer command.
composer require sukohi/laravel-absolute-url:1.*
Register the service provider in app.php
'providers' => [
...Others...,
Sukohi\LaravelAbsoluteUrl\LaravelAbsoluteUrlServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'LaravelAbsoluteUrl' => Sukohi\LaravelAbsoluteUrl\Facades\LaravelAbsoluteUrl::class
]
// 1. Set Base URL
$base_url = 'http://example.com/1/2/3/';
$absolute_path = \LaravelAbsoluteUrl::baseUrl($base_url);
// 2. Get Absolute URL
echo $absolute_path->get('/test.html'); // http://example.com/test.html
echo $absolute_path->get('../test.html'); // http://example.com/1/2/test.html
echo $absolute_path->get('./test.html'); // http://example.com/1/2/3/test.html
echo $absolute_path->get('test.html'); // http://example.com/1/2/3/test.html
This package is licensed under the MIT License.
Copyright 2016 Sukohi Kuhoh