Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Lake committed Jul 30, 2019
1 parent fec8158 commit 92f8fd5
Showing 1 changed file with 21 additions and 27 deletions.
48 changes: 21 additions & 27 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ Route::middleware(['ApiRequest'])->get('/some/api/route', function() {
```php
Route::group(['middleware' => ['ApiRequest']], function() {

Route::get('/some/api/route/1', function() {
return response(['some' => 'data']);
});

Route::get('/some/api/route/2', function() {
Route::get('/some/api/route', function() {
return response(['some' => 'data']);
});

Expand All @@ -65,11 +61,7 @@ Route::middleware(['ApiResponse', 'ApiRequest'])->get('/some/api/route', functio
```php
Route::group(['middleware' => ['ApiResponse', 'ApiRequest']], function() {

Route::get('/some/api/route/1', function() {
return response(['some' => 'data']);
});

Route::get('/some/api/route/2', function() {
Route::get('/some/api/route', function() {
return response(['some' => 'data']);
});

Expand Down Expand Up @@ -142,28 +134,30 @@ routes/web.php
use Illuminate\Http\Resources\Json\Resource;
use App\User;

Route::get('/users', function(){
return response(User::get());
});
Route::group(['middleware' => ['ApiRequest', 'ApiResponse']], function() {
Route::get('/users', function(){
return response(User::get());
});

Route::get('/users/first', function(){
return response(User::first());
});
Route::get('/users/first', function(){
return response(User::first());
});

Route::get('/users/paginated', function(){
return response(User::paginate());
});
Route::get('/users/paginated', function(){
return response(User::paginate());
});

Route::get('/users/resource', function(){
return response(new Resource(User::first()));
});
Route::get('/users/resource', function(){
return response(new Resource(User::first()));
});

Route::get('/users/resources', function(){
return response(Resource::collection(User::get()));
});
Route::get('/users/resources', function(){
return response(Resource::collection(User::get()));
});

Route::get('/users/resources/paginated', function(){
return response(Resource::collection(User::paginate()));
Route::get('/users/resources/paginated', function(){
return response(Resource::collection(User::paginate()));
});
});
```

Expand Down

0 comments on commit 92f8fd5

Please sign in to comment.