PHP 8.3.31
Preview: LocationRequest.php Size: 1.22 KB
/home/getspomw/royalsquad.us/vendor/stevebauman/location/src/LocationRequest.php

<?php

namespace Stevebauman\Location;

use Illuminate\Http\Request as IlluminateRequest;

class LocationRequest extends IlluminateRequest implements Request
{
    /**
     * The IP address to resolve.
     */
    protected ?string $ip;

    /**
     * Get the client IP address.
     */
    public function getIp(): string
    {
        if ($this->ip) {
            return $this->ip;
        }

        if ($this->isTesting()) {
            return $this->getTestingIp();
        }

        return parent::ip();
    }

    /**
     * Set the IP address to resolve.
     */
    public function setIp(?string $ip = null): static
    {
        $this->ip = $ip;

        return $this;
    }

    /**
     * Get a header from the request.
     */
    public function getHeader(?string $key = null, string|array|null $default = null): string|array|null
    {
        return parent::header($key, $default);
    }

    /**
     * Determine if location testing is enabled.
     */
    protected function isTesting(): bool
    {
        return config('location.testing.enabled', true);
    }

    /**
     * Get the testing IP address.
     */
    protected function getTestingIp(): string
    {
        return config('location.testing.ip', '66.102.0.0');
    }
}

Directory Contents

Dirs: 4 × Files: 7

Name Size Perms Modified Actions
Commands DIR
- drwxrwxrwx 2025-09-17 07:10:32
Edit Download
Drivers DIR
- drwxrwxrwx 2025-09-17 07:10:32
Edit Download
- drwxrwxrwx 2025-09-17 07:10:32
Edit Download
Facades DIR
- drwxrwxrwx 2025-09-17 07:10:32
Edit Download
4.71 KB lrw-r--r-- 2026-04-26 10:04:35
Edit Download
938 B lrw-rw-rw- 2025-08-03 14:03:40
Edit Download
2.79 KB lrw-rw-rw- 2025-08-03 14:03:40
Edit Download
1.22 KB lrw-rw-rw- 2025-08-03 14:03:40
Edit Download
734 B lrw-rw-rw- 2025-08-03 14:03:40
Edit Download
2.35 KB lrw-rw-rw- 2025-08-03 14:03:40
Edit Download
420 B lrw-rw-rw- 2025-08-03 14:03:40
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).