-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the ability to create API routes with multiple route parame…
…ters Merge pull request #271 from jonerickson/feature/multiple-controller-arguments
- Loading branch information
Showing
43 changed files
with
915 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Orion\Contracts; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
interface KeyResolver | ||
{ | ||
public function resolveStandardOperationKey(Request $request, array $args); | ||
|
||
public function resolveRelationOperationParentKey(Request $request, array $args); | ||
|
||
public function resolveRelationOperationRelatedKey(Request $request, array $args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Orion\Drivers\Standard; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
class KeyResolver implements \Orion\Contracts\KeyResolver | ||
{ | ||
public function resolveStandardOperationKey(Request $request, array $args) | ||
{ | ||
return $args[0]; | ||
} | ||
|
||
public function resolveRelationOperationParentKey(Request $request, array $args) | ||
{ | ||
return $args[0]; | ||
} | ||
|
||
public function resolveRelationOperationRelatedKey(Request $request, array $args) | ||
{ | ||
return $args[1] ?? null; | ||
} | ||
} |
Oops, something went wrong.