Skip to content

Commit 0817d99

Browse files
Merge pull request #335 from rakutentech/feature/features-for-users
Vups and new features for users
2 parents 93a0606 + 846406c commit 0817d99

24 files changed

+8359
-12721
lines changed

.github/workflows/node.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
node-versions: [16, 18, 19, 20]
13+
node-versions: [20]
1414

1515
steps:
1616
- name: Cancel Previous Runs

.github/workflows/phptest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
php: [7.4, 8.0, 8.1, 8.2]
12+
php: [7.4, 8.0, 8.1, 8.2, 8.3]
1313
laravel: [8.*]
1414
include:
1515
- php: 8.0
@@ -22,6 +22,8 @@ jobs:
2222
laravel: 10.*
2323
- php: 8.2
2424
laravel: 10.*
25+
- php: 8.3
26+
laravel: 10.*
2527

2628
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
2729

.github/workflows/releaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-versions: [18]
16+
node-versions: [20]
1717

1818
steps:
1919
- name: Cancel Previous Runs

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.4|^8.0|^8.1|^8.2",
19+
"php": "^7.4|^8.0|^8.1|^8.2|^8.3",
2020
"illuminate/contracts": "^8.37|^9.0|^10.0",
2121
"kitloong/laravel-app-logger": "^1.0",
2222
"spatie/laravel-package-tools": "^1.4.3",

config/request-docs.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

33
return [
4+
// changes doc title
5+
'title' => 'LRD - Laravel Request Docs',
46
'enabled' => true,
57
// change it to true will make lrd to throw exception if rules in request class need to be changed
68
// keep it false
@@ -38,9 +40,16 @@
3840
'rules_methods' => [
3941
'rules'
4042
],
43+
4144
// Can be overridden as // @LRDresponses 200|400|401
4245
'default_responses' => [ "200", "400", "401", "403", "404", "405", "422", "429", "500", "503"],
4346

47+
// changes default headers on first load for Set Global Headers
48+
// Later the local storage is used when edits are made
49+
'default_headers' => [
50+
'Content-Type' => 'application/json',
51+
],
52+
4453
// By default, LRD group your routes by the first /path.
4554
// This is a set of regex to group your routes by prefix.
4655
'group_by' => [

src/Controllers/LaravelRequestDocsController.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,18 @@ public function assets(Request $request)
121121
}
122122
return response()->json(['error' => 'file not found'], 404);
123123
}
124+
125+
/**
126+
* @codeCoverageIgnore
127+
* @param \Illuminate\Http\Request $request
128+
* @return \Illuminate\Http\JsonResponse
129+
*/
130+
public function config(Request $request)
131+
{
132+
$config = [
133+
'title' => config('request-docs.title'),
134+
'default_headers' => config('request-docs.default_headers'),
135+
];
136+
return response()->json($config);
137+
}
124138
}

src/LaravelRequestDocsServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public function packageBooted()
4747
->name('request-docs.api')
4848
->middleware(config('request-docs.middlewares'));
4949

50+
Route::get("request-docs/config", [\Rakutentech\LaravelRequestDocs\Controllers\LaravelRequestDocsController::class, 'config'])
51+
->name('request-docs.config')
52+
->middleware(config('request-docs.middlewares'));
53+
5054
Route::get("request-docs/_astro/{slug}", [\Rakutentech\LaravelRequestDocs\Controllers\LaravelRequestDocsController::class, 'assets'])
5155
// where slug is either js or css
5256
->where('slug', '.*js|.*css|.*png|.*jpg|.*jpeg|.*gif|.*svg|.*ico|.*woff|.*woff2|.*ttf|.*eot|.*otf|.*map')

ui/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ npm run dev
1212

1313
## 1) Mode: Readonly
1414

15-
**Open in Browser**
15+
**Open in Browser**
1616

17-
http://localhost:3000/request-docs?api=http://localhost:3000/request-docs/sample.json
17+
http://localhost:3000/request-docs/?api=http://localhost:3000/request-docs/sample.json
1818

1919

2020
## 2) Mode: Developing with Laravel via npm

ui/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'astro/config'
22
import compress from 'astro-compress'
33
import react from '@astrojs/react'
4+
import process from 'process'
45

56
import git from 'git-rev-sync'
67
const version = git.tag()

0 commit comments

Comments
 (0)