88use League \Fractal \Manager ;
99use League \Fractal \Resource \Item ;
1010
11- /**
12- * @group Side Projects
13- */
11+
1412class 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- */
71- public function show (SideProject $ id )
42+ 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 //
0 commit comments