validate(['image' => 'file|required']); return [ 'filename' => request()->file('image')->getFilename(), 'filepath' => request()->file('image')->getPath(), 'name' => request('name'), ]; } /** * Endpoint with body parameters as array. * * @bodyParam _ object[] Details. * @bodyParam _[].first_name string The first name of the user. Example: John * @bodyParam _[].last_name string The last name of the user. Example: Doe * @bodyParam _[].contacts object[] Contact info * @bodyParam _[].contacts[].first_name string The first name of the contact. Example: John * @bodyParam _[].contacts[].last_name string The last name of the contact. Example: Doe * @bodyParam _[].roles string[] The name of the role. Example: Admin */ public function withBodyParametersAsArray() { return ''; } public function withFormRequestParameter(string $test, TestRequest $request) { return ''; } /** * @bodyParam direct_one string Is found directly on the method. */ public function withNonCommentedFormRequestParameter(TestNonCommentedRequest $request) { return ''; } /** * @queryParam location_id required The id of the location. * @queryParam user_id required The id of the user. Example: me * @queryParam page required The page number. Example: 4 * @queryParam filters The filters. * @queryParam url_encoded Used for testing that URL parameters will be URL-encoded where needed. Example: + []&= */ public function withQueryParameters() { return ''; } /** * @bodyParam included string required Exists in examples. Example: 'Here' * @bodyParam excluded_body_param int Does not exist in examples. No-example * @queryParam excluded_query_param Does not exist in examples. No-example */ public function withExcludedExamples() { return ''; } /** * @authenticated * @responseField user_id string The ID of the newly created user * @responseField creator_id string The ID of the creator */ public function withAuthenticatedTag() { return ''; } /** * @responseField user_id string The ID of the newly created user * @responseField creator_id string The ID of the creator */ public function withResponseFieldTag() { return ''; } /** * @apiResource \Knuckles\Scribe\Tests\Fixtures\TestUserApiResource * @apiResourceModel \Knuckles\Scribe\Tests\Fixtures\TestUser */ public function withEloquentApiResource() { return new TestUserApiResource(Utils::getModelFactory(TestUser::class)->make(['id' => 0])); } /** * @group Other😎 * * @apiResourceCollection Knuckles\Scribe\Tests\Fixtures\TestUserApiResource * @apiResourceModel Knuckles\Scribe\Tests\Fixtures\TestUser */ public function withEloquentApiResourceCollection() { return TestUserApiResource::collection( collect([Utils::getModelFactory(TestUser::class)->make(['id' => 0])]) ); } /** * @group Other😎 * * @apiResourceCollection Knuckles\Scribe\Tests\Fixtures\TestUserApiResourceCollection * @apiResourceModel Knuckles\Scribe\Tests\Fixtures\TestUser */ public function withEloquentApiResourceCollectionClass() { return new TestUserApiResourceCollection( collect([Utils::getModelFactory(TestUser::class)->make(['id' => 0])]) ); } public function checkCustomHeaders(Request $request) { return $request->headers->all(); } public function shouldFetchRouteResponse() { $fruit = new \stdClass(); $fruit->id = 4; $fruit->name = ' banana '; $fruit->color = 'RED'; $fruit->weight = 1; $fruit->delicious = true; return [ 'id' => (int) $fruit->id, 'name' => trim($fruit->name), 'color' => strtolower($fruit->color), 'weight' => $fruit->weight . ' kg', 'delicious' => $fruit->delicious, 'responseCall' => true, ]; } public function echoesConfig() { return [ 'app.env' => config('app.env'), ]; } /** * @group Other😎 * * @urlParam param required Example: 4 * @urlParam param2 required * @urlParam param4 No-example. * * @queryParam something */ public function echoesUrlParameters($param, $param2, $param3 = null, $param4 = null) { return compact('param', 'param2', 'param3', 'param4'); } /** * @authenticated * @urlparam $id Example: 3 */ public function shouldFetchRouteResponseWithEchoedSettings($id) { return [ '{id}' => $id, 'header' => request()->header('header'), 'auth' => request()->header('Authorization'), 'queryParam' => request()->query('queryParam'), 'bodyParam' => request()->get('bodyParam'), ]; } /** * @response { * "result": "Лорем ипсум долор сит амет" * } */ public function withUtf8ResponseTag() { return ['result' => 'Лорем ипсум долор сит амет']; } /** * @hideFromAPIDocumentation */ public function skip() { } /** * @response { * "id": 4, * "name": "banana", * "color": "red", * "weight": "1 kg", * "delicious": true, * "responseTag": true * } */ public function withResponseTag() { GeneratorTest::$globalValue = rand(); return ''; } /** * @response 422 { * "message": "Validation error" * } */ public function withResponseTagAndStatusCode() { return ''; } /** * @response { * "id": 4, * "name": "banana", * "color": "red", * "weight": "1 kg", * "delicious": true, * "multipleResponseTagsAndStatusCodes": true * } * @response 401 { * "message": "Unauthorized" * } */ public function withMultipleResponseTagsAndStatusCode() { return ''; } /** * @transformer \Knuckles\Scribe\Tests\Fixtures\TestTransformer */ public function transformerTag() { return ''; } /** * @transformer 201 \Knuckles\Scribe\Tests\Fixtures\TestTransformer */ public function transformerTagWithStatusCode() { return ''; } /** * @transformer \Knuckles\Scribe\Tests\Fixtures\TestTransformer * @transformermodel \Knuckles\Scribe\Tests\Fixtures\TestModel */ public function transformerTagWithModel() { return ''; } /** * @transformercollection \Knuckles\Scribe\Tests\Fixtures\TestTransformer */ public function transformerCollectionTag() { return ''; } /** * @transformercollection \Knuckles\Scribe\Tests\Fixtures\TestTransformer * @transformermodel \Knuckles\Scribe\Tests\Fixtures\TestModel */ public function transformerCollectionTagWithModel() { return ''; } /** * @responseFile response_test.json */ public function responseFileTag() { return ''; } /** * @responseFile response_test.json * @responseFile 401 response_error_test.json */ public function withResponseFileTagAndStatusCode() { return ''; } /** * @responseFile response_test.json {"message" : "Serendipity"} */ public function responseFileTagAndCustomJson() { return ''; } /** * @responseFile i-do-not-exist.json */ public function withNonExistentResponseFile() { return ''; } }