REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.03 KB
Close
/home/getspomw/royalsquad.us/vendor/stevebauman/location/src/Drivers/Driver.php
Text
Base64
<?php namespace Stevebauman\Location\Drivers; use Illuminate\Support\Fluent; use Stevebauman\Location\Position; use Stevebauman\Location\Request; abstract class Driver { /** * The fallback driver. */ protected ?Driver $fallback = null; /** * Append a fallback driver to the end of the chain. */ public function fallback(Driver $handler): void { if (is_null($this->fallback)) { $this->fallback = $handler; } else { $this->fallback->fallback($handler); } } /** * Get a position from the request. */ public function get(Request $request): Position|false { $data = $this->process($request); $position = $this->makePosition(); // Here we will ensure the location's data we received isn't empty. // Some IP location providers will return empty JSON. We want // to avoid this, so we can call the next fallback driver. if ($data instanceof Fluent && ! $this->isEmpty($data)) { $position = $this->hydrate($position, $data); $position->ip = $request->getIp(); $position->driver = get_class($this); } if (! $position->isEmpty()) { return $position; } return $this->fallback ? $this->fallback->get($request) : false; } /** * Attempt to fetch and process the location data from the driver. */ abstract protected function process(Request $request): Fluent|false; /** * Hydrate the Position object with the given location data. */ abstract protected function hydrate(Position $position, Fluent $location): Position; /** * Create a new position instance. */ protected function makePosition(): Position { return app(config('location.position', Position::class)); } /** * Determine if the given fluent data is not empty. */ protected function isEmpty(Fluent $data): bool { return empty(array_filter($data->getAttributes())); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Cloudflare.php
1.90 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
Driver.php
2.03 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
GeoPlugin.php
1.00 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
HttpDriver.php
1.45 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
Ip2locationio.php
1.23 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
IpApi.php
1.06 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
IpApiPro.php
394 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
IpData.php
1.12 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
IpInfo.php
1.11 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
IpInfoLite.php
691 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
Kloudend.php
1.06 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
MaxMind.php
6.58 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
Updatable.php
199 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).