Skip to content

Commit 71f3eff

Browse files
committed
[Feature] Add Laravel controller traits to JsonApiController
1 parent 49e70e2 commit 71f3eff

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file. This projec
55

66
## Unreleased
77

8+
### Added
9+
10+
- The `JsonApiController` now has the Laravel `AuthorizesRequests`, `DispatchesJobs` and `ValidatesRequests` traits
11+
applied.
12+
813
### Changed
14+
915
- [#2](https://github.com/laravel-json-api/laravel/issues/2) **BREAKING** Improved the extraction of existing resource
1016
field values when constructing validation data for update requests:
1117
- The `existingAttributes()` and `existingRelationships()` methods on the resource request class has been removed.

src/Http/Controllers/JsonApiController.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@
1919

2020
namespace LaravelJsonApi\Laravel\Http\Controllers;
2121

22+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
23+
use Illuminate\Foundation\Bus\DispatchesJobs;
24+
use Illuminate\Foundation\Validation\ValidatesRequests;
25+
2226
class JsonApiController
2327
{
2428

29+
/**
30+
* JSON:API Actions
31+
*/
2532
use Actions\FetchMany;
2633
use Actions\FetchOne;
2734
use Actions\Store;
@@ -33,4 +40,11 @@ class JsonApiController
3340
use Actions\AttachRelationship;
3441
use Actions\DetachRelationship;
3542

43+
/**
44+
* Laravel Controller Traits
45+
*/
46+
use AuthorizesRequests;
47+
use DispatchesJobs;
48+
use ValidatesRequests;
49+
3650
}

0 commit comments

Comments
 (0)