Skip to content

Commit ea2d83a

Browse files
committed
Remove docblocks in the controller
1 parent ed2619d commit ea2d83a

File tree

2 files changed

+1
-91
lines changed

2 files changed

+1
-91
lines changed

app/Http/Controllers/SideProjectController.php

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,19 @@
88
use League\Fractal\Manager;
99
use League\Fractal\Resource\Item;
1010

11-
/**
12-
* @group Side Projects
13-
*/
11+
1412
class SideProjectController extends Controller
1513
{
1614
public function __construct()
1715
{
1816
$this->middleware('auth')->only('store');
1917
}
2018

21-
/**
22-
* View all side projects
23-
*
24-
* This endpoint's response was gotten via a "response call"—
25-
* Scribe called our API in a test environment to get a sample response.
26-
*/
2719
public function index()
2820
{
2921
return SideProject::all();
3022
}
3123

32-
/**
33-
* Start a new side project
34-
*
35-
* _Even though we both know you'll never finish it._
36-
*
37-
* This endpoint's body parameters were automatically generated by Scribe
38-
* from the controller's code. Check out the source! </aside>
39-
*
40-
* @authenticated
41-
*/
4224
public function store(Request $request)
4325
{
4426
$validated = $request->validate([
@@ -57,47 +39,23 @@ public function store(Request $request)
5739
return SideProject::create($validated);
5840
}
5941

60-
/**
61-
* View a side project
62-
*
63-
* This endpoint's response uses a Fractal transformer, so we tell Scribe that using an annotation,
64-
* and it figures out how to generate a sample. The 404 sample is gotten from a "response file".
65-
*
66-
* <aside class="success">Also, pretty cool: this endpoint's (and many others') URL parameters were figured out entirely by Scribe!</aside>
67-
*
68-
* @transformer App\Http\Transformers\SideProjectTransformer
69-
* @transformerModel App\Models\SideProject with=owner
70-
*/
7142
public function show(SideProject $sideProject)
7243
{
7344
$fractal = new Manager();
7445
$resource = new Item($sideProject, new SideProjectTransformer());
7546
return $fractal->createData($resource)->toArray();
7647
}
7748

78-
/**
79-
* Update a side project
80-
*
81-
*/
8249
public function update(Request $request, SideProject $sideProject)
8350
{
8451
//
8552
}
8653

87-
/**
88-
* Delete a side project
89-
*
90-
*/
9154
public function destroy(SideProject $sideProject)
9255
{
9356
//
9457
}
9558

96-
/**
97-
* Finish a side project
98-
*
99-
* Hmmm.🤔
100-
*/
10159
public function finish(SideProject $sideProject)
10260
{
10361
//

app/Http/Controllers/UserController.php

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,11 @@
1212
*/
1313
class UserController extends Controller
1414
{
15-
/**
16-
* View all users
17-
*
18-
* This endpoint uses a custom Scribe strategy that parses a
19-
* `@usesPagination` annotation to add some query parameters.
20-
*
21-
* The sample response is gotten by Scribe making a test API call (aka "response call").
22-
*
23-
* @usesPagination
24-
*/
2515
public function index()
2616
{
2717
return UserResource::collection(User::all());
2818
}
2919

30-
/**
31-
* Create a user
32-
*
33-
* This endpoint's body parameters are automatically generated from a FormRequest.
34-
*/
3520
public function store(CreateUserRequest $request)
3621
{
3722
/** @var User $user */
@@ -40,55 +25,22 @@ public function store(CreateUserRequest $request)
4025
return response(['user' => $user, 'token' => $token->plainTextToken], 201);
4126
}
4227

43-
/**
44-
* Authenticate
45-
*
46-
* Get a new API token.
47-
*
48-
* <aside>Yes, we know you can impersonate any user.🙄</aside>
49-
*
50-
* @response {"token": "2|KLDoUXc68Ko0JaFDZoX9qYkUqWglwdGxQsvTGBCg"}
51-
* @responseField token The new API token. Valid forever.
52-
*/
5328
public function authenticate($id)
5429
{
5530
$token = User::findOrFail($id)->createToken('default');
5631
return ['token' => $token->plainTextToken];
5732
}
5833

59-
/**
60-
* Fetch a user
61-
*
62-
* This endpoint's response uses an Eloquent API resource, so we tell Scribe that using an annotation,
63-
* and it figures out how to generate a sample. The 404 sample is gotten from a "response file".
64-
*
65-
* @apiResource App\Http\Resources\UserResource
66-
* @apiResourceModel App\Models\User with=sideProjects
67-
* @responseFile 404 scenario="User not found" responses/not_found.json {"resource": "user"}
68-
*/
6934
public function show($id)
7035
{
7136
return new UserResource(User::findOrFail($id));
7237
}
7338

74-
/**
75-
* Update the specified resource in storage.
76-
*
77-
* @param \Illuminate\Http\Request $request
78-
* @param int $id
79-
* @return \Illuminate\Http\Response
80-
*/
8139
public function update(Request $request, $id)
8240
{
8341
//
8442
}
8543

86-
/**
87-
* Remove the specified resource from storage.
88-
*
89-
* @param int $id
90-
* @return \Illuminate\Http\Response
91-
*/
9244
public function destroy($id)
9345
{
9446
//

0 commit comments

Comments
 (0)