PHP 8.3.31
Preview: LocationFake.php Size: 938 B
//proc/self/root/home/getspomw/itechservicellc.com/vendor/stevebauman/location/src/LocationFake.php

<?php

namespace Stevebauman\Location;

use Illuminate\Support\Str;
use Illuminate\Support\Traits\ForwardsCalls;

class LocationFake
{
    use ForwardsCalls;

    /**
     * Constructor.
     */
    public function __construct(
        protected LocationManager $manager,
        protected array $requests = [],
    ) {}

    /**
     * Forward missing method calls to the location manager.
     */
    public function __call(string $method, array $parameters): mixed
    {
        return $this->forwardCallTo($this->manager, $method, $parameters);
    }

    /**
     * Get a fake location instance.
     */
    public function get(?string $ip = null): Position|bool
    {
        $ip ??= '127.0.0.1';

        foreach ($this->requests as $ipRequest => $position) {
            if (Str::is($ipRequest, $ip)) {
                $position->ip = $ip;

                return $position;
            }
        }

        return false;
    }
}

Directory Contents

Dirs: 4 × Files: 6

Name Size Perms Modified Actions
Commands DIR
- drwxr-xr-x 2025-11-18 19:24:10
Edit Download
Drivers DIR
- drwxr-xr-x 2025-11-18 19:24:10
Edit Download
- drwxr-xr-x 2025-11-18 19:24:10
Edit Download
Facades DIR
- drwxr-xr-x 2025-11-18 19:24:10
Edit Download
938 B lrw-r--r-- 2025-10-28 20:23:32
Edit Download
2.79 KB lrw-r--r-- 2025-10-28 20:23:32
Edit Download
1.22 KB lrw-r--r-- 2025-10-28 20:23:32
Edit Download
734 B lrw-r--r-- 2025-10-28 20:23:32
Edit Download
2.35 KB lrw-r--r-- 2025-10-28 20:23:32
Edit Download
420 B lrw-r--r-- 2025-10-28 20:23:32
Edit Download

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