Skip to content

Commit

Permalink
function
Browse files Browse the repository at this point in the history
  • Loading branch information
juancristobalgd1 authored Dec 26, 2023
1 parent 19368f0 commit fbbba84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -968,13 +968,13 @@ function class_basename($class)
* @param bool $secure Force the use of HTTPS in the URL
* @return string Full URL of the resource.
*/
function asset($path, $basePath = null)
function asset(string $path, $basePath = null): string
{
// Get the URL base of your application from the configuration or as you prefer.
$baseUrl = $basePath ? $basePath : '';

// Combines the base URL with the relative path of the resource.
$url = rtrim($baseUrl, '/') . '/' . ltrim($path, '/');
$url = rtrim($baseUrl, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR);

$fullUrl = baseUrl($url);
return $fullUrl;
Expand Down

0 comments on commit fbbba84

Please sign in to comment.