Skip to content

Commit 94d05e1

Browse files
committed
Merge branch 'release/3.2.1'
2 parents 5c595ca + 1394f03 commit 94d05e1

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

1.0/routing/custom-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ JsonApiRoute::server('v1')
302302
$relationships->hasOne('author')->readOnly();
303303
$relationships->hasMany('tags');
304304
})->actions('-actions', function ($actions) {
305-
$actions->withId()->post('purge');
305+
$actions->withId()->post('publish');
306306
});
307307

308308
// ...other resources

2.0/routing/custom-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ JsonApiRoute::server('v1')
302302
$relationships->hasOne('author')->readOnly();
303303
$relationships->hasMany('tags');
304304
})->actions('-actions', function ($actions) {
305-
$actions->withId()->post('purge');
305+
$actions->withId()->post('publish');
306306
});
307307

308308
// ...other resources

3.0/routing/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,3 +490,14 @@ JsonApiRoute::server('v1')
490490
$server->resource('posts', PostController::class);
491491
});
492492
```
493+
494+
## Writing Regular Laravel Routes
495+
496+
You are not constrained to just using the routing from this package!
497+
498+
If you need to create some routes and actions that deviate from JSON:API conventions,
499+
you can just create an endpoint in exactly the way you would when using Laravel -
500+
i.e. register a route, write a controller.
501+
502+
If you want to return a JSON:API response from the controller, you can use one of the
503+
package's [response classes](../responses/).

3.0/routing/custom-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ JsonApiRoute::server('v1')
304304
$relationships->hasOne('author')->readOnly();
305305
$relationships->hasMany('tags');
306306
})->actions('-actions', function (ActionRegistrar $actions) {
307-
$actions->withId()->post('purge');
307+
$actions->withId()->post('publish');
308308
});
309309

310310
// ...other resources

0 commit comments

Comments
 (0)