Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from huntie/routing-updates
Extended router fixes
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/JsonApiServiceProvider.php → src/Providers/JsonApiServiceProvider.php
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Huntie\JsonApi; | ||
namespace Huntie\JsonApi\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
|
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,21 @@ | ||
<?php | ||
|
||
namespace Huntie\JsonApi\Routing; | ||
|
||
trait KernelRouterAssociation | ||
{ | ||
/** | ||
* Get the route dispatcher callback. | ||
* | ||
* @return \Closure | ||
*/ | ||
protected function dispatchToRouter() | ||
{ | ||
// Whilst Laravel provides the package Router instance within all app | ||
// code, it is hardcoded in the base Kernel class and needs to be set | ||
// directly here when we are using custom JSON API router extensions. | ||
parent::__construct($this->app, $this->app['router']); | ||
|
||
return parent::dispatchToRouter(); | ||
} | ||
} |