REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.79 KB
Close
/home/getspomw/royalsquad.us/vendor/stevebauman/location/src/LocationManager.php
Text
Base64
<?php namespace Stevebauman\Location; use Illuminate\Support\Traits\Macroable; use Stevebauman\Location\Drivers\Driver; use Stevebauman\Location\Exceptions\DriverDoesNotExistException; class LocationManager { use Macroable; /** * The current driver. */ protected Driver $driver; /** * The loaded drivers. * * @var Driver[] */ protected array $loaded = []; /** * The request resolver callback. * * @var callable */ protected $requestResolver; /** * Constructor. * * @throws DriverDoesNotExistException */ public function __construct() { $this->setDefaultDriver(); $this->requestResolver = fn () => LocationRequest::createFrom(request()); } /** * Set the current driver to use. */ public function setDriver(Driver $driver): static { $this->driver = $driver; return $this; } /** * Set the default location driver to use. * * @throws DriverDoesNotExistException */ public function setDefaultDriver(): static { $this->loaded[] = $driver = $this->getDriver($this->getDefaultDriver()); foreach ($this->getDriverFallbacks() as $fallback) { $driver->fallback($this->loaded[] = $this->getDriver($fallback)); } return $this->setDriver($driver); } /** * Attempt to retrieve the location of the user. */ public function get(?string $ip = null): Position|bool { if ($location = $this->driver->get($this->request()->setIp($ip))) { return $location; } return false; } /** * Get the HTTP request. */ protected function request(): Request { return call_user_func($this->requestResolver); } /** * Set the request resolver callback. */ public function resolveRequestUsing(callable $callback): void { $this->requestResolver = $callback; } /** * Get the loaded driver instances. * * @return Driver[] */ public function drivers(): array { return $this->loaded; } /** * Get the fallback location drivers to use. */ protected function getDriverFallbacks(): array { return config('location.fallbacks', []); } /** * Get the default location driver. */ protected function getDefaultDriver(): string { return config('location.driver'); } /** * Attempt to create the location driver. * * @throws DriverDoesNotExistException */ protected function getDriver(string $driver): Driver { if (! class_exists($driver)) { throw DriverDoesNotExistException::forDriver($driver); } return app($driver); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 4 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Commands
DIR
-
drwxrwxrwx
2025-09-17 07:10:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Drivers
DIR
-
drwxrwxrwx
2025-09-17 07:10:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Exceptions
DIR
-
drwxrwxrwx
2025-09-17 07:10:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Facades
DIR
-
drwxrwxrwx
2025-09-17 07:10:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
error_log
4.71 KB
lrw-r--r--
2026-04-26 10:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LocationFake.php
938 B
lrw-rw-rw-
2025-08-03 14:03:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LocationManager.php
2.79 KB
lrw-rw-rw-
2025-08-03 14:03:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LocationRequest.php
1.22 KB
lrw-rw-rw-
2025-08-03 14:03:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LocationServiceProvider.php
734 B
lrw-rw-rw-
2025-08-03 14:03:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Position.php
2.35 KB
lrw-rw-rw-
2025-08-03 14:03:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Request.php
420 B
lrw-rw-rw-
2025-08-03 14:03:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).