|
30 | 30 | use Flat3\Lodata\Interfaces\ResponseInterface;
|
31 | 31 | use Flat3\Lodata\Interfaces\TransactionInterface;
|
32 | 32 | use Flat3\Lodata\NavigationProperty;
|
| 33 | +use Flat3\Lodata\Endpoint; |
33 | 34 | use Flat3\Lodata\Operation;
|
34 | 35 | use Flat3\Lodata\PathSegment;
|
35 |
| -use Flat3\Lodata\ServiceProvider; |
36 | 36 | use Flat3\Lodata\Singleton;
|
37 | 37 | use Flat3\Lodata\Transaction\IEEE754Compatible;
|
38 | 38 | use Flat3\Lodata\Transaction\MediaType;
|
|
58 | 58 | use Flat3\Lodata\Transaction\ParameterList;
|
59 | 59 | use Flat3\Lodata\Transaction\Version;
|
60 | 60 | use Flat3\Lodata\Type\Collection;
|
| 61 | +use Illuminate\Contracts\Container\BindingResolutionException; |
61 | 62 | use Illuminate\Support\Arr;
|
62 | 63 | use Illuminate\Support\Facades\App;
|
63 | 64 | use Illuminate\Support\Str;
|
@@ -784,7 +785,7 @@ public function getPath(): string
|
784 | 785 | */
|
785 | 786 | public function getRequestPath(): string
|
786 | 787 | {
|
787 |
| - $route = ServiceProvider::route(); |
| 788 | + $route = app()->make(Endpoint::class)->route(); |
788 | 789 | return Str::substr($this->request->path(), strlen($route));
|
789 | 790 | }
|
790 | 791 |
|
@@ -947,20 +948,22 @@ private function getSystemQueryOptions(bool $prefixed = true): array
|
947 | 948 | * Get the service document context URL
|
948 | 949 | * https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServiceDocument
|
949 | 950 | * @return string Context URL
|
| 951 | + * @throws BindingResolutionException |
950 | 952 | */
|
951 | 953 | public function getContextUrl(): string
|
952 | 954 | {
|
953 |
| - return ServiceProvider::endpoint().'$metadata'; |
| 955 | + return self::getResourceUrl().'$metadata'; |
954 | 956 | }
|
955 | 957 |
|
956 | 958 | /**
|
957 | 959 | * Get the service document resource URL
|
958 | 960 | * https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServiceDocument
|
959 | 961 | * @return string Resource URL
|
| 962 | + * @throws BindingResolutionException |
960 | 963 | */
|
961 | 964 | public static function getResourceUrl(): string
|
962 | 965 | {
|
963 |
| - return ServiceProvider::endpoint(); |
| 966 | + return app()->make(Endpoint::class)->endpoint(); |
964 | 967 | }
|
965 | 968 |
|
966 | 969 | /**
|
|
0 commit comments