First steps Dashboard.
This commit is contained in:
1 parent
a03ce3d647
commit
1574edea88
16 files changed
+389
-411
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class Api
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function get(string $path, string $query = ''): ?array
|
||||
{
|
||||
|
||||
$endpoint = env('FASTAPI_URI');
|
||||
$request = $endpoint.$path;
|
||||
$get = Http::get($request);
|
||||
|
||||
if($get->successful()){
|
||||
return $get->json();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function propertiesPerRegion()
|
||||
{
|
||||
return self::get('/region/properties');
|
||||
}
|
||||
|
||||
public static function propertyExtractions(int $id)
|
||||
{
|
||||
return self::get("/properties/extractions/{$id}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user