first commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[docker-compose.yml]
|
||||||
|
indent_size = 4
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
APP_NAME=Laravel
|
||||||
|
APP_ENV=local
|
||||||
|
APP_KEY=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_TIMEZONE=UTC
|
||||||
|
APP_URL=http://localhost
|
||||||
|
|
||||||
|
APP_LOCALE=en
|
||||||
|
APP_FALLBACK_LOCALE=en
|
||||||
|
APP_FAKER_LOCALE=en_US
|
||||||
|
|
||||||
|
APP_MAINTENANCE_DRIVER=file
|
||||||
|
# APP_MAINTENANCE_STORE=database
|
||||||
|
|
||||||
|
PHP_CLI_SERVER_WORKERS=4
|
||||||
|
|
||||||
|
BCRYPT_ROUNDS=12
|
||||||
|
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
LOG_STACK=single
|
||||||
|
LOG_DEPRECATIONS_CHANNEL=null
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
|
||||||
|
DB_CONNECTION=sqlite
|
||||||
|
# DB_HOST=127.0.0.1
|
||||||
|
# DB_PORT=3306
|
||||||
|
# DB_DATABASE=laravel
|
||||||
|
# DB_USERNAME=root
|
||||||
|
# DB_PASSWORD=
|
||||||
|
|
||||||
|
SESSION_DRIVER=database
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
SESSION_ENCRYPT=false
|
||||||
|
SESSION_PATH=/
|
||||||
|
SESSION_DOMAIN=null
|
||||||
|
|
||||||
|
BROADCAST_CONNECTION=log
|
||||||
|
FILESYSTEM_DISK=local
|
||||||
|
QUEUE_CONNECTION=database
|
||||||
|
|
||||||
|
CACHE_STORE=database
|
||||||
|
CACHE_PREFIX=
|
||||||
|
|
||||||
|
MEMCACHED_HOST=127.0.0.1
|
||||||
|
|
||||||
|
REDIS_CLIENT=phpredis
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=log
|
||||||
|
MAIL_SCHEME=null
|
||||||
|
MAIL_HOST=127.0.0.1
|
||||||
|
MAIL_PORT=2525
|
||||||
|
MAIL_USERNAME=null
|
||||||
|
MAIL_PASSWORD=null
|
||||||
|
MAIL_FROM_ADDRESS="hello@example.com"
|
||||||
|
MAIL_FROM_NAME="${APP_NAME}"
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID=
|
||||||
|
AWS_SECRET_ACCESS_KEY=
|
||||||
|
AWS_DEFAULT_REGION=us-east-1
|
||||||
|
AWS_BUCKET=
|
||||||
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||||
|
|
||||||
|
VITE_APP_NAME="${APP_NAME}"
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
|
||||||
|
*.blade.php diff=html
|
||||||
|
*.css diff=css
|
||||||
|
*.html diff=html
|
||||||
|
*.md diff=markdown
|
||||||
|
*.php diff=php
|
||||||
|
|
||||||
|
/.github export-ignore
|
||||||
|
CHANGELOG.md export-ignore
|
||||||
|
.styleci.yml export-ignore
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
/.phpunit.cache
|
||||||
|
/node_modules
|
||||||
|
/public/build
|
||||||
|
/public/hot
|
||||||
|
/public/storage
|
||||||
|
/storage/*.key
|
||||||
|
/storage/pail
|
||||||
|
/vendor
|
||||||
|
.env
|
||||||
|
.env.backup
|
||||||
|
.env.production
|
||||||
|
.phpactor.json
|
||||||
|
.phpunit.result.cache
|
||||||
|
Homestead.json
|
||||||
|
Homestead.yaml
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
/auth.json
|
||||||
|
/.fleet
|
||||||
|
/.idea
|
||||||
|
/.nova
|
||||||
|
/.vscode
|
||||||
|
/.zed
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# GENERATED. YOU SHOULDN'T MODIFY OR DELETE THIS FILE.
|
||||||
|
# Scribe uses this file to know when you change something manually in your docs.
|
||||||
|
.scribe/intro.md=36e08690cc623bbddd8746db5fae918f
|
||||||
|
.scribe/auth.md=9bee2b1ef8a238b2e58613fa636d5f39
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Authenticating requests
|
||||||
|
|
||||||
|
This API is not authenticated.
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,53 @@
|
|||||||
|
# To include an endpoint that isn't a part of your Laravel app (or belongs to a vendor package),
|
||||||
|
# you can define it in a custom.*.yaml file, like this one.
|
||||||
|
# Each custom file should contain an array of endpoints. Here's an example:
|
||||||
|
# See https://scribe.knuckles.wtf/laravel/documenting/custom-endpoints#extra-sorting-groups-in-custom-endpoint-files for more options
|
||||||
|
|
||||||
|
#- httpMethods:
|
||||||
|
# - POST
|
||||||
|
# uri: api/doSomething/{param}
|
||||||
|
# metadata:
|
||||||
|
# groupName: The group the endpoint belongs to. Can be a new group or an existing group.
|
||||||
|
# groupDescription: A description for the group. You don't need to set this for every endpoint; once is enough.
|
||||||
|
# subgroup: You can add a subgroup, too.
|
||||||
|
# title: Do something
|
||||||
|
# description: 'This endpoint allows you to do something.'
|
||||||
|
# authenticated: false
|
||||||
|
# headers:
|
||||||
|
# Content-Type: application/json
|
||||||
|
# Accept: application/json
|
||||||
|
# urlParameters:
|
||||||
|
# param:
|
||||||
|
# name: param
|
||||||
|
# description: A URL param for no reason.
|
||||||
|
# required: true
|
||||||
|
# example: 2
|
||||||
|
# type: integer
|
||||||
|
# queryParameters:
|
||||||
|
# speed:
|
||||||
|
# name: speed
|
||||||
|
# description: How fast the thing should be done. Can be `slow` or `fast`.
|
||||||
|
# required: false
|
||||||
|
# example: fast
|
||||||
|
# type: string
|
||||||
|
# bodyParameters:
|
||||||
|
# something:
|
||||||
|
# name: something
|
||||||
|
# description: The things we should do.
|
||||||
|
# required: true
|
||||||
|
# example:
|
||||||
|
# - string 1
|
||||||
|
# - string 2
|
||||||
|
# type: 'string[]'
|
||||||
|
# responses:
|
||||||
|
# - status: 200
|
||||||
|
# description: 'When the thing was done smoothly.'
|
||||||
|
# content: # Your response content can be an object, an array, a string or empty.
|
||||||
|
# {
|
||||||
|
# "hey": "ho ho ho"
|
||||||
|
# }
|
||||||
|
# responseFields:
|
||||||
|
# hey:
|
||||||
|
# name: hey
|
||||||
|
# description: Who knows?
|
||||||
|
# type: string # This is optional
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Truncgil Finance
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<aside>
|
||||||
|
<strong>Base URL</strong>: <code>http://localhost:8000</code>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
This documentation aims to provide all the information you need to work with our API.
|
||||||
|
|
||||||
|
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
|
||||||
|
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
|
||||||
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## About Laravel
|
||||||
|
|
||||||
|
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||||
|
|
||||||
|
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||||
|
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||||
|
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||||
|
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||||
|
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||||
|
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||||
|
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||||
|
|
||||||
|
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||||
|
|
||||||
|
## Learning Laravel
|
||||||
|
|
||||||
|
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||||
|
|
||||||
|
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||||
|
|
||||||
|
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||||
|
|
||||||
|
## Laravel Sponsors
|
||||||
|
|
||||||
|
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||||
|
|
||||||
|
### Premium Partners
|
||||||
|
|
||||||
|
- **[Vehikl](https://vehikl.com/)**
|
||||||
|
- **[Tighten Co.](https://tighten.co)**
|
||||||
|
- **[WebReinvent](https://webreinvent.com/)**
|
||||||
|
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||||
|
- **[64 Robots](https://64robots.com)**
|
||||||
|
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||||
|
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||||
|
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||||
|
- **[Jump24](https://jump24.co.uk)**
|
||||||
|
- **[Redberry](https://redberry.international/laravel/)**
|
||||||
|
- **[Active Logic](https://activelogic.com)**
|
||||||
|
- **[byte5](https://byte5.de)**
|
||||||
|
- **[OP.GG](https://op.gg)**
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||||
|
|
||||||
|
## Security Vulnerabilities
|
||||||
|
|
||||||
|
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console;
|
||||||
|
|
||||||
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
use App\Jobs\FetchCurrencyRates;
|
||||||
|
|
||||||
|
class Kernel extends ConsoleKernel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the application's command schedule.
|
||||||
|
*
|
||||||
|
* These should be classes that implement the ShouldQueue interface.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function schedule(Schedule $schedule)
|
||||||
|
{
|
||||||
|
$schedule->job(new FetchCurrencyRates())->hourly();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the commands for your application.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function commands()
|
||||||
|
{
|
||||||
|
$this->load(__DIR__.'/Commands');
|
||||||
|
|
||||||
|
require base_path('routes/console.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
abstract class Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Jobs\FetchCurrencyRates;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
class CurrencyController extends Controller
|
||||||
|
{
|
||||||
|
public function getCurrentRates()
|
||||||
|
{
|
||||||
|
// Job'ı çalıştır
|
||||||
|
// $data = FetchCurrencyRates::dispatchSync();
|
||||||
|
|
||||||
|
// JSON dosyasından oku
|
||||||
|
if (Storage::exists('currency/today.json')) {
|
||||||
|
return response()->json(
|
||||||
|
json_decode(Storage::get('currency/today.json'), true)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json(['error' => 'Veri bulunamadı'], 404);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||||
|
|
||||||
|
class Kernel extends HttpKernel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The application's global HTTP middleware stack.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $middleware = [
|
||||||
|
\App\Http\Middleware\TrustProxies::class,
|
||||||
|
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||||
|
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||||
|
\App\Http\Middleware\TrimStrings::class,
|
||||||
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The application's route middleware.
|
||||||
|
*
|
||||||
|
* These middleware may be assigned to groups or used individually.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $routeMiddleware = [
|
||||||
|
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||||
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||||
|
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||||
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||||
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||||
|
'password.confirm' => \Illuminate\Auth\Middleware\EnsurePasswordIsConfirmed::class,
|
||||||
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
|
'api' => \App\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The application's middleware groups.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $middlewareGroups = [
|
||||||
|
'web' => [
|
||||||
|
// Web middleware'leri
|
||||||
|
],
|
||||||
|
|
||||||
|
'api' => [
|
||||||
|
'throttle:api',
|
||||||
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
class FetchCurrencyRates implements ShouldQueue
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
$data['Update_Date'] = now()->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
// Döviz kurları
|
||||||
|
$response = Http::withHeaders([
|
||||||
|
'User-Agent' => 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10',
|
||||||
|
'Accept-Language' => 'en'
|
||||||
|
])->get('https://kur.doviz.com');
|
||||||
|
|
||||||
|
// DOM işlemleri için veri çekme
|
||||||
|
$dom = new \DOMDocument();
|
||||||
|
@$dom->loadHTML($response->body());
|
||||||
|
$xpath = new \DOMXPath($dom);
|
||||||
|
|
||||||
|
// Döviz kurlarını çekme
|
||||||
|
$elements = $xpath->query("//*[@data-socket-key]");
|
||||||
|
foreach ($elements as $element) {
|
||||||
|
$name = $element->getAttribute('data-socket-key');
|
||||||
|
$type = $element->getAttribute('data-socket-attr');
|
||||||
|
$value = $this->virgulToNokta(trim($element->nodeValue));
|
||||||
|
|
||||||
|
if (trim($name) !== '') {
|
||||||
|
if ($name == "JPY") $value = $value / 100;
|
||||||
|
if ($type == "bid") $data[$name]['Buying'] = $value;
|
||||||
|
if ($type == "ask") $data[$name]['Selling'] = $value;
|
||||||
|
if ($type == "c") $data[$name]['Change'] = $value;
|
||||||
|
$data[$name]['Type'] = "Currency";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AZN kuru için
|
||||||
|
$aznResponse = Http::get('https://wise.com/tr/currency-converter/azn-to-try-rate?amount=1');
|
||||||
|
preg_match('/(\d+\.\d+)\s+TRY/', $aznResponse->body(), $matches);
|
||||||
|
if (isset($matches[1])) {
|
||||||
|
$data['AZN'] = [
|
||||||
|
'Buying' => $matches[1],
|
||||||
|
'Selling' => $matches[1],
|
||||||
|
'Change' => "0.00",
|
||||||
|
'Type' => "Currency"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Altın kurları
|
||||||
|
$goldResponse = Http::get('https://altin.doviz.com');
|
||||||
|
// ... Altın kurları için benzer DOM işlemleri ...
|
||||||
|
|
||||||
|
// JSON dosyasını kaydet
|
||||||
|
Storage::put('currency/today.json', json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function virgulToNokta($text)
|
||||||
|
{
|
||||||
|
$text = str_replace(".", "", $text);
|
||||||
|
$text = str_replace(",", ".", $text);
|
||||||
|
$text = str_replace("%", "", $text);
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
|
||||||
|
class User extends Authenticatable
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||||
|
use HasFactory, Notifiable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var list<string>
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'email',
|
||||||
|
'password',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be hidden for serialization.
|
||||||
|
*
|
||||||
|
* @var list<string>
|
||||||
|
*/
|
||||||
|
protected $hidden = [
|
||||||
|
'password',
|
||||||
|
'remember_token',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the attributes that should be cast.
|
||||||
|
*
|
||||||
|
* @return array<string, string>
|
||||||
|
*/
|
||||||
|
protected function casts(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'email_verified_at' => 'datetime',
|
||||||
|
'password' => 'hashed',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register any application services.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap any application services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Cache\RateLimiting\Limit;
|
||||||
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\RateLimiter;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
class RouteServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The path to your application's "home" route.
|
||||||
|
*
|
||||||
|
* Typically, users are redirected here after authentication.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public const HOME = '/home';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define your route model bindings, pattern filters, and other route configuration.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
RateLimiter::for('api', function (Request $request) {
|
||||||
|
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->routes(function () {
|
||||||
|
Route::middleware('api')
|
||||||
|
->prefix('api')
|
||||||
|
->group(base_path('routes/api.php'));
|
||||||
|
|
||||||
|
Route::middleware('web')
|
||||||
|
->group(base_path('routes/web.php'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
|
// Register the Composer autoloader...
|
||||||
|
require __DIR__.'/vendor/autoload.php';
|
||||||
|
|
||||||
|
// Bootstrap Laravel and handle the command...
|
||||||
|
$status = (require_once __DIR__.'/bootstrap/app.php')
|
||||||
|
->handleCommand(new ArgvInput);
|
||||||
|
|
||||||
|
exit($status);
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
|
use Illuminate\Foundation\Configuration\Exceptions;
|
||||||
|
use Illuminate\Foundation\Configuration\Middleware;
|
||||||
|
|
||||||
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
|
->withRouting(
|
||||||
|
web: __DIR__.'/../routes/web.php',
|
||||||
|
commands: __DIR__.'/../routes/console.php',
|
||||||
|
health: '/up',
|
||||||
|
)
|
||||||
|
->withMiddleware(function (Middleware $middleware) {
|
||||||
|
//
|
||||||
|
})
|
||||||
|
->withExceptions(function (Exceptions $exceptions) {
|
||||||
|
//
|
||||||
|
})->create();
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
App\Providers\AppServiceProvider::class,
|
||||||
|
App\Providers\RouteServiceProvider::class,
|
||||||
|
];
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://getcomposer.org/schema.json",
|
||||||
|
"name": "laravel/laravel",
|
||||||
|
"type": "project",
|
||||||
|
"description": "The skeleton application for the Laravel framework.",
|
||||||
|
"keywords": ["laravel", "framework"],
|
||||||
|
"license": "MIT",
|
||||||
|
"require": {
|
||||||
|
"php": "^8.2",
|
||||||
|
"knuckleswtf/scribe": "^4.39",
|
||||||
|
"laravel/framework": "^11.31",
|
||||||
|
"laravel/tinker": "^2.9"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"fakerphp/faker": "^1.23",
|
||||||
|
"laravel/pail": "^1.1",
|
||||||
|
"laravel/pint": "^1.13",
|
||||||
|
"laravel/sail": "^1.26",
|
||||||
|
"mockery/mockery": "^1.6",
|
||||||
|
"nunomaduro/collision": "^8.1",
|
||||||
|
"phpunit/phpunit": "^11.0.1"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"App\\": "app/",
|
||||||
|
"Database\\Factories\\": "database/factories/",
|
||||||
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Tests\\": "tests/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"post-autoload-dump": [
|
||||||
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
|
"@php artisan package:discover --ansi"
|
||||||
|
],
|
||||||
|
"post-update-cmd": [
|
||||||
|
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||||
|
],
|
||||||
|
"post-root-package-install": [
|
||||||
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||||
|
],
|
||||||
|
"post-create-project-cmd": [
|
||||||
|
"@php artisan key:generate --ansi",
|
||||||
|
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
||||||
|
"@php artisan migrate --graceful --ansi"
|
||||||
|
],
|
||||||
|
"dev": [
|
||||||
|
"Composer\\Config::disableProcessTimeout",
|
||||||
|
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"dont-discover": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"preferred-install": "dist",
|
||||||
|
"sort-packages": true,
|
||||||
|
"allow-plugins": {
|
||||||
|
"pestphp/pest-plugin": true,
|
||||||
|
"php-http/discovery": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"prefer-stable": true
|
||||||
|
}
|
||||||
Generated
+8530
File diff suppressed because it is too large
Load Diff
+126
@@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value is the name of your application, which will be used when the
|
||||||
|
| framework needs to place the application's name in a notification or
|
||||||
|
| other UI elements where an application name needs to be displayed.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'name' => env('APP_NAME', 'Laravel'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Environment
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value determines the "environment" your application is currently
|
||||||
|
| running in. This may determine how you prefer to configure various
|
||||||
|
| services the application utilizes. Set this in your ".env" file.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'env' => env('APP_ENV', 'production'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Debug Mode
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When your application is in debug mode, detailed error messages with
|
||||||
|
| stack traces will be shown on every error that occurs within your
|
||||||
|
| application. If disabled, a simple generic error page is shown.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'debug' => (bool) env('APP_DEBUG', false),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application URL
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This URL is used by the console to properly generate URLs when using
|
||||||
|
| the Artisan command line tool. You should set this to the root of
|
||||||
|
| the application so that it's available within Artisan commands.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Timezone
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the default timezone for your application, which
|
||||||
|
| will be used by the PHP date and date-time functions. The timezone
|
||||||
|
| is set to "UTC" by default as it is suitable for most use cases.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'timezone' => env('APP_TIMEZONE', 'UTC'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Locale Configuration
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The application locale determines the default locale that will be used
|
||||||
|
| by Laravel's translation / localization methods. This option can be
|
||||||
|
| set to any locale for which you plan to have translation strings.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'locale' => env('APP_LOCALE', 'en'),
|
||||||
|
|
||||||
|
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
||||||
|
|
||||||
|
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Encryption Key
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This key is utilized by Laravel's encryption services and should be set
|
||||||
|
| to a random, 32 character string to ensure that all encrypted values
|
||||||
|
| are secure. You should do this prior to deploying the application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'cipher' => 'AES-256-CBC',
|
||||||
|
|
||||||
|
'key' => env('APP_KEY'),
|
||||||
|
|
||||||
|
'previous_keys' => [
|
||||||
|
...array_filter(
|
||||||
|
explode(',', env('APP_PREVIOUS_KEYS', ''))
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Maintenance Mode Driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These configuration options determine the driver used to determine and
|
||||||
|
| manage Laravel's "maintenance mode" status. The "cache" driver will
|
||||||
|
| allow maintenance mode to be controlled across multiple machines.
|
||||||
|
|
|
||||||
|
| Supported drivers: "file", "cache"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'maintenance' => [
|
||||||
|
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
|
||||||
|
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
+115
@@ -0,0 +1,115 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Authentication Defaults
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option defines the default authentication "guard" and password
|
||||||
|
| reset "broker" for your application. You may change these values
|
||||||
|
| as required, but they're a perfect start for most applications.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'defaults' => [
|
||||||
|
'guard' => env('AUTH_GUARD', 'web'),
|
||||||
|
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Authentication Guards
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Next, you may define every authentication guard for your application.
|
||||||
|
| Of course, a great default configuration has been defined for you
|
||||||
|
| which utilizes session storage plus the Eloquent user provider.
|
||||||
|
|
|
||||||
|
| All authentication guards have a user provider, which defines how the
|
||||||
|
| users are actually retrieved out of your database or other storage
|
||||||
|
| system used by the application. Typically, Eloquent is utilized.
|
||||||
|
|
|
||||||
|
| Supported: "session"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'guards' => [
|
||||||
|
'web' => [
|
||||||
|
'driver' => 'session',
|
||||||
|
'provider' => 'users',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| User Providers
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| All authentication guards have a user provider, which defines how the
|
||||||
|
| users are actually retrieved out of your database or other storage
|
||||||
|
| system used by the application. Typically, Eloquent is utilized.
|
||||||
|
|
|
||||||
|
| If you have multiple user tables or models you may configure multiple
|
||||||
|
| providers to represent the model / table. These providers may then
|
||||||
|
| be assigned to any extra authentication guards you have defined.
|
||||||
|
|
|
||||||
|
| Supported: "database", "eloquent"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'providers' => [
|
||||||
|
'users' => [
|
||||||
|
'driver' => 'eloquent',
|
||||||
|
'model' => env('AUTH_MODEL', App\Models\User::class),
|
||||||
|
],
|
||||||
|
|
||||||
|
// 'users' => [
|
||||||
|
// 'driver' => 'database',
|
||||||
|
// 'table' => 'users',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Resetting Passwords
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These configuration options specify the behavior of Laravel's password
|
||||||
|
| reset functionality, including the table utilized for token storage
|
||||||
|
| and the user provider that is invoked to actually retrieve users.
|
||||||
|
|
|
||||||
|
| The expiry time is the number of minutes that each reset token will be
|
||||||
|
| considered valid. This security feature keeps tokens short-lived so
|
||||||
|
| they have less time to be guessed. You may change this as needed.
|
||||||
|
|
|
||||||
|
| The throttle setting is the number of seconds a user must wait before
|
||||||
|
| generating more password reset tokens. This prevents the user from
|
||||||
|
| quickly generating a very large amount of password reset tokens.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'passwords' => [
|
||||||
|
'users' => [
|
||||||
|
'provider' => 'users',
|
||||||
|
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
|
||||||
|
'expire' => 60,
|
||||||
|
'throttle' => 60,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Password Confirmation Timeout
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define the amount of seconds before a password confirmation
|
||||||
|
| window expires and users are asked to re-enter their password via the
|
||||||
|
| confirmation screen. By default, the timeout lasts for three hours.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Cache Store
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default cache store that will be used by the
|
||||||
|
| framework. This connection is utilized if another isn't explicitly
|
||||||
|
| specified when running a cache operation inside the application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('CACHE_STORE', 'database'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cache Stores
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define all of the cache "stores" for your application as
|
||||||
|
| well as their drivers. You may even define multiple stores for the
|
||||||
|
| same cache driver to group types of items stored in your caches.
|
||||||
|
|
|
||||||
|
| Supported drivers: "array", "database", "file", "memcached",
|
||||||
|
| "redis", "dynamodb", "octane", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'stores' => [
|
||||||
|
|
||||||
|
'array' => [
|
||||||
|
'driver' => 'array',
|
||||||
|
'serialize' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'database' => [
|
||||||
|
'driver' => 'database',
|
||||||
|
'connection' => env('DB_CACHE_CONNECTION'),
|
||||||
|
'table' => env('DB_CACHE_TABLE', 'cache'),
|
||||||
|
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
|
||||||
|
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'file' => [
|
||||||
|
'driver' => 'file',
|
||||||
|
'path' => storage_path('framework/cache/data'),
|
||||||
|
'lock_path' => storage_path('framework/cache/data'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'memcached' => [
|
||||||
|
'driver' => 'memcached',
|
||||||
|
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||||
|
'sasl' => [
|
||||||
|
env('MEMCACHED_USERNAME'),
|
||||||
|
env('MEMCACHED_PASSWORD'),
|
||||||
|
],
|
||||||
|
'options' => [
|
||||||
|
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||||
|
],
|
||||||
|
'servers' => [
|
||||||
|
[
|
||||||
|
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('MEMCACHED_PORT', 11211),
|
||||||
|
'weight' => 100,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
'driver' => 'redis',
|
||||||
|
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
|
||||||
|
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'dynamodb' => [
|
||||||
|
'driver' => 'dynamodb',
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
|
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||||
|
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'octane' => [
|
||||||
|
'driver' => 'octane',
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cache Key Prefix
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
|
||||||
|
| stores, there might be other applications using the same cache. For
|
||||||
|
| that reason, you may prefix every cache key to avoid collisions.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Database Connection Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify which of the database connections below you wish
|
||||||
|
| to use as your default connection for database operations. This is
|
||||||
|
| the connection which will be utilized unless another connection
|
||||||
|
| is explicitly specified when you execute a query / statement.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('DB_CONNECTION', 'sqlite'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Database Connections
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Below are all of the database connections defined for your application.
|
||||||
|
| An example configuration is provided for each database system which
|
||||||
|
| is supported by Laravel. You're free to add / remove connections.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connections' => [
|
||||||
|
|
||||||
|
'sqlite' => [
|
||||||
|
'driver' => 'sqlite',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||||
|
'prefix' => '',
|
||||||
|
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||||
|
'busy_timeout' => null,
|
||||||
|
'journal_mode' => null,
|
||||||
|
'synchronous' => null,
|
||||||
|
],
|
||||||
|
|
||||||
|
'mysql' => [
|
||||||
|
'driver' => 'mysql',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '3306'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
|
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||||
|
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
'strict' => true,
|
||||||
|
'engine' => null,
|
||||||
|
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||||
|
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||||
|
]) : [],
|
||||||
|
],
|
||||||
|
|
||||||
|
'mariadb' => [
|
||||||
|
'driver' => 'mariadb',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '3306'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
|
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||||
|
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
'strict' => true,
|
||||||
|
'engine' => null,
|
||||||
|
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||||
|
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||||
|
]) : [],
|
||||||
|
],
|
||||||
|
|
||||||
|
'pgsql' => [
|
||||||
|
'driver' => 'pgsql',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '5432'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'charset' => env('DB_CHARSET', 'utf8'),
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
'search_path' => 'public',
|
||||||
|
'sslmode' => 'prefer',
|
||||||
|
],
|
||||||
|
|
||||||
|
'sqlsrv' => [
|
||||||
|
'driver' => 'sqlsrv',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', 'localhost'),
|
||||||
|
'port' => env('DB_PORT', '1433'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'charset' => env('DB_CHARSET', 'utf8'),
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||||
|
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Migration Repository Table
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This table keeps track of all the migrations that have already run for
|
||||||
|
| your application. Using this information, we can determine which of
|
||||||
|
| the migrations on disk haven't actually been run on the database.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'migrations' => [
|
||||||
|
'table' => 'migrations',
|
||||||
|
'update_date_on_publish' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Redis Databases
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Redis is an open source, fast, and advanced key-value store that also
|
||||||
|
| provides a richer body of commands than a typical key-value system
|
||||||
|
| such as Memcached. You may define your connection settings here.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
|
||||||
|
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||||
|
|
||||||
|
'options' => [
|
||||||
|
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||||
|
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'default' => [
|
||||||
|
'url' => env('REDIS_URL'),
|
||||||
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
|
'username' => env('REDIS_USERNAME'),
|
||||||
|
'password' => env('REDIS_PASSWORD'),
|
||||||
|
'port' => env('REDIS_PORT', '6379'),
|
||||||
|
'database' => env('REDIS_DB', '0'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'cache' => [
|
||||||
|
'url' => env('REDIS_URL'),
|
||||||
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
|
'username' => env('REDIS_USERNAME'),
|
||||||
|
'password' => env('REDIS_PASSWORD'),
|
||||||
|
'port' => env('REDIS_PORT', '6379'),
|
||||||
|
'database' => env('REDIS_CACHE_DB', '1'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Filesystem Disk
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the default filesystem disk that should be used
|
||||||
|
| by the framework. The "local" disk, as well as a variety of cloud
|
||||||
|
| based disks are available to your application for file storage.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('FILESYSTEM_DISK', 'local'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filesystem Disks
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Below you may configure as many filesystem disks as necessary, and you
|
||||||
|
| may even configure multiple disks for the same driver. Examples for
|
||||||
|
| most supported storage drivers are configured here for reference.
|
||||||
|
|
|
||||||
|
| Supported drivers: "local", "ftp", "sftp", "s3"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'disks' => [
|
||||||
|
|
||||||
|
'local' => [
|
||||||
|
'driver' => 'local',
|
||||||
|
'root' => storage_path('app/private'),
|
||||||
|
'serve' => true,
|
||||||
|
'throw' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'public' => [
|
||||||
|
'driver' => 'local',
|
||||||
|
'root' => storage_path('app/public'),
|
||||||
|
'url' => env('APP_URL').'/storage',
|
||||||
|
'visibility' => 'public',
|
||||||
|
'throw' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
's3' => [
|
||||||
|
'driver' => 's3',
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION'),
|
||||||
|
'bucket' => env('AWS_BUCKET'),
|
||||||
|
'url' => env('AWS_URL'),
|
||||||
|
'endpoint' => env('AWS_ENDPOINT'),
|
||||||
|
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||||
|
'throw' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Symbolic Links
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the symbolic links that will be created when the
|
||||||
|
| `storage:link` Artisan command is executed. The array keys should be
|
||||||
|
| the locations of the links and the values should be their targets.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'links' => [
|
||||||
|
public_path('storage') => storage_path('app/public'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Monolog\Handler\NullHandler;
|
||||||
|
use Monolog\Handler\StreamHandler;
|
||||||
|
use Monolog\Handler\SyslogUdpHandler;
|
||||||
|
use Monolog\Processor\PsrLogMessageProcessor;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Log Channel
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option defines the default log channel that is utilized to write
|
||||||
|
| messages to your logs. The value provided here should match one of
|
||||||
|
| the channels present in the list of "channels" configured below.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('LOG_CHANNEL', 'stack'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Deprecations Log Channel
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the log channel that should be used to log warnings
|
||||||
|
| regarding deprecated PHP and library features. This allows you to get
|
||||||
|
| your application ready for upcoming major versions of dependencies.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'deprecations' => [
|
||||||
|
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
|
||||||
|
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Log Channels
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the log channels for your application. Laravel
|
||||||
|
| utilizes the Monolog PHP logging library, which includes a variety
|
||||||
|
| of powerful log handlers and formatters that you're free to use.
|
||||||
|
|
|
||||||
|
| Available drivers: "single", "daily", "slack", "syslog",
|
||||||
|
| "errorlog", "monolog", "custom", "stack"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'channels' => [
|
||||||
|
|
||||||
|
'stack' => [
|
||||||
|
'driver' => 'stack',
|
||||||
|
'channels' => explode(',', env('LOG_STACK', 'single')),
|
||||||
|
'ignore_exceptions' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'single' => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'daily' => [
|
||||||
|
'driver' => 'daily',
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'days' => env('LOG_DAILY_DAYS', 14),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'slack' => [
|
||||||
|
'driver' => 'slack',
|
||||||
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
|
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
|
||||||
|
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
|
||||||
|
'level' => env('LOG_LEVEL', 'critical'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'papertrail' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
|
||||||
|
'handler_with' => [
|
||||||
|
'host' => env('PAPERTRAIL_URL'),
|
||||||
|
'port' => env('PAPERTRAIL_PORT'),
|
||||||
|
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
|
||||||
|
],
|
||||||
|
'processors' => [PsrLogMessageProcessor::class],
|
||||||
|
],
|
||||||
|
|
||||||
|
'stderr' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'handler' => StreamHandler::class,
|
||||||
|
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||||
|
'with' => [
|
||||||
|
'stream' => 'php://stderr',
|
||||||
|
],
|
||||||
|
'processors' => [PsrLogMessageProcessor::class],
|
||||||
|
],
|
||||||
|
|
||||||
|
'syslog' => [
|
||||||
|
'driver' => 'syslog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'errorlog' => [
|
||||||
|
'driver' => 'errorlog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'null' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'handler' => NullHandler::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
'emergency' => [
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
+116
@@ -0,0 +1,116 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Mailer
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default mailer that is used to send all email
|
||||||
|
| messages unless another mailer is explicitly specified when sending
|
||||||
|
| the message. All additional mailers can be configured within the
|
||||||
|
| "mailers" array. Examples of each type of mailer are provided.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('MAIL_MAILER', 'log'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Mailer Configurations
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure all of the mailers used by your application plus
|
||||||
|
| their respective settings. Several examples have been configured for
|
||||||
|
| you and you are free to add your own as your application requires.
|
||||||
|
|
|
||||||
|
| Laravel supports a variety of mail "transport" drivers that can be used
|
||||||
|
| when delivering an email. You may specify which one you're using for
|
||||||
|
| your mailers below. You may also add additional mailers if needed.
|
||||||
|
|
|
||||||
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
||||||
|
| "postmark", "resend", "log", "array",
|
||||||
|
| "failover", "roundrobin"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'mailers' => [
|
||||||
|
|
||||||
|
'smtp' => [
|
||||||
|
'transport' => 'smtp',
|
||||||
|
'scheme' => env('MAIL_SCHEME'),
|
||||||
|
'url' => env('MAIL_URL'),
|
||||||
|
'host' => env('MAIL_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('MAIL_PORT', 2525),
|
||||||
|
'username' => env('MAIL_USERNAME'),
|
||||||
|
'password' => env('MAIL_PASSWORD'),
|
||||||
|
'timeout' => null,
|
||||||
|
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
|
||||||
|
],
|
||||||
|
|
||||||
|
'ses' => [
|
||||||
|
'transport' => 'ses',
|
||||||
|
],
|
||||||
|
|
||||||
|
'postmark' => [
|
||||||
|
'transport' => 'postmark',
|
||||||
|
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
|
||||||
|
// 'client' => [
|
||||||
|
// 'timeout' => 5,
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
'resend' => [
|
||||||
|
'transport' => 'resend',
|
||||||
|
],
|
||||||
|
|
||||||
|
'sendmail' => [
|
||||||
|
'transport' => 'sendmail',
|
||||||
|
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'log' => [
|
||||||
|
'transport' => 'log',
|
||||||
|
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'array' => [
|
||||||
|
'transport' => 'array',
|
||||||
|
],
|
||||||
|
|
||||||
|
'failover' => [
|
||||||
|
'transport' => 'failover',
|
||||||
|
'mailers' => [
|
||||||
|
'smtp',
|
||||||
|
'log',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'roundrobin' => [
|
||||||
|
'transport' => 'roundrobin',
|
||||||
|
'mailers' => [
|
||||||
|
'ses',
|
||||||
|
'postmark',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Global "From" Address
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You may wish for all emails sent by your application to be sent from
|
||||||
|
| the same address. Here you may specify a name and address that is
|
||||||
|
| used globally for all emails that are sent by your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'from' => [
|
||||||
|
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||||
|
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Queue Connection Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Laravel's queue supports a variety of backends via a single, unified
|
||||||
|
| API, giving you convenient access to each backend using identical
|
||||||
|
| syntax for each. The default queue connection is defined below.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('QUEUE_CONNECTION', 'database'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Queue Connections
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the connection options for every queue backend
|
||||||
|
| used by your application. An example configuration is provided for
|
||||||
|
| each backend supported by Laravel. You're also free to add more.
|
||||||
|
|
|
||||||
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connections' => [
|
||||||
|
|
||||||
|
'sync' => [
|
||||||
|
'driver' => 'sync',
|
||||||
|
],
|
||||||
|
|
||||||
|
'database' => [
|
||||||
|
'driver' => 'database',
|
||||||
|
'connection' => env('DB_QUEUE_CONNECTION'),
|
||||||
|
'table' => env('DB_QUEUE_TABLE', 'jobs'),
|
||||||
|
'queue' => env('DB_QUEUE', 'default'),
|
||||||
|
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'beanstalkd' => [
|
||||||
|
'driver' => 'beanstalkd',
|
||||||
|
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
|
||||||
|
'queue' => env('BEANSTALKD_QUEUE', 'default'),
|
||||||
|
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
|
||||||
|
'block_for' => 0,
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'sqs' => [
|
||||||
|
'driver' => 'sqs',
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||||
|
'queue' => env('SQS_QUEUE', 'default'),
|
||||||
|
'suffix' => env('SQS_SUFFIX'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
'driver' => 'redis',
|
||||||
|
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
|
||||||
|
'queue' => env('REDIS_QUEUE', 'default'),
|
||||||
|
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
|
||||||
|
'block_for' => null,
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Job Batching
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following options configure the database and table that store job
|
||||||
|
| batching information. These options can be updated to any database
|
||||||
|
| connection and table which has been defined by your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'batching' => [
|
||||||
|
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||||
|
'table' => 'job_batches',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Failed Queue Jobs
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These options configure the behavior of failed queue job logging so you
|
||||||
|
| can control how and where failed jobs are stored. Laravel ships with
|
||||||
|
| support for storing failed jobs in a simple file or in a database.
|
||||||
|
|
|
||||||
|
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'failed' => [
|
||||||
|
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||||
|
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||||
|
'table' => 'failed_jobs',
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Knuckles\Scribe\Extracting\Strategies;
|
||||||
|
|
||||||
|
return [
|
||||||
|
// The HTML <title> for the generated documentation. If this is empty, Scribe will infer it from config('app.name').
|
||||||
|
'title' => null,
|
||||||
|
|
||||||
|
// A short description of your API. Will be included in the docs webpage, Postman collection and OpenAPI spec.
|
||||||
|
'description' => '',
|
||||||
|
|
||||||
|
// The base URL displayed in the docs. If this is empty, Scribe will use the value of config('app.url') at generation time.
|
||||||
|
// If you're using `laravel` type, you can set this to a dynamic string, like '{{ config("app.tenant_url") }}' to get a dynamic base URL.
|
||||||
|
'base_url' => null,
|
||||||
|
|
||||||
|
'routes' => [
|
||||||
|
[
|
||||||
|
// Routes that match these conditions will be included in the docs
|
||||||
|
'match' => [
|
||||||
|
// Match only routes whose paths match this pattern (use * as a wildcard to match any characters). Example: 'users/*'.
|
||||||
|
'prefixes' => ['api/*'],
|
||||||
|
|
||||||
|
// Match only routes whose domains match this pattern (use * as a wildcard to match any characters). Example: 'api.*'.
|
||||||
|
'domains' => ['*'],
|
||||||
|
|
||||||
|
// [Dingo router only] Match only routes registered under this version. Wildcards are NOT supported.
|
||||||
|
'versions' => ['v1'],
|
||||||
|
],
|
||||||
|
|
||||||
|
// Include these routes even if they did not match the rules above.
|
||||||
|
'include' => [
|
||||||
|
// 'users.index', 'POST /new', '/auth/*'
|
||||||
|
],
|
||||||
|
|
||||||
|
// Exclude these routes even if they matched the rules above.
|
||||||
|
'exclude' => [
|
||||||
|
// 'GET /health', 'admin.*'
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
// The type of documentation output to generate.
|
||||||
|
// - "static" will generate a static HTMl page in the /public/docs folder,
|
||||||
|
// - "laravel" will generate the documentation as a Blade view, so you can add routing and authentication.
|
||||||
|
// - "external_static" and "external_laravel" do the same as above, but generate a basic template,
|
||||||
|
// passing the OpenAPI spec as a URL, allowing you to easily use the docs with an external generator
|
||||||
|
'type' => 'static',
|
||||||
|
|
||||||
|
// See https://scribe.knuckles.wtf/laravel/reference/config#theme for supported options
|
||||||
|
'theme' => 'default',
|
||||||
|
|
||||||
|
'static' => [
|
||||||
|
// HTML documentation, assets and Postman collection will be generated to this folder.
|
||||||
|
// Source Markdown will still be in resources/docs.
|
||||||
|
'output_path' => 'public/docs',
|
||||||
|
],
|
||||||
|
|
||||||
|
'laravel' => [
|
||||||
|
// Whether to automatically create a docs endpoint for you to view your generated docs.
|
||||||
|
// If this is false, you can still set up routing manually.
|
||||||
|
'add_routes' => true,
|
||||||
|
|
||||||
|
// URL path to use for the docs endpoint (if `add_routes` is true).
|
||||||
|
// By default, `/docs` opens the HTML page, `/docs.postman` opens the Postman collection, and `/docs.openapi` the OpenAPI spec.
|
||||||
|
'docs_url' => '/docs',
|
||||||
|
|
||||||
|
// Directory within `public` in which to store CSS and JS assets.
|
||||||
|
// By default, assets are stored in `public/vendor/scribe`.
|
||||||
|
// If set, assets will be stored in `public/{{assets_directory}}`
|
||||||
|
'assets_directory' => null,
|
||||||
|
|
||||||
|
// Middleware to attach to the docs endpoint (if `add_routes` is true).
|
||||||
|
'middleware' => [],
|
||||||
|
],
|
||||||
|
|
||||||
|
'external' => [
|
||||||
|
'html_attributes' => []
|
||||||
|
],
|
||||||
|
|
||||||
|
'try_it_out' => [
|
||||||
|
// Add a Try It Out button to your endpoints so consumers can test endpoints right from their browser.
|
||||||
|
// Don't forget to enable CORS headers for your endpoints.
|
||||||
|
'enabled' => true,
|
||||||
|
|
||||||
|
// The base URL for the API tester to use (for example, you can set this to your staging URL).
|
||||||
|
// Leave as null to use the current app URL when generating (config("app.url")).
|
||||||
|
'base_url' => null,
|
||||||
|
|
||||||
|
// [Laravel Sanctum] Fetch a CSRF token before each request, and add it as an X-XSRF-TOKEN header.
|
||||||
|
'use_csrf' => false,
|
||||||
|
|
||||||
|
// The URL to fetch the CSRF token from (if `use_csrf` is true).
|
||||||
|
'csrf_url' => '/sanctum/csrf-cookie',
|
||||||
|
],
|
||||||
|
|
||||||
|
// How is your API authenticated? This information will be used in the displayed docs, generated examples and response calls.
|
||||||
|
'auth' => [
|
||||||
|
// Set this to true if ANY endpoints in your API use authentication.
|
||||||
|
'enabled' => false,
|
||||||
|
|
||||||
|
// Set this to true if your API should be authenticated by default. If so, you must also set `enabled` (above) to true.
|
||||||
|
// You can then use @unauthenticated or @authenticated on individual endpoints to change their status from the default.
|
||||||
|
'default' => false,
|
||||||
|
|
||||||
|
// Where is the auth value meant to be sent in a request?
|
||||||
|
// Options: query, body, basic, bearer, header (for custom header)
|
||||||
|
'in' => 'bearer',
|
||||||
|
|
||||||
|
// The name of the auth parameter (e.g. token, key, apiKey) or header (e.g. Authorization, Api-Key).
|
||||||
|
'name' => 'key',
|
||||||
|
|
||||||
|
// The value of the parameter to be used by Scribe to authenticate response calls.
|
||||||
|
// This will NOT be included in the generated documentation. If empty, Scribe will use a random value.
|
||||||
|
'use_value' => env('SCRIBE_AUTH_KEY'),
|
||||||
|
|
||||||
|
// Placeholder your users will see for the auth parameter in the example requests.
|
||||||
|
// Set this to null if you want Scribe to use a random value as placeholder instead.
|
||||||
|
'placeholder' => '{YOUR_AUTH_KEY}',
|
||||||
|
|
||||||
|
// Any extra authentication-related info for your users. Markdown and HTML are supported.
|
||||||
|
'extra_info' => 'You can retrieve your token by visiting your dashboard and clicking <b>Generate API token</b>.',
|
||||||
|
],
|
||||||
|
|
||||||
|
// Text to place in the "Introduction" section, right after the `description`. Markdown and HTML are supported.
|
||||||
|
'intro_text' => <<<INTRO
|
||||||
|
This documentation aims to provide all the information you need to work with our API.
|
||||||
|
|
||||||
|
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
|
||||||
|
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
|
||||||
|
INTRO
|
||||||
|
,
|
||||||
|
|
||||||
|
// Example requests for each endpoint will be shown in each of these languages.
|
||||||
|
// Supported options are: bash, javascript, php, python
|
||||||
|
// To add a language of your own, see https://scribe.knuckles.wtf/laravel/advanced/example-requests
|
||||||
|
'example_languages' => [
|
||||||
|
'bash',
|
||||||
|
'javascript',
|
||||||
|
],
|
||||||
|
|
||||||
|
// Generate a Postman collection (v2.1.0) in addition to HTML docs.
|
||||||
|
// For 'static' docs, the collection will be generated to public/docs/collection.json.
|
||||||
|
// For 'laravel' docs, it will be generated to storage/app/scribe/collection.json.
|
||||||
|
// Setting `laravel.add_routes` to true (above) will also add a route for the collection.
|
||||||
|
'postman' => [
|
||||||
|
'enabled' => true,
|
||||||
|
|
||||||
|
'overrides' => [
|
||||||
|
// 'info.version' => '2.0.0',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
// Generate an OpenAPI spec (v3.0.1) in addition to docs webpage.
|
||||||
|
// For 'static' docs, the collection will be generated to public/docs/openapi.yaml.
|
||||||
|
// For 'laravel' docs, it will be generated to storage/app/scribe/openapi.yaml.
|
||||||
|
// Setting `laravel.add_routes` to true (above) will also add a route for the spec.
|
||||||
|
'openapi' => [
|
||||||
|
'enabled' => true,
|
||||||
|
|
||||||
|
'overrides' => [
|
||||||
|
// 'info.version' => '2.0.0',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'groups' => [
|
||||||
|
// Endpoints which don't have a @group will be placed in this default group.
|
||||||
|
'default' => 'Endpoints',
|
||||||
|
|
||||||
|
// By default, Scribe will sort groups alphabetically, and endpoints in the order their routes are defined.
|
||||||
|
// You can override this by listing the groups, subgroups and endpoints here in the order you want them.
|
||||||
|
// See https://scribe.knuckles.wtf/blog/laravel-v4#easier-sorting and https://scribe.knuckles.wtf/laravel/reference/config#order for details
|
||||||
|
'order' => [],
|
||||||
|
],
|
||||||
|
|
||||||
|
// Custom logo path. This will be used as the value of the src attribute for the <img> tag,
|
||||||
|
// so make sure it points to an accessible URL or path. Set to false to not use a logo.
|
||||||
|
// For example, if your logo is in public/img:
|
||||||
|
// - 'logo' => '../img/logo.png' // for `static` type (output folder is public/docs)
|
||||||
|
// - 'logo' => 'img/logo.png' // for `laravel` type
|
||||||
|
'logo' => false,
|
||||||
|
|
||||||
|
// Customize the "Last updated" value displayed in the docs by specifying tokens and formats.
|
||||||
|
// Examples:
|
||||||
|
// - {date:F j Y} => March 28, 2022
|
||||||
|
// - {git:short} => Short hash of the last Git commit
|
||||||
|
// Available tokens are `{date:<format>}` and `{git:<format>}`.
|
||||||
|
// The format you pass to `date` will be passed to PHP's `date()` function.
|
||||||
|
// The format you pass to `git` can be either "short" or "long".
|
||||||
|
'last_updated' => 'Last updated: {date:F j, Y}',
|
||||||
|
|
||||||
|
'examples' => [
|
||||||
|
// Set this to any number (e.g. 1234) to generate the same example values for parameters on each run,
|
||||||
|
'faker_seed' => null,
|
||||||
|
|
||||||
|
// With API resources and transformers, Scribe tries to generate example models to use in your API responses.
|
||||||
|
// By default, Scribe will try the model's factory, and if that fails, try fetching the first from the database.
|
||||||
|
// You can reorder or remove strategies here.
|
||||||
|
'models_source' => ['factoryCreate', 'factoryMake', 'databaseFirst'],
|
||||||
|
],
|
||||||
|
|
||||||
|
// The strategies Scribe will use to extract information about your routes at each stage.
|
||||||
|
// If you create or install a custom strategy, add it here.
|
||||||
|
'strategies' => [
|
||||||
|
'metadata' => [
|
||||||
|
Strategies\Metadata\GetFromDocBlocks::class,
|
||||||
|
Strategies\Metadata\GetFromMetadataAttributes::class,
|
||||||
|
],
|
||||||
|
'urlParameters' => [
|
||||||
|
Strategies\UrlParameters\GetFromLaravelAPI::class,
|
||||||
|
Strategies\UrlParameters\GetFromUrlParamAttribute::class,
|
||||||
|
Strategies\UrlParameters\GetFromUrlParamTag::class,
|
||||||
|
],
|
||||||
|
'queryParameters' => [
|
||||||
|
Strategies\QueryParameters\GetFromFormRequest::class,
|
||||||
|
Strategies\QueryParameters\GetFromInlineValidator::class,
|
||||||
|
Strategies\QueryParameters\GetFromQueryParamAttribute::class,
|
||||||
|
Strategies\QueryParameters\GetFromQueryParamTag::class,
|
||||||
|
],
|
||||||
|
'headers' => [
|
||||||
|
Strategies\Headers\GetFromHeaderAttribute::class,
|
||||||
|
Strategies\Headers\GetFromHeaderTag::class,
|
||||||
|
[
|
||||||
|
'override',
|
||||||
|
[
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json',
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'bodyParameters' => [
|
||||||
|
Strategies\BodyParameters\GetFromFormRequest::class,
|
||||||
|
Strategies\BodyParameters\GetFromInlineValidator::class,
|
||||||
|
Strategies\BodyParameters\GetFromBodyParamAttribute::class,
|
||||||
|
Strategies\BodyParameters\GetFromBodyParamTag::class,
|
||||||
|
],
|
||||||
|
'responses' => [
|
||||||
|
Strategies\Responses\UseResponseAttributes::class,
|
||||||
|
Strategies\Responses\UseTransformerTags::class,
|
||||||
|
Strategies\Responses\UseApiResourceTags::class,
|
||||||
|
Strategies\Responses\UseResponseTag::class,
|
||||||
|
Strategies\Responses\UseResponseFileTag::class,
|
||||||
|
[
|
||||||
|
Strategies\Responses\ResponseCalls::class,
|
||||||
|
[
|
||||||
|
'only' => ['GET *'],
|
||||||
|
// Disable debug mode when generating response calls to avoid error stack traces in responses
|
||||||
|
'config' => [
|
||||||
|
'app.debug' => false,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'responseFields' => [
|
||||||
|
Strategies\ResponseFields\GetFromResponseFieldAttribute::class,
|
||||||
|
Strategies\ResponseFields\GetFromResponseFieldTag::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
// For response calls, API resource responses and transformer responses,
|
||||||
|
// Scribe will try to start database transactions, so no changes are persisted to your database.
|
||||||
|
// Tell Scribe which connections should be transacted here. If you only use one db connection, you can leave this as is.
|
||||||
|
'database_connections_to_transact' => [config('database.default')],
|
||||||
|
|
||||||
|
'fractal' => [
|
||||||
|
// If you are using a custom serializer with league/fractal, you can specify it here.
|
||||||
|
'serializer' => null,
|
||||||
|
],
|
||||||
|
|
||||||
|
'routeMatcher' => \Knuckles\Scribe\Matching\RouteMatcher::class,
|
||||||
|
];
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Third Party Services
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This file is for storing the credentials for third party services such
|
||||||
|
| as Mailgun, Postmark, AWS and more. This file provides the de facto
|
||||||
|
| location for this type of information, allowing packages to have
|
||||||
|
| a conventional file to locate the various service credentials.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'postmark' => [
|
||||||
|
'token' => env('POSTMARK_TOKEN'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'ses' => [
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'resend' => [
|
||||||
|
'key' => env('RESEND_KEY'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'slack' => [
|
||||||
|
'notifications' => [
|
||||||
|
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
|
||||||
|
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Session Driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option determines the default session driver that is utilized for
|
||||||
|
| incoming requests. Laravel supports a variety of storage options to
|
||||||
|
| persist session data. Database storage is a great default choice.
|
||||||
|
|
|
||||||
|
| Supported: "file", "cookie", "database", "apc",
|
||||||
|
| "memcached", "redis", "dynamodb", "array"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'driver' => env('SESSION_DRIVER', 'database'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Lifetime
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the number of minutes that you wish the session
|
||||||
|
| to be allowed to remain idle before it expires. If you want them
|
||||||
|
| to expire immediately when the browser is closed then you may
|
||||||
|
| indicate that via the expire_on_close configuration option.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'lifetime' => env('SESSION_LIFETIME', 120),
|
||||||
|
|
||||||
|
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Encryption
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option allows you to easily specify that all of your session data
|
||||||
|
| should be encrypted before it's stored. All encryption is performed
|
||||||
|
| automatically by Laravel and you may use the session like normal.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'encrypt' => env('SESSION_ENCRYPT', false),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session File Location
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When utilizing the "file" session driver, the session files are placed
|
||||||
|
| on disk. The default storage location is defined here; however, you
|
||||||
|
| are free to provide another location where they should be stored.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'files' => storage_path('framework/sessions'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Database Connection
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using the "database" or "redis" session drivers, you may specify a
|
||||||
|
| connection that should be used to manage these sessions. This should
|
||||||
|
| correspond to a connection in your database configuration options.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connection' => env('SESSION_CONNECTION'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Database Table
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using the "database" session driver, you may specify the table to
|
||||||
|
| be used to store sessions. Of course, a sensible default is defined
|
||||||
|
| for you; however, you're welcome to change this to another table.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'table' => env('SESSION_TABLE', 'sessions'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cache Store
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using one of the framework's cache driven session backends, you may
|
||||||
|
| define the cache store which should be used to store the session data
|
||||||
|
| between requests. This must match one of your defined cache stores.
|
||||||
|
|
|
||||||
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'store' => env('SESSION_STORE'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Sweeping Lottery
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Some session drivers must manually sweep their storage location to get
|
||||||
|
| rid of old sessions from storage. Here are the chances that it will
|
||||||
|
| happen on a given request. By default, the odds are 2 out of 100.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'lottery' => [2, 100],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cookie Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may change the name of the session cookie that is created by
|
||||||
|
| the framework. Typically, you should not need to change this value
|
||||||
|
| since doing so does not grant a meaningful security improvement.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'cookie' => env(
|
||||||
|
'SESSION_COOKIE',
|
||||||
|
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
|
||||||
|
),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cookie Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The session cookie path determines the path for which the cookie will
|
||||||
|
| be regarded as available. Typically, this will be the root path of
|
||||||
|
| your application, but you're free to change this when necessary.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'path' => env('SESSION_PATH', '/'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cookie Domain
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value determines the domain and subdomains the session cookie is
|
||||||
|
| available to. By default, the cookie will be available to the root
|
||||||
|
| domain and all subdomains. Typically, this shouldn't be changed.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'domain' => env('SESSION_DOMAIN'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| HTTPS Only Cookies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By setting this option to true, session cookies will only be sent back
|
||||||
|
| to the server if the browser has a HTTPS connection. This will keep
|
||||||
|
| the cookie from being sent to you when it can't be done securely.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| HTTP Access Only
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Setting this value to true will prevent JavaScript from accessing the
|
||||||
|
| value of the cookie and the cookie will only be accessible through
|
||||||
|
| the HTTP protocol. It's unlikely you should disable this option.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'http_only' => env('SESSION_HTTP_ONLY', true),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Same-Site Cookies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option determines how your cookies behave when cross-site requests
|
||||||
|
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||||
|
| will set this value to "lax" to permit secure cross-site requests.
|
||||||
|
|
|
||||||
|
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
||||||
|
|
|
||||||
|
| Supported: "lax", "strict", "none", null
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'same_site' => env('SESSION_SAME_SITE', 'lax'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Partitioned Cookies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Setting this value to true will tie the cookie to the top-level site for
|
||||||
|
| a cross-site context. Partitioned cookies are accepted by the browser
|
||||||
|
| when flagged "secure" and the Same-Site attribute is set to "none".
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
*.sqlite*
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||||
|
*/
|
||||||
|
class UserFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The current password being used by the factory.
|
||||||
|
*/
|
||||||
|
protected static ?string $password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => fake()->name(),
|
||||||
|
'email' => fake()->unique()->safeEmail(),
|
||||||
|
'email_verified_at' => now(),
|
||||||
|
'password' => static::$password ??= Hash::make('password'),
|
||||||
|
'remember_token' => Str::random(10),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicate that the model's email address should be unverified.
|
||||||
|
*/
|
||||||
|
public function unverified(): static
|
||||||
|
{
|
||||||
|
return $this->state(fn (array $attributes) => [
|
||||||
|
'email_verified_at' => null,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('users', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('email')->unique();
|
||||||
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
|
$table->string('password');
|
||||||
|
$table->rememberToken();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||||
|
$table->string('email')->primary();
|
||||||
|
$table->string('token');
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('sessions', function (Blueprint $table) {
|
||||||
|
$table->string('id')->primary();
|
||||||
|
$table->foreignId('user_id')->nullable()->index();
|
||||||
|
$table->string('ip_address', 45)->nullable();
|
||||||
|
$table->text('user_agent')->nullable();
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->integer('last_activity')->index();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('users');
|
||||||
|
Schema::dropIfExists('password_reset_tokens');
|
||||||
|
Schema::dropIfExists('sessions');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('cache', function (Blueprint $table) {
|
||||||
|
$table->string('key')->primary();
|
||||||
|
$table->mediumText('value');
|
||||||
|
$table->integer('expiration');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('cache_locks', function (Blueprint $table) {
|
||||||
|
$table->string('key')->primary();
|
||||||
|
$table->string('owner');
|
||||||
|
$table->integer('expiration');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('cache');
|
||||||
|
Schema::dropIfExists('cache_locks');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('jobs', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('queue')->index();
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->unsignedTinyInteger('attempts');
|
||||||
|
$table->unsignedInteger('reserved_at')->nullable();
|
||||||
|
$table->unsignedInteger('available_at');
|
||||||
|
$table->unsignedInteger('created_at');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('job_batches', function (Blueprint $table) {
|
||||||
|
$table->string('id')->primary();
|
||||||
|
$table->string('name');
|
||||||
|
$table->integer('total_jobs');
|
||||||
|
$table->integer('pending_jobs');
|
||||||
|
$table->integer('failed_jobs');
|
||||||
|
$table->longText('failed_job_ids');
|
||||||
|
$table->mediumText('options')->nullable();
|
||||||
|
$table->integer('cancelled_at')->nullable();
|
||||||
|
$table->integer('created_at');
|
||||||
|
$table->integer('finished_at')->nullable();
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('uuid')->unique();
|
||||||
|
$table->text('connection');
|
||||||
|
$table->text('queue');
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->longText('exception');
|
||||||
|
$table->timestamp('failed_at')->useCurrent();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('jobs');
|
||||||
|
Schema::dropIfExists('job_batches');
|
||||||
|
Schema::dropIfExists('failed_jobs');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class DatabaseSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Seed the application's database.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
// User::factory(10)->create();
|
||||||
|
|
||||||
|
User::factory()->create([
|
||||||
|
'name' => 'Test User',
|
||||||
|
'email' => 'test@example.com',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
"labels" => [
|
||||||
|
"search" => "Search",
|
||||||
|
"base_url" => "Base URL",
|
||||||
|
],
|
||||||
|
|
||||||
|
"auth" => [
|
||||||
|
"none" => "This API is not authenticated.",
|
||||||
|
"instruction" => [
|
||||||
|
"query" => <<<TEXT
|
||||||
|
To authenticate requests, include a query parameter **`:parameterName`** in the request.
|
||||||
|
TEXT,
|
||||||
|
"body" => <<<TEXT
|
||||||
|
To authenticate requests, include a parameter **`:parameterName`** in the body of the request.
|
||||||
|
TEXT,
|
||||||
|
"query_or_body" => <<<TEXT
|
||||||
|
To authenticate requests, include a parameter **`:parameterName`** either in the query string or in the request body.
|
||||||
|
TEXT,
|
||||||
|
"bearer" => <<<TEXT
|
||||||
|
To authenticate requests, include an **`Authorization`** header with the value **`"Bearer :placeholder"`**.
|
||||||
|
TEXT,
|
||||||
|
"basic" => <<<TEXT
|
||||||
|
To authenticate requests, include an **`Authorization`** header in the form **`"Basic {credentials}"`**.
|
||||||
|
The value of `{credentials}` should be your username/id and your password, joined with a colon (:),
|
||||||
|
and then base64-encoded.
|
||||||
|
TEXT,
|
||||||
|
"header" => <<<TEXT
|
||||||
|
To authenticate requests, include a **`:parameterName`** header with the value **`":placeholder"`**.
|
||||||
|
TEXT,
|
||||||
|
],
|
||||||
|
"details" => <<<TEXT
|
||||||
|
All authenticated endpoints are marked with a `requires authentication` badge in the documentation below.
|
||||||
|
TEXT,
|
||||||
|
],
|
||||||
|
|
||||||
|
"headings" => [
|
||||||
|
"introduction" => "Introduction",
|
||||||
|
"auth" => "Authenticating requests",
|
||||||
|
],
|
||||||
|
|
||||||
|
"endpoint" => [
|
||||||
|
"request" => "Request",
|
||||||
|
"headers" => "Headers",
|
||||||
|
"url_parameters" => "URL Parameters",
|
||||||
|
"body_parameters" => "Body Parameters",
|
||||||
|
"query_parameters" => "Query Parameters",
|
||||||
|
"response" => "Response",
|
||||||
|
"response_fields" => "Response Fields",
|
||||||
|
"example_request" => "Example request",
|
||||||
|
"example_response" => "Example response",
|
||||||
|
"responses" => [
|
||||||
|
"binary" => "Binary data",
|
||||||
|
"empty" => "Empty response",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
"try_it_out" => [
|
||||||
|
"open" => "Try it out ⚡",
|
||||||
|
"cancel" => "Cancel 🛑",
|
||||||
|
"send" => "Send Request 💥",
|
||||||
|
"loading" => "⏱ Sending...",
|
||||||
|
"received_response" => "Received response",
|
||||||
|
"request_failed" => "Request failed with error",
|
||||||
|
"error_help" => <<<TEXT
|
||||||
|
Tip: Check that you're properly connected to the network.
|
||||||
|
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
||||||
|
You can check the Dev Tools console for debugging information.
|
||||||
|
TEXT,
|
||||||
|
],
|
||||||
|
|
||||||
|
"links" => [
|
||||||
|
"postman" => "View Postman collection",
|
||||||
|
"openapi" => "View OpenAPI spec",
|
||||||
|
],
|
||||||
|
];
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "vite build",
|
||||||
|
"dev": "vite"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"autoprefixer": "^10.4.20",
|
||||||
|
"axios": "^1.7.4",
|
||||||
|
"concurrently": "^9.0.1",
|
||||||
|
"laravel-vite-plugin": "^1.0",
|
||||||
|
"postcss": "^8.4.47",
|
||||||
|
"tailwindcss": "^3.4.13",
|
||||||
|
"vite": "^6.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||||
|
bootstrap="vendor/autoload.php"
|
||||||
|
colors="true"
|
||||||
|
>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="Unit">
|
||||||
|
<directory>tests/Unit</directory>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="Feature">
|
||||||
|
<directory>tests/Feature</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
<source>
|
||||||
|
<include>
|
||||||
|
<directory>app</directory>
|
||||||
|
</include>
|
||||||
|
</source>
|
||||||
|
<php>
|
||||||
|
<env name="APP_ENV" value="testing"/>
|
||||||
|
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
||||||
|
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||||
|
<env name="CACHE_STORE" value="array"/>
|
||||||
|
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
|
||||||
|
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
|
||||||
|
<env name="MAIL_MAILER" value="array"/>
|
||||||
|
<env name="PULSE_ENABLED" value="false"/>
|
||||||
|
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||||
|
<env name="SESSION_DRIVER" value="array"/>
|
||||||
|
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||||
|
</php>
|
||||||
|
</phpunit>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
<IfModule mod_negotiation.c>
|
||||||
|
Options -MultiViews -Indexes
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# Handle Authorization Header
|
||||||
|
RewriteCond %{HTTP:Authorization} .
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||||
|
|
||||||
|
# Redirect Trailing Slashes If Not A Folder...
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_URI} (.+)/$
|
||||||
|
RewriteRule ^ %1 [L,R=301]
|
||||||
|
|
||||||
|
# Send Requests To Front Controller...
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^ index.php [L]
|
||||||
|
</IfModule>
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,393 @@
|
|||||||
|
/* Copied from https://github.com/slatedocs/slate/blob/c4b4c0b8f83e891ca9fab6bbe9a1a88d5fe41292/stylesheets/print.css and unminified */
|
||||||
|
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: sans-serif;
|
||||||
|
-ms-text-size-adjust: 100%;
|
||||||
|
-webkit-text-size-adjust: 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
details,
|
||||||
|
figcaption,
|
||||||
|
figure,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
hgroup,
|
||||||
|
main,
|
||||||
|
menu,
|
||||||
|
nav,
|
||||||
|
section,
|
||||||
|
summary {
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
|
||||||
|
audio,
|
||||||
|
canvas,
|
||||||
|
progress,
|
||||||
|
video {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: baseline
|
||||||
|
}
|
||||||
|
|
||||||
|
audio:not([controls]) {
|
||||||
|
display: none;
|
||||||
|
height: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
[hidden],
|
||||||
|
template {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
background-color: transparent
|
||||||
|
}
|
||||||
|
|
||||||
|
a:active,
|
||||||
|
a:hover {
|
||||||
|
outline: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: 1px dotted
|
||||||
|
}
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
dfn {
|
||||||
|
font-style: italic
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
margin: 0.67em 0
|
||||||
|
}
|
||||||
|
|
||||||
|
mark {
|
||||||
|
background: #ff0;
|
||||||
|
color: #000
|
||||||
|
}
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%
|
||||||
|
}
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -0.5em
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
svg:not(:root) {
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 1em 40px
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
box-sizing: content-box;
|
||||||
|
height: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
overflow: auto
|
||||||
|
}
|
||||||
|
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
pre,
|
||||||
|
samp {
|
||||||
|
font-family: monospace, monospace;
|
||||||
|
font-size: 1em
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
optgroup,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
color: inherit;
|
||||||
|
font: inherit;
|
||||||
|
margin: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
overflow: visible
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
select {
|
||||||
|
text-transform: none
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
html input[type="button"],
|
||||||
|
input[type="reset"],
|
||||||
|
input[type="submit"] {
|
||||||
|
-webkit-appearance: button;
|
||||||
|
cursor: pointer
|
||||||
|
}
|
||||||
|
|
||||||
|
button[disabled],
|
||||||
|
html input[disabled] {
|
||||||
|
cursor: default
|
||||||
|
}
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
input::-moz-focus-inner {
|
||||||
|
border: 0;
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
line-height: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"],
|
||||||
|
input[type="radio"] {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="number"]::-webkit-inner-spin-button,
|
||||||
|
input[type="number"]::-webkit-outer-spin-button {
|
||||||
|
height: auto
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="search"] {
|
||||||
|
-webkit-appearance: textfield;
|
||||||
|
box-sizing: content-box
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="search"]::-webkit-search-cancel-button,
|
||||||
|
input[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
border: 1px solid #c0c0c0;
|
||||||
|
margin: 0 2px;
|
||||||
|
padding: 0.35em 0.625em 0.75em
|
||||||
|
}
|
||||||
|
|
||||||
|
legend {
|
||||||
|
border: 0;
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto
|
||||||
|
}
|
||||||
|
|
||||||
|
optgroup {
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border-spacing: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
td,
|
||||||
|
th {
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h1,
|
||||||
|
.content h2,
|
||||||
|
.content h3,
|
||||||
|
.content h4,
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
|
font-size: 14px
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h1,
|
||||||
|
.content h2,
|
||||||
|
.content h3,
|
||||||
|
.content h4 {
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre,
|
||||||
|
.content code {
|
||||||
|
font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre,
|
||||||
|
.content code {
|
||||||
|
word-break: break-all;
|
||||||
|
-webkit-hyphens: auto;
|
||||||
|
-ms-hyphens: auto;
|
||||||
|
hyphens: auto
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'slate';
|
||||||
|
src: url(../fonts/slate.eot?-syv14m);
|
||||||
|
src: url(../fonts/slate.eot?#iefix-syv14m) format("embedded-opentype"), url(../fonts/slate.woff2?-syv14m) format("woff2"), url(../fonts/slate.woff?-syv14m) format("woff"), url(../fonts/slate.ttf?-syv14m) format("truetype"), url(../fonts/slate.svg?-syv14m#slate) format("svg");
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
.content aside.warning:before,
|
||||||
|
.content aside.notice:before,
|
||||||
|
.content aside.success:before {
|
||||||
|
font-family: 'slate';
|
||||||
|
speak: none;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
font-variant: normal;
|
||||||
|
text-transform: none;
|
||||||
|
line-height: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
.content aside.warning:before {
|
||||||
|
content: "\e600"
|
||||||
|
}
|
||||||
|
|
||||||
|
.content aside.notice:before {
|
||||||
|
content: "\e602"
|
||||||
|
}
|
||||||
|
|
||||||
|
.content aside.success:before {
|
||||||
|
content: "\e606"
|
||||||
|
}
|
||||||
|
|
||||||
|
.tocify,
|
||||||
|
.toc-footer,
|
||||||
|
.lang-selector,
|
||||||
|
.search,
|
||||||
|
#nav-button {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.tocify-wrapper>img {
|
||||||
|
margin: 0 auto;
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-size: 12px
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre,
|
||||||
|
.content code {
|
||||||
|
border: 1px solid #999;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 0.8em
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre code {
|
||||||
|
border: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre {
|
||||||
|
padding: 1.3em
|
||||||
|
}
|
||||||
|
|
||||||
|
.content code {
|
||||||
|
padding: 0.2em
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table {
|
||||||
|
border: 1px solid #999
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table tr {
|
||||||
|
border-bottom: 1px solid #999
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table td,
|
||||||
|
.content table th {
|
||||||
|
padding: 0.7em
|
||||||
|
}
|
||||||
|
|
||||||
|
.content p {
|
||||||
|
line-height: 1.5
|
||||||
|
}
|
||||||
|
|
||||||
|
.content a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #000
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h1 {
|
||||||
|
font-size: 2.5em;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-bottom: 21px;
|
||||||
|
border: 2px solid #ccc;
|
||||||
|
border-width: 2px 0;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h2 {
|
||||||
|
font-size: 1.8em;
|
||||||
|
margin-top: 2em;
|
||||||
|
border-top: 2px solid #ccc;
|
||||||
|
padding-top: 0.8em
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h1+h2,
|
||||||
|
.content h1+div+h2 {
|
||||||
|
border-top: none;
|
||||||
|
padding-top: 0;
|
||||||
|
margin-top: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h3,
|
||||||
|
.content h4 {
|
||||||
|
font-size: 0.8em;
|
||||||
|
margin-top: 1.5em;
|
||||||
|
margin-bottom: 0.8em;
|
||||||
|
text-transform: uppercase
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h5,
|
||||||
|
.content h6 {
|
||||||
|
text-transform: uppercase
|
||||||
|
}
|
||||||
|
|
||||||
|
.content aside {
|
||||||
|
padding: 1em;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin-top: 1.5em;
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
line-height: 1.6
|
||||||
|
}
|
||||||
|
|
||||||
|
.content aside:before {
|
||||||
|
vertical-align: middle;
|
||||||
|
padding-right: 0.5em;
|
||||||
|
font-size: 14px
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 96 B |
@@ -0,0 +1,656 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
|
<title>Truncgil Finance Documentation</title>
|
||||||
|
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../docs/css/theme-default.style.css" media="screen">
|
||||||
|
<link rel="stylesheet" href="../docs/css/theme-default.print.css" media="print">
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/styles/obsidian.min.css">
|
||||||
|
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/highlight.min.js"></script>
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jets/0.14.1/jets.min.js"></script>
|
||||||
|
|
||||||
|
<style id="language-style">
|
||||||
|
/* starts out as display none and is replaced with js later */
|
||||||
|
body .content .bash-example code { display: none; }
|
||||||
|
body .content .javascript-example code { display: none; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var tryItOutBaseUrl = "http://localhost:8000";
|
||||||
|
var useCsrf = Boolean();
|
||||||
|
var csrfUrl = "/sanctum/csrf-cookie";
|
||||||
|
</script>
|
||||||
|
<script src="../docs/js/tryitout-4.39.0.js"></script>
|
||||||
|
|
||||||
|
<script src="../docs/js/theme-default-4.39.0.js"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body data-languages="["bash","javascript"]">
|
||||||
|
|
||||||
|
<a href="#" id="nav-button">
|
||||||
|
<span>
|
||||||
|
MENU
|
||||||
|
<img src="../docs/images/navbar.png" alt="navbar-image"/>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<div class="tocify-wrapper">
|
||||||
|
|
||||||
|
<div class="lang-selector">
|
||||||
|
<button type="button" class="lang-button" data-language-name="bash">bash</button>
|
||||||
|
<button type="button" class="lang-button" data-language-name="javascript">javascript</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="search">
|
||||||
|
<input type="text" class="search" id="input-search" placeholder="Search">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="toc">
|
||||||
|
<ul id="tocify-header-truncgil-finance" class="tocify-header">
|
||||||
|
<li class="tocify-item level-1" data-unique="truncgil-finance">
|
||||||
|
<a href="#truncgil-finance">Truncgil Finance</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul id="tocify-header-authenticating-requests" class="tocify-header">
|
||||||
|
<li class="tocify-item level-1" data-unique="authenticating-requests">
|
||||||
|
<a href="#authenticating-requests">Authenticating requests</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul id="tocify-header-endpoints" class="tocify-header">
|
||||||
|
<li class="tocify-item level-1" data-unique="endpoints">
|
||||||
|
<a href="#endpoints">Endpoints</a>
|
||||||
|
</li>
|
||||||
|
<ul id="tocify-subheader-endpoints" class="tocify-subheader">
|
||||||
|
<li class="tocify-item level-2" data-unique="endpoints-GETapi-currency-rates">
|
||||||
|
<a href="#endpoints-GETapi-currency-rates">GET api/currency-rates</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="toc-footer" id="toc-footer">
|
||||||
|
<li style="padding-bottom: 5px;"><a href="../docs/collection.json">View Postman collection</a></li>
|
||||||
|
<li style="padding-bottom: 5px;"><a href="../docs/openapi.yaml">View OpenAPI spec</a></li>
|
||||||
|
<li><a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="toc-footer" id="last-updated">
|
||||||
|
<li>Last updated: January 17, 2025</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-wrapper">
|
||||||
|
<div class="dark-box"></div>
|
||||||
|
<div class="content">
|
||||||
|
<h1 id="truncgil-finance">Truncgil Finance</h1>
|
||||||
|
<aside>
|
||||||
|
<strong>Base URL</strong>: <code>http://localhost:8000</code>
|
||||||
|
</aside>
|
||||||
|
<p>This documentation aims to provide all the information you need to work with our API.</p>
|
||||||
|
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
|
||||||
|
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
|
||||||
|
|
||||||
|
<h1 id="authenticating-requests">Authenticating requests</h1>
|
||||||
|
<p>This API is not authenticated.</p>
|
||||||
|
|
||||||
|
<h1 id="endpoints">Endpoints</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="endpoints-GETapi-currency-rates">GET api/currency-rates</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<span id="example-requests-GETapi-currency-rates">
|
||||||
|
<blockquote>Example request:</blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="bash-example">
|
||||||
|
<pre><code class="language-bash">curl --request GET \
|
||||||
|
--get "http://localhost:8000/api/currency-rates" \
|
||||||
|
--header "Content-Type: application/json" \
|
||||||
|
--header "Accept: application/json"</code></pre></div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="javascript-example">
|
||||||
|
<pre><code class="language-javascript">const url = new URL(
|
||||||
|
"http://localhost:8000/api/currency-rates"
|
||||||
|
);
|
||||||
|
|
||||||
|
const headers = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Accept": "application/json",
|
||||||
|
};
|
||||||
|
|
||||||
|
fetch(url, {
|
||||||
|
method: "GET",
|
||||||
|
headers,
|
||||||
|
}).then(response => response.json());</code></pre></div>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span id="example-responses-GETapi-currency-rates">
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response (200):</p>
|
||||||
|
</blockquote>
|
||||||
|
<details class="annotation">
|
||||||
|
<summary style="cursor: pointer;">
|
||||||
|
<small onclick="textContent = parentElement.parentElement.open ? 'Show headers' : 'Hide headers'">Show headers</small>
|
||||||
|
</summary>
|
||||||
|
<pre><code class="language-http">cache-control: no-cache, private
|
||||||
|
content-type: application/json
|
||||||
|
access-control-allow-origin: *
|
||||||
|
</code></pre></details> <pre>
|
||||||
|
|
||||||
|
<code class="language-json" style="max-height: 300px;">{
|
||||||
|
"Update_Date": "2025-01-17 18:33:23",
|
||||||
|
"gram-altin": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "0.24"
|
||||||
|
},
|
||||||
|
"USD": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "0.39",
|
||||||
|
"Buying": "35.5568",
|
||||||
|
"Selling": "35.5729"
|
||||||
|
},
|
||||||
|
"EUR": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "-0.10",
|
||||||
|
"Buying": "36.5659",
|
||||||
|
"Selling": "36.5827"
|
||||||
|
},
|
||||||
|
"GBP": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "-0.26",
|
||||||
|
"Buying": "43.2899",
|
||||||
|
"Selling": "43.3139"
|
||||||
|
},
|
||||||
|
"XU100": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "1.13"
|
||||||
|
},
|
||||||
|
"bitcoin": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "5.18"
|
||||||
|
},
|
||||||
|
"gumus": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "-1.15"
|
||||||
|
},
|
||||||
|
"BRENT": {
|
||||||
|
"Type": "Currency",
|
||||||
|
"Change": "-0.40"
|
||||||
|
},
|
||||||
|
"CHF": {
|
||||||
|
"Buying": "38.8684",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "38.8987",
|
||||||
|
"Change": "0.00"
|
||||||
|
},
|
||||||
|
"CAD": {
|
||||||
|
"Buying": "24.6017",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "24.6179",
|
||||||
|
"Change": "0.01"
|
||||||
|
},
|
||||||
|
"RUB": {
|
||||||
|
"Buying": "0.3469",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.3471",
|
||||||
|
"Change": "1.49"
|
||||||
|
},
|
||||||
|
"AED": {
|
||||||
|
"Buying": "9.6803",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "9.6855",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"AUD": {
|
||||||
|
"Buying": "22.0523",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "22.0694",
|
||||||
|
"Change": "0.29"
|
||||||
|
},
|
||||||
|
"DKK": {
|
||||||
|
"Buying": "4.9006",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "4.9039",
|
||||||
|
"Change": "0.23"
|
||||||
|
},
|
||||||
|
"SEK": {
|
||||||
|
"Buying": "3.1793",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "3.1830",
|
||||||
|
"Change": "0.13"
|
||||||
|
},
|
||||||
|
"NOK": {
|
||||||
|
"Buying": "3.1085",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "3.1113",
|
||||||
|
"Change": "-0.25"
|
||||||
|
},
|
||||||
|
"JPY": {
|
||||||
|
"Buying": 0.2275,
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": 0.2279,
|
||||||
|
"Change": -0.005699999999999999
|
||||||
|
},
|
||||||
|
"KWD": {
|
||||||
|
"Buying": "115.0539",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "115.4686",
|
||||||
|
"Change": "0.30"
|
||||||
|
},
|
||||||
|
"ZAR": {
|
||||||
|
"Buying": "1.8980",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "1.8998",
|
||||||
|
"Change": "0.94"
|
||||||
|
},
|
||||||
|
"BHD": {
|
||||||
|
"Buying": "94.3401",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "94.3829",
|
||||||
|
"Change": "0.40"
|
||||||
|
},
|
||||||
|
"LYD": {
|
||||||
|
"Buying": "7.1896",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "7.1928",
|
||||||
|
"Change": "-1.15"
|
||||||
|
},
|
||||||
|
"SAR": {
|
||||||
|
"Buying": "9.4641",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "9.4934",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"IQD": {
|
||||||
|
"Buying": "0.0271",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0272",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"ILS": {
|
||||||
|
"Buying": "9.9769",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "9.9815",
|
||||||
|
"Change": "1.93"
|
||||||
|
},
|
||||||
|
"IRR": {
|
||||||
|
"Buying": "0.0008",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0008",
|
||||||
|
"Change": "0.00"
|
||||||
|
},
|
||||||
|
"INR": {
|
||||||
|
"Buying": "0.4106",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.4108",
|
||||||
|
"Change": "0.41"
|
||||||
|
},
|
||||||
|
"MXN": {
|
||||||
|
"Buying": "1.7147",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "1.7154",
|
||||||
|
"Change": "0.90"
|
||||||
|
},
|
||||||
|
"HUF": {
|
||||||
|
"Buying": "0.0886",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0886",
|
||||||
|
"Change": "0.21"
|
||||||
|
},
|
||||||
|
"NZD": {
|
||||||
|
"Buying": "19.8808",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "19.8898",
|
||||||
|
"Change": "0.13"
|
||||||
|
},
|
||||||
|
"BRL": {
|
||||||
|
"Buying": "5.8608",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "5.8634",
|
||||||
|
"Change": "0.19"
|
||||||
|
},
|
||||||
|
"IDR": {
|
||||||
|
"Buying": "0.0022",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0022",
|
||||||
|
"Change": "0.42"
|
||||||
|
},
|
||||||
|
"CZK": {
|
||||||
|
"Buying": "1.4472",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "1.4479",
|
||||||
|
"Change": "0.33"
|
||||||
|
},
|
||||||
|
"PLN": {
|
||||||
|
"Buying": "8.5816",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "8.5854",
|
||||||
|
"Change": "0.35"
|
||||||
|
},
|
||||||
|
"RON": {
|
||||||
|
"Buying": "7.3452",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "7.3548",
|
||||||
|
"Change": "0.22"
|
||||||
|
},
|
||||||
|
"CNY": {
|
||||||
|
"Buying": "4.8533",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "4.8568",
|
||||||
|
"Change": "0.49"
|
||||||
|
},
|
||||||
|
"ARS": {
|
||||||
|
"Buying": "0.0341",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0341",
|
||||||
|
"Change": "0.34"
|
||||||
|
},
|
||||||
|
"ALL": {
|
||||||
|
"Buying": "0.3728",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.3730",
|
||||||
|
"Change": "0.47"
|
||||||
|
},
|
||||||
|
"AZN": {
|
||||||
|
"Buying": "20.9158",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "20.9252",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"BAM": {
|
||||||
|
"Buying": "18.7299",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "18.7384",
|
||||||
|
"Change": "-6.31"
|
||||||
|
},
|
||||||
|
"CLP": {
|
||||||
|
"Buying": "0.0353",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0353",
|
||||||
|
"Change": "0.95"
|
||||||
|
},
|
||||||
|
"COP": {
|
||||||
|
"Buying": "0.0082",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0082",
|
||||||
|
"Change": "0.47"
|
||||||
|
},
|
||||||
|
"CRC": {
|
||||||
|
"Buying": "0.0709",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0709",
|
||||||
|
"Change": "0.55"
|
||||||
|
},
|
||||||
|
"DZD": {
|
||||||
|
"Buying": "0.2616",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.2617",
|
||||||
|
"Change": "0.60"
|
||||||
|
},
|
||||||
|
"EGP": {
|
||||||
|
"Buying": "0.7054",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.7058",
|
||||||
|
"Change": "0.38"
|
||||||
|
},
|
||||||
|
"HKD": {
|
||||||
|
"Buying": "4.5675",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "4.5695",
|
||||||
|
"Change": "0.42"
|
||||||
|
},
|
||||||
|
"ISK": {
|
||||||
|
"Buying": "0.2513",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.2515",
|
||||||
|
"Change": "-0.04"
|
||||||
|
},
|
||||||
|
"JOD": {
|
||||||
|
"Buying": "50.1436",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "50.1663",
|
||||||
|
"Change": "0.42"
|
||||||
|
},
|
||||||
|
"KRW": {
|
||||||
|
"Buying": "0.0244",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0244",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"KZT": {
|
||||||
|
"Buying": "0.0670",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0670",
|
||||||
|
"Change": "0.35"
|
||||||
|
},
|
||||||
|
"LBP": {
|
||||||
|
"Buying": "0.0004",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0004",
|
||||||
|
"Change": "0.44"
|
||||||
|
},
|
||||||
|
"LKR": {
|
||||||
|
"Buying": "0.1199",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.1200",
|
||||||
|
"Change": "0.38"
|
||||||
|
},
|
||||||
|
"MAD": {
|
||||||
|
"Buying": "3.5377",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "3.5393",
|
||||||
|
"Change": "0.37"
|
||||||
|
},
|
||||||
|
"MDL": {
|
||||||
|
"Buying": "1.8828",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "1.8837",
|
||||||
|
"Change": "-0.21"
|
||||||
|
},
|
||||||
|
"MKD": {
|
||||||
|
"Buying": "0.5944",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.5947",
|
||||||
|
"Change": "0.27"
|
||||||
|
},
|
||||||
|
"MYR": {
|
||||||
|
"Buying": "7.8910",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "7.8946",
|
||||||
|
"Change": "0.31"
|
||||||
|
},
|
||||||
|
"OMR": {
|
||||||
|
"Buying": "92.3577",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "92.3995",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"PEN": {
|
||||||
|
"Buying": "9.4641",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "9.4684",
|
||||||
|
"Change": "0.41"
|
||||||
|
},
|
||||||
|
"PHP": {
|
||||||
|
"Buying": "0.6083",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.6086",
|
||||||
|
"Change": "0.63"
|
||||||
|
},
|
||||||
|
"PKR": {
|
||||||
|
"Buying": "0.1274",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.1277",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"QAR": {
|
||||||
|
"Buying": "9.7614",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "9.7771",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"RSD": {
|
||||||
|
"Buying": "0.3119",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.3128",
|
||||||
|
"Change": "-0.06"
|
||||||
|
},
|
||||||
|
"SGD": {
|
||||||
|
"Buying": "25.9937",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "26.0055",
|
||||||
|
"Change": "0.31"
|
||||||
|
},
|
||||||
|
"SYP": {
|
||||||
|
"Buying": "0.0027",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.0027",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"THB": {
|
||||||
|
"Buying": "1.0319",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "1.0323",
|
||||||
|
"Change": "0.72"
|
||||||
|
},
|
||||||
|
"TWD": {
|
||||||
|
"Buying": "1.0808",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "1.0812",
|
||||||
|
"Change": "0.51"
|
||||||
|
},
|
||||||
|
"UAH": {
|
||||||
|
"Buying": "0.8428",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.8432",
|
||||||
|
"Change": "0.23"
|
||||||
|
},
|
||||||
|
"UYU": {
|
||||||
|
"Buying": "0.8068",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "0.8072",
|
||||||
|
"Change": "0.23"
|
||||||
|
},
|
||||||
|
"GEL": {
|
||||||
|
"Buying": "12.5200",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "12.5257",
|
||||||
|
"Change": "-3.50"
|
||||||
|
},
|
||||||
|
"TND": {
|
||||||
|
"Buying": "11.0700",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "11.0750",
|
||||||
|
"Change": "0.39"
|
||||||
|
},
|
||||||
|
"BGN": {
|
||||||
|
"Buying": "18.6226",
|
||||||
|
"Type": "Currency",
|
||||||
|
"Selling": "18.7779",
|
||||||
|
"Change": "-0.10"
|
||||||
|
}
|
||||||
|
}</code>
|
||||||
|
</pre>
|
||||||
|
</span>
|
||||||
|
<span id="execution-results-GETapi-currency-rates" hidden>
|
||||||
|
<blockquote>Received response<span
|
||||||
|
id="execution-response-status-GETapi-currency-rates"></span>:
|
||||||
|
</blockquote>
|
||||||
|
<pre class="json"><code id="execution-response-content-GETapi-currency-rates"
|
||||||
|
data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
||||||
|
</span>
|
||||||
|
<span id="execution-error-GETapi-currency-rates" hidden>
|
||||||
|
<blockquote>Request failed with error:</blockquote>
|
||||||
|
<pre><code id="execution-error-message-GETapi-currency-rates">
|
||||||
|
|
||||||
|
Tip: Check that you're properly connected to the network.
|
||||||
|
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
||||||
|
You can check the Dev Tools console for debugging information.</code></pre>
|
||||||
|
</span>
|
||||||
|
<form id="form-GETapi-currency-rates" data-method="GET"
|
||||||
|
data-path="api/currency-rates"
|
||||||
|
data-authed="0"
|
||||||
|
data-hasfiles="0"
|
||||||
|
data-isarraybody="0"
|
||||||
|
autocomplete="off"
|
||||||
|
onsubmit="event.preventDefault(); executeTryOut('GETapi-currency-rates', this);">
|
||||||
|
<h3>
|
||||||
|
Request
|
||||||
|
<button type="button"
|
||||||
|
style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
||||||
|
id="btn-tryout-GETapi-currency-rates"
|
||||||
|
onclick="tryItOut('GETapi-currency-rates');">Try it out ⚡
|
||||||
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
||||||
|
id="btn-canceltryout-GETapi-currency-rates"
|
||||||
|
onclick="cancelTryOut('GETapi-currency-rates');" hidden>Cancel 🛑
|
||||||
|
</button>
|
||||||
|
<button type="submit"
|
||||||
|
style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
||||||
|
id="btn-executetryout-GETapi-currency-rates"
|
||||||
|
data-initial-text="Send Request 💥"
|
||||||
|
data-loading-text="⏱ Sending..."
|
||||||
|
hidden>Send Request 💥
|
||||||
|
</button>
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
<small class="badge badge-green">GET</small>
|
||||||
|
<b><code>api/currency-rates</code></b>
|
||||||
|
</p>
|
||||||
|
<h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
||||||
|
<div style="padding-left: 28px; clear: unset;">
|
||||||
|
<b style="line-height: 2;"><code>Content-Type</code></b>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="text" style="display: none"
|
||||||
|
name="Content-Type" data-endpoint="GETapi-currency-rates"
|
||||||
|
value="application/json"
|
||||||
|
data-component="header">
|
||||||
|
<br>
|
||||||
|
<p>Example: <code>application/json</code></p>
|
||||||
|
</div>
|
||||||
|
<div style="padding-left: 28px; clear: unset;">
|
||||||
|
<b style="line-height: 2;"><code>Accept</code></b>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="text" style="display: none"
|
||||||
|
name="Accept" data-endpoint="GETapi-currency-rates"
|
||||||
|
value="application/json"
|
||||||
|
data-component="header">
|
||||||
|
<br>
|
||||||
|
<p>Example: <code>application/json</code></p>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="dark-box">
|
||||||
|
<div class="lang-selector">
|
||||||
|
<button type="button" class="lang-button" data-language-name="bash">bash</button>
|
||||||
|
<button type="button" class="lang-button" data-language-name="javascript">javascript</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const updateHash = function (id) {
|
||||||
|
window.location.hash = `#${id}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const navButton = document.getElementById('nav-button');
|
||||||
|
const menuWrapper = document.querySelector('.tocify-wrapper');
|
||||||
|
function toggleSidebar(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
if (menuWrapper) {
|
||||||
|
menuWrapper.classList.toggle('open');
|
||||||
|
navButton.classList.toggle('open');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function closeSidebar() {
|
||||||
|
if (menuWrapper) {
|
||||||
|
menuWrapper.classList.remove('open');
|
||||||
|
navButton.classList.remove('open');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
navButton.addEventListener('click', toggleSidebar);
|
||||||
|
|
||||||
|
window.hljs.highlightAll();
|
||||||
|
|
||||||
|
const wrapper = document.getElementById('toc');
|
||||||
|
// https://jets.js.org/
|
||||||
|
window.jets = new window.Jets({
|
||||||
|
// *OR - Selects elements whose values contains at least one part of search substring
|
||||||
|
searchSelector: '*OR',
|
||||||
|
searchTag: '#input-search',
|
||||||
|
contentTag: '#toc li',
|
||||||
|
didSearch: function(term) {
|
||||||
|
wrapper.classList.toggle('jets-searching', String(term).length > 0)
|
||||||
|
},
|
||||||
|
// map these accent keys to plain values
|
||||||
|
diacriticsMap: {
|
||||||
|
a: 'ÀÁÂÃÄÅàáâãäåĀāąĄ',
|
||||||
|
c: 'ÇçćĆčČ',
|
||||||
|
d: 'đĐďĎ',
|
||||||
|
e: 'ÈÉÊËèéêëěĚĒēęĘ',
|
||||||
|
i: 'ÌÍÎÏìíîïĪī',
|
||||||
|
l: 'łŁ',
|
||||||
|
n: 'ÑñňŇńŃ',
|
||||||
|
o: 'ÒÓÔÕÕÖØòóôõöøŌō',
|
||||||
|
r: 'řŘ',
|
||||||
|
s: 'ŠšśŚ',
|
||||||
|
t: 'ťŤ',
|
||||||
|
u: 'ÙÚÛÜùúûüůŮŪū',
|
||||||
|
y: 'ŸÿýÝ',
|
||||||
|
z: 'ŽžżŻźŹ'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function hashChange() {
|
||||||
|
const currentItems = document.querySelectorAll('.tocify-subheader.visible, .tocify-item.tocify-focus');
|
||||||
|
Array.from(currentItems).forEach((elem) => {
|
||||||
|
elem.classList.remove('visible', 'tocify-focus');
|
||||||
|
});
|
||||||
|
|
||||||
|
const currentTag = document.querySelector(`a[href="${window.location.hash}"]`);
|
||||||
|
if (currentTag) {
|
||||||
|
const parent = currentTag.closest('.tocify-subheader');
|
||||||
|
if (parent) {
|
||||||
|
parent.classList.add('visible');
|
||||||
|
}
|
||||||
|
|
||||||
|
const siblings = currentTag.closest('.tocify-header');
|
||||||
|
if (siblings) {
|
||||||
|
Array.from(siblings.querySelectorAll('.tocify-subheader')).forEach((elem) => {
|
||||||
|
elem.classList.add('visible');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
currentTag.parentElement.classList.add('tocify-focus');
|
||||||
|
|
||||||
|
// wait for dom changes to be done
|
||||||
|
setTimeout(() => {
|
||||||
|
currentTag.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
|
||||||
|
// only close the sidebar on level-2 events
|
||||||
|
if (currentTag.parentElement.classList.contains('level-2')) {
|
||||||
|
closeSidebar();
|
||||||
|
}
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let languages = JSON.parse(document.body.getAttribute('data-languages'));
|
||||||
|
// Support a key => value object where the key is the name, or an array of strings where the value is the name
|
||||||
|
if (!Array.isArray(languages)) {
|
||||||
|
languages = Object.values(languages);
|
||||||
|
}
|
||||||
|
// if there is no language use the first one
|
||||||
|
const currentLanguage = window.localStorage.getItem('language') || languages[0];
|
||||||
|
const languageStyle = document.getElementById('language-style');
|
||||||
|
const langSelector = document.querySelectorAll('.lang-selector button.lang-button');
|
||||||
|
|
||||||
|
function setActiveLanguage(newLanguage) {
|
||||||
|
window.localStorage.setItem('language', newLanguage);
|
||||||
|
if (!languageStyle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newStyle = languages.map((language) => {
|
||||||
|
return language === newLanguage
|
||||||
|
// the current one should be visible
|
||||||
|
? `body .content .${language}-example pre { display: block; }`
|
||||||
|
// the inactive one should be hidden
|
||||||
|
: `body .content .${language}-example pre { display: none; }`;
|
||||||
|
}).join(`\n`);
|
||||||
|
|
||||||
|
Array.from(langSelector).forEach((elem) => {
|
||||||
|
elem.classList.toggle('active', elem.getAttribute('data-language-name') === newLanguage);
|
||||||
|
});
|
||||||
|
|
||||||
|
const activeHash = window.location.hash.slice(1);
|
||||||
|
|
||||||
|
languageStyle.innerHTML = newStyle;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
updateHash(activeHash);
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
setActiveLanguage(currentLanguage);
|
||||||
|
|
||||||
|
Array.from(langSelector).forEach((elem) => {
|
||||||
|
elem.addEventListener('click', () => {
|
||||||
|
const newLanguage = elem.getAttribute('data-language-name');
|
||||||
|
setActiveLanguage(newLanguage);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('hashchange', hashChange, false);
|
||||||
|
|
||||||
|
const divs = document.querySelectorAll('.content h1[id], .content h2[id]');
|
||||||
|
|
||||||
|
document.addEventListener('scroll', () => {
|
||||||
|
divs.forEach(item => {
|
||||||
|
const rect = item.getBoundingClientRect();
|
||||||
|
if (rect.top > 0 && rect.top < 150) {
|
||||||
|
const location = window.location.toString().split('#')[0];
|
||||||
|
history.replaceState(null, null, location + '#' + item.id);
|
||||||
|
hashChange();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
hashChange();
|
||||||
|
});
|
||||||
@@ -0,0 +1,289 @@
|
|||||||
|
window.abortControllers = {};
|
||||||
|
|
||||||
|
function cacheAuthValue() {
|
||||||
|
// Whenever the auth header is set for one endpoint, cache it for the others
|
||||||
|
window.lastAuthValue = '';
|
||||||
|
let authInputs = document.querySelectorAll(`.auth-value`)
|
||||||
|
authInputs.forEach(el => {
|
||||||
|
el.addEventListener('input', (event) => {
|
||||||
|
window.lastAuthValue = event.target.value;
|
||||||
|
authInputs.forEach(otherInput => {
|
||||||
|
if (otherInput === el) return;
|
||||||
|
// Don't block the main thread
|
||||||
|
setTimeout(() => {
|
||||||
|
otherInput.value = window.lastAuthValue;
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('DOMContentLoaded', cacheAuthValue);
|
||||||
|
|
||||||
|
function getCookie(name) {
|
||||||
|
if (!document.cookie) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cookies = document.cookie.split(';')
|
||||||
|
.map(c => c.trim())
|
||||||
|
.filter(c => c.startsWith(name + '='));
|
||||||
|
|
||||||
|
if (cookies.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return decodeURIComponent(cookies[0].split('=')[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function tryItOut(endpointId) {
|
||||||
|
document.querySelector(`#btn-tryout-${endpointId}`).hidden = true;
|
||||||
|
document.querySelector(`#btn-canceltryout-${endpointId}`).hidden = false;
|
||||||
|
const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`).hidden = false;
|
||||||
|
executeBtn.disabled = false;
|
||||||
|
|
||||||
|
// Show all input fields
|
||||||
|
document.querySelectorAll(`input[data-endpoint=${endpointId}],label[data-endpoint=${endpointId}]`)
|
||||||
|
.forEach(el => el.style.display = 'block');
|
||||||
|
|
||||||
|
if (document.querySelector(`#form-${endpointId}`).dataset.authed === "1") {
|
||||||
|
const authElement = document.querySelector(`#auth-${endpointId}`);
|
||||||
|
authElement && (authElement.hidden = false);
|
||||||
|
}
|
||||||
|
// Expand all nested fields
|
||||||
|
document.querySelectorAll(`#form-${endpointId} details`)
|
||||||
|
.forEach(el => el.open = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancelTryOut(endpointId) {
|
||||||
|
if (window.abortControllers[endpointId]) {
|
||||||
|
window.abortControllers[endpointId].abort();
|
||||||
|
delete window.abortControllers[endpointId];
|
||||||
|
}
|
||||||
|
|
||||||
|
document.querySelector(`#btn-tryout-${endpointId}`).hidden = false;
|
||||||
|
const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`);
|
||||||
|
executeBtn.hidden = true;
|
||||||
|
executeBtn.textContent = executeBtn.dataset.initialText;
|
||||||
|
document.querySelector(`#btn-canceltryout-${endpointId}`).hidden = true;
|
||||||
|
// Hide inputs
|
||||||
|
document.querySelectorAll(`input[data-endpoint=${endpointId}],label[data-endpoint=${endpointId}]`)
|
||||||
|
.forEach(el => el.style.display = 'none');
|
||||||
|
document.querySelectorAll(`#form-${endpointId} details`)
|
||||||
|
.forEach(el => el.open = false);
|
||||||
|
const authElement = document.querySelector(`#auth-${endpointId}`);
|
||||||
|
authElement && (authElement.hidden = true);
|
||||||
|
|
||||||
|
document.querySelector('#execution-results-' + endpointId).hidden = true;
|
||||||
|
document.querySelector('#execution-error-' + endpointId).hidden = true;
|
||||||
|
|
||||||
|
// Revert to sample code blocks
|
||||||
|
document.querySelector('#example-requests-' + endpointId).hidden = false;
|
||||||
|
document.querySelector('#example-responses-' + endpointId).hidden = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeAPICall(method, path, body = {}, query = {}, headers = {}, endpointId = null) {
|
||||||
|
console.log({endpointId, path, body, query, headers});
|
||||||
|
|
||||||
|
if (!(body instanceof FormData) && typeof body !== "string") {
|
||||||
|
body = JSON.stringify(body)
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = new URL(window.tryItOutBaseUrl + '/' + path.replace(/^\//, ''));
|
||||||
|
|
||||||
|
// We need this function because if you try to set an array or object directly to a URLSearchParams object,
|
||||||
|
// you'll get [object Object] or the array.toString()
|
||||||
|
function addItemToSearchParamsObject(key, value, searchParams) {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.forEach((v, i) => {
|
||||||
|
// Append {filters: [first, second]} as filters[0]=first&filters[1]second
|
||||||
|
addItemToSearchParamsObject(key + '[' + i + ']', v, searchParams);
|
||||||
|
})
|
||||||
|
} else if (typeof value === 'object' && value !== null) {
|
||||||
|
Object.keys(value).forEach((i) => {
|
||||||
|
// Append {filters: {name: first}} as filters[name]=first
|
||||||
|
addItemToSearchParamsObject(key + '[' + i + ']', value[i], searchParams);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
searchParams.append(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.keys(query)
|
||||||
|
.forEach(key => addItemToSearchParamsObject(key, query[key], url.searchParams));
|
||||||
|
|
||||||
|
window.abortControllers[endpointId] = new AbortController();
|
||||||
|
|
||||||
|
return fetch(url, {
|
||||||
|
method,
|
||||||
|
headers,
|
||||||
|
body: method === 'GET' ? undefined : body,
|
||||||
|
signal: window.abortControllers[endpointId].signal,
|
||||||
|
referrer: window.tryItOutBaseUrl,
|
||||||
|
mode: 'cors',
|
||||||
|
credentials: 'same-origin',
|
||||||
|
})
|
||||||
|
.then(response => Promise.all([response.status, response.statusText, response.text(), response.headers]));
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideCodeSamples(endpointId) {
|
||||||
|
document.querySelector('#example-requests-' + endpointId).hidden = true;
|
||||||
|
document.querySelector('#example-responses-' + endpointId).hidden = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleResponse(endpointId, response, status, headers) {
|
||||||
|
hideCodeSamples(endpointId);
|
||||||
|
|
||||||
|
// Hide error views
|
||||||
|
document.querySelector('#execution-error-' + endpointId).hidden = true;
|
||||||
|
|
||||||
|
const responseContentEl = document.querySelector('#execution-response-content-' + endpointId);
|
||||||
|
|
||||||
|
// Check if the response contains Laravel's dd() default dump output
|
||||||
|
const isLaravelDump = response.includes('Sfdump');
|
||||||
|
|
||||||
|
// If it's a Laravel dd() dump, use innerHTML to render it safely
|
||||||
|
if (isLaravelDump) {
|
||||||
|
responseContentEl.innerHTML = response === '' ? responseContentEl.dataset.emptyResponseText : response;
|
||||||
|
} else {
|
||||||
|
// Otherwise, stick to textContent for regular responses
|
||||||
|
responseContentEl.textContent = response === '' ? responseContentEl.dataset.emptyResponseText : response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prettify it if it's JSON
|
||||||
|
let isJson = false;
|
||||||
|
try {
|
||||||
|
const jsonParsed = JSON.parse(response);
|
||||||
|
if (jsonParsed !== null) {
|
||||||
|
isJson = true;
|
||||||
|
response = JSON.stringify(jsonParsed, null, 4);
|
||||||
|
responseContentEl.textContent = response;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
isJson && window.hljs.highlightElement(responseContentEl);
|
||||||
|
const statusEl = document.querySelector('#execution-response-status-' + endpointId);
|
||||||
|
statusEl.textContent = ` (${status})`;
|
||||||
|
document.querySelector('#execution-results-' + endpointId).hidden = false;
|
||||||
|
statusEl.scrollIntoView({behavior: "smooth", block: "center"});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleError(endpointId, err) {
|
||||||
|
hideCodeSamples(endpointId);
|
||||||
|
// Hide response views
|
||||||
|
document.querySelector('#execution-results-' + endpointId).hidden = true;
|
||||||
|
|
||||||
|
// Show error views
|
||||||
|
let errorMessage = err.message || err;
|
||||||
|
const $errorMessageEl = document.querySelector('#execution-error-message-' + endpointId);
|
||||||
|
$errorMessageEl.textContent = errorMessage + $errorMessageEl.textContent;
|
||||||
|
const errorEl = document.querySelector('#execution-error-' + endpointId);
|
||||||
|
errorEl.hidden = false;
|
||||||
|
errorEl.scrollIntoView({behavior: "smooth", block: "center"});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async function executeTryOut(endpointId, form) {
|
||||||
|
const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`);
|
||||||
|
executeBtn.textContent = executeBtn.dataset.loadingText;
|
||||||
|
executeBtn.disabled = true;
|
||||||
|
executeBtn.scrollIntoView({behavior: "smooth", block: "center"});
|
||||||
|
|
||||||
|
let body;
|
||||||
|
let setter;
|
||||||
|
if (form.dataset.hasfiles === "1") {
|
||||||
|
body = new FormData();
|
||||||
|
setter = (name, value) => body.append(name, value);
|
||||||
|
} else if (form.dataset.isarraybody === "1") {
|
||||||
|
body = [];
|
||||||
|
setter = (name, value) => _.set(body, name, value);
|
||||||
|
} else {
|
||||||
|
body = {};
|
||||||
|
setter = (name, value) => _.set(body, name, value);
|
||||||
|
}
|
||||||
|
const bodyParameters = form.querySelectorAll('input[data-component=body]');
|
||||||
|
bodyParameters.forEach(el => {
|
||||||
|
let value = el.value;
|
||||||
|
|
||||||
|
if (el.type === 'number' && typeof value === 'string') {
|
||||||
|
value = parseFloat(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (el.type === 'file' && el.files[0]) {
|
||||||
|
setter(el.name, el.files[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (el.type !== 'radio') {
|
||||||
|
if (value === "" && el.required === false) {
|
||||||
|
// Don't include empty optional values in the request
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setter(el.name, value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (el.checked) {
|
||||||
|
value = (value === 'false') ? false : true;
|
||||||
|
setter(el.name, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const query = {};
|
||||||
|
const queryParameters = form.querySelectorAll('input[data-component=query]');
|
||||||
|
queryParameters.forEach(el => {
|
||||||
|
if (el.type !== 'radio' || (el.type === 'radio' && el.checked)) {
|
||||||
|
if (el.value === '') {
|
||||||
|
// Don't include empty values in the request
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_.set(query, el.name, el.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let path = form.dataset.path;
|
||||||
|
const urlParameters = form.querySelectorAll('input[data-component=url]');
|
||||||
|
urlParameters.forEach(el => (path = path.replace(new RegExp(`\\{${el.name}\\??}`), el.value)));
|
||||||
|
|
||||||
|
const headers = Object.fromEntries(Array.from(form.querySelectorAll('input[data-component=header]'))
|
||||||
|
.map(el => [el.name, el.value]));
|
||||||
|
|
||||||
|
// When using FormData, the browser sets the correct content-type + boundary
|
||||||
|
let method = form.dataset.method;
|
||||||
|
if (body instanceof FormData) {
|
||||||
|
delete headers['Content-Type'];
|
||||||
|
|
||||||
|
// When using FormData with PUT or PATCH, use method spoofing so PHP can access the post body
|
||||||
|
if (['PUT', 'PATCH'].includes(form.dataset.method)) {
|
||||||
|
method = 'POST';
|
||||||
|
setter('_method', form.dataset.method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let preflightPromise = Promise.resolve();
|
||||||
|
if (window.useCsrf && window.csrfUrl) {
|
||||||
|
preflightPromise = makeAPICall('GET', window.csrfUrl).then(() => {
|
||||||
|
headers['X-XSRF-TOKEN'] = getCookie('XSRF-TOKEN');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return preflightPromise.then(() => makeAPICall(method, path, body, query, headers, endpointId))
|
||||||
|
.then(([responseStatus, statusText, responseContent, responseHeaders]) => {
|
||||||
|
handleResponse(endpointId, responseContent, responseStatus, responseHeaders)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
if (err.name === "AbortError") {
|
||||||
|
console.log("Request cancelled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("Error while making request: ", err);
|
||||||
|
handleError(endpointId, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
executeBtn.disabled = false;
|
||||||
|
executeBtn.textContent = executeBtn.dataset.initialText;
|
||||||
|
});
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
|
// Determine if the application is in maintenance mode...
|
||||||
|
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
||||||
|
require $maintenance;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register the Composer autoloader...
|
||||||
|
require __DIR__.'/../vendor/autoload.php';
|
||||||
|
|
||||||
|
// Bootstrap Laravel and handle the request...
|
||||||
|
(require_once __DIR__.'/../bootstrap/app.php')
|
||||||
|
->handleRequest(Request::capture());
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import './bootstrap';
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
window.axios = axios;
|
||||||
|
|
||||||
|
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@if($authenticated)@component('scribe::components.badges.base', ['colour' => "darkred", 'text' => 'requires authentication'])
|
||||||
|
@endcomponent
|
||||||
|
@endif
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<small class="badge badge-{{ $colour }}">{{ $text }}</small>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
@component('scribe::components.badges.base', [
|
||||||
|
'colour' => \Knuckles\Scribe\Tools\WritingUtils::$httpMethodToCssColour[$method],
|
||||||
|
'text' => $method,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
@php
|
||||||
|
$html ??= []; $class = $html['class'] ?? null;
|
||||||
|
@endphp
|
||||||
|
<b style="line-height: 2;"><code>{{ $name }}</code></b>
|
||||||
|
@if($type)<small>{{ $type }}</small>@endif
|
||||||
|
@if($isInput && !$required)<i>optional</i>@endif
|
||||||
|
@if($isInput && empty($hasChildren))
|
||||||
|
@php
|
||||||
|
$isList = Str::endsWith($type, '[]');
|
||||||
|
$fullName = str_replace('[]', '.0', $fullName ?? $name);
|
||||||
|
$baseType = $isList ? substr($type, 0, -2) : $type;
|
||||||
|
// Ignore the first '[]': the frontend will take care of it
|
||||||
|
while (\Str::endsWith($baseType, '[]')) {
|
||||||
|
$fullName .= '.0';
|
||||||
|
$baseType = substr($baseType, 0, -2);
|
||||||
|
}
|
||||||
|
// When the body is an array, the item names will be ".0.thing"
|
||||||
|
$fullName = ltrim($fullName, '.');
|
||||||
|
$inputType = match($baseType) {
|
||||||
|
'number', 'integer' => 'number',
|
||||||
|
'file' => 'file',
|
||||||
|
default => 'text',
|
||||||
|
};
|
||||||
|
@endphp
|
||||||
|
@if($type === 'boolean')
|
||||||
|
<label data-endpoint="{{ $endpointId }}" style="display: none">
|
||||||
|
<input type="radio" name="{{ $fullName }}"
|
||||||
|
value="{{$component === 'body' ? 'true' : 1}}"
|
||||||
|
data-endpoint="{{ $endpointId }}"
|
||||||
|
data-component="{{ $component }}" @if($class)class="{{ $class }}"@endif
|
||||||
|
>
|
||||||
|
<code>true</code>
|
||||||
|
</label>
|
||||||
|
<label data-endpoint="{{ $endpointId }}" style="display: none">
|
||||||
|
<input type="radio" name="{{ $fullName }}"
|
||||||
|
value="{{$component === 'body' ? 'false' : 0}}"
|
||||||
|
data-endpoint="{{ $endpointId }}"
|
||||||
|
data-component="{{ $component }}" @if($class)class="{{ $class }}"@endif
|
||||||
|
>
|
||||||
|
<code>false</code>
|
||||||
|
</label>
|
||||||
|
@elseif($isList)
|
||||||
|
<input type="{{ $inputType }}" style="display: none"
|
||||||
|
@if($inputType === 'number')step="any"@endif
|
||||||
|
name="{{ $fullName."[0]" }}" @if($class)class="{{ $class }}"@endif
|
||||||
|
data-endpoint="{{ $endpointId }}"
|
||||||
|
data-component="{{ $component }}">
|
||||||
|
<input type="{{ $inputType }}" style="display: none"
|
||||||
|
name="{{ $fullName."[1]" }}" @if($class)class="{{ $class }}"@endif
|
||||||
|
data-endpoint="{{ $endpointId }}"
|
||||||
|
data-component="{{ $component }}">
|
||||||
|
@else
|
||||||
|
<input type="{{ $inputType }}" style="display: none"
|
||||||
|
@if($inputType === 'number')step="any"@endif
|
||||||
|
name="{{ $fullName }}" @if($class)class="{{ $class }}"@endif
|
||||||
|
data-endpoint="{{ $endpointId }}"
|
||||||
|
value="{!! (isset($example) && (is_string($example) || is_numeric($example))) ? $example : '' !!}"
|
||||||
|
data-component="{{ $component }}">
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
<br>
|
||||||
|
@php
|
||||||
|
if($example !== null && $example !== '' && !is_array($example)) {
|
||||||
|
$exampleAsString = $example;
|
||||||
|
if (is_bool($example)) {
|
||||||
|
$exampleAsString = $example ? "true" : "false";
|
||||||
|
}
|
||||||
|
$description .= " Example: `$exampleAsString`";
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
{!! Parsedown::instance()->text(trim($description)) !!}
|
||||||
|
@if(!empty($enumValues))
|
||||||
|
Must be one of:
|
||||||
|
<ul style="list-style-type: square;">{!! implode(" ", array_map(fn($val) => "<li><code>$val</code></li>", $enumValues)) !!}</ul>
|
||||||
|
@endif
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
@php
|
||||||
|
$isInput ??= true;
|
||||||
|
$level ??= 0;
|
||||||
|
@endphp
|
||||||
|
@foreach($fields as $name => $field)
|
||||||
|
@if($name === '[]')
|
||||||
|
@php
|
||||||
|
$description = "The request body is an array (<code>{$field['type']}</code>`)";
|
||||||
|
$description .= !empty($field['description']) ? ", representing ".lcfirst($field['description'])."." : '.';
|
||||||
|
if(count($field['__fields'])) $description .= " Each item has the following properties:";
|
||||||
|
@endphp
|
||||||
|
{!! Parsedown::instance()->text($description) !!}
|
||||||
|
|
||||||
|
@foreach($field['__fields'] as $subfieldName => $subfield)
|
||||||
|
@if(!empty($subfield['__fields']))
|
||||||
|
<x-scribe::nested-fields
|
||||||
|
:fields="[$subfieldName => $subfield]" :endpointId="$endpointId" :isInput="$isInput" :level="$level + 2"
|
||||||
|
/>
|
||||||
|
@else
|
||||||
|
<div style="margin-left: {{ ($level + 2) * 14 }}px; clear: unset;">
|
||||||
|
@component('scribe::components.field-details', [
|
||||||
|
'name' => $subfieldName,
|
||||||
|
'fullName' => $subfield['name'],
|
||||||
|
'type' => $subfield['type'] ?? 'string',
|
||||||
|
'required' => $subfield['required'] ?? false,
|
||||||
|
'description' => $subfield['description'] ?? '',
|
||||||
|
'example' => $subfield['example'] ?? '',
|
||||||
|
'enumValues' => $subfield['enumValues'] ?? null,
|
||||||
|
'endpointId' => $endpointId,
|
||||||
|
'hasChildren' => false,
|
||||||
|
'component' => 'body',
|
||||||
|
'isInput' => $isInput,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@elseif(!empty($field['__fields']))
|
||||||
|
<div style="@if($level) margin-left: {{ $level * 14 }}px;@else padding-left: 28px; @endif clear: unset;">
|
||||||
|
<details>
|
||||||
|
<summary style="padding-bottom: 10px;">
|
||||||
|
@component('scribe::components.field-details', [
|
||||||
|
'name' => $name,
|
||||||
|
'fullName' => $field['name'],
|
||||||
|
'type' => $field['type'] ?? 'string',
|
||||||
|
'required' => $field['required'] ?? false,
|
||||||
|
'description' => $field['description'] ?? '',
|
||||||
|
'example' => $field['example'] ?? '',
|
||||||
|
'enumValues' => $field['enumValues'] ?? null,
|
||||||
|
'endpointId' => $endpointId,
|
||||||
|
'hasChildren' => true,
|
||||||
|
'component' => 'body',
|
||||||
|
'isInput' => $isInput,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</summary>
|
||||||
|
@foreach($field['__fields'] as $subfieldName => $subfield)
|
||||||
|
@if(!empty($subfield['__fields']))
|
||||||
|
<x-scribe::nested-fields
|
||||||
|
:fields="[$subfieldName => $subfield]" :endpointId="$endpointId" :isInput="$isInput" :level="$level + 1"
|
||||||
|
/>
|
||||||
|
@else
|
||||||
|
<div style="margin-left: {{ ($level + 1) * 14 }}px; clear: unset;">
|
||||||
|
@component('scribe::components.field-details', [
|
||||||
|
'name' => $subfieldName,
|
||||||
|
'fullName' => $subfield['name'],
|
||||||
|
'type' => $subfield['type'] ?? 'string',
|
||||||
|
'required' => $subfield['required'] ?? false,
|
||||||
|
'description' => $subfield['description'] ?? '',
|
||||||
|
'example' => $subfield['example'] ?? '',
|
||||||
|
'enumValues' => $subfield['enumValues'] ?? null,
|
||||||
|
'endpointId' => $endpointId,
|
||||||
|
'hasChildren' => false,
|
||||||
|
'component' => 'body',
|
||||||
|
'isInput' => $isInput,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div style="@if($level) margin-left: {{ ($level + 1) * 14 }}px;@else padding-left: 28px; @endif clear: unset;">
|
||||||
|
@component('scribe::components.field-details', [
|
||||||
|
'name' => $name,
|
||||||
|
'fullName' => $field['name'],
|
||||||
|
'type' => $field['type'] ?? 'string',
|
||||||
|
'required' => $field['required'] ?? false,
|
||||||
|
'description' => $field['description'] ?? '',
|
||||||
|
'example' => $field['example'] ?? '',
|
||||||
|
'enumValues' => $field['enumValues'] ?? null,
|
||||||
|
'endpointId' => $endpointId,
|
||||||
|
'hasChildren' => false,
|
||||||
|
'component' => 'body',
|
||||||
|
'isInput' => $isInput,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<!-- See https://github.com/stoplightio/elements/blob/main/docs/getting-started/elements/elements-options.md for config -->
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<title>{!! $metadata['title'] !!}</title>
|
||||||
|
<!-- Embed elements Elements via Web Component -->
|
||||||
|
<script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<elements-api
|
||||||
|
@foreach($htmlAttributes as $attribute => $value)
|
||||||
|
{{-- Attributes specified first override later ones --}}
|
||||||
|
{!! $attribute !!}="{!! $value !!}"
|
||||||
|
@endforeach
|
||||||
|
apiDescriptionUrl="{!! $metadata['openapi_spec_url'] !!}"
|
||||||
|
router="hash"
|
||||||
|
layout="sidebar"
|
||||||
|
hideTryIt="{!! ($tryItOut['enabled'] ?? true) ? '' : 'true'!!}"
|
||||||
|
@if(!empty($metadata['logo']))
|
||||||
|
logo="{!! $metadata['logo'] !!}"
|
||||||
|
@endif
|
||||||
|
/>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<!-- See https://rapidocweb.com/api.html for options -->
|
||||||
|
<!doctype html> <!-- Important: must specify -->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
|
||||||
|
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<rapi-doc
|
||||||
|
@foreach($htmlAttributes as $attribute => $value)
|
||||||
|
{{-- Attributes specified first override later ones --}}
|
||||||
|
{!! $attribute !!}="{!! $value !!}"
|
||||||
|
@endforeach
|
||||||
|
spec-url="{!! $metadata['openapi_spec_url'] !!}"
|
||||||
|
render-style="read"
|
||||||
|
allow-try="{!! ($tryItOut['enabled'] ?? true) ? 'true' : 'false'!!}"
|
||||||
|
>
|
||||||
|
@if($metadata['logo'])
|
||||||
|
<img slot="logo" src="{!! $metadata['logo'] !!}"/>
|
||||||
|
@endif
|
||||||
|
</rapi-doc>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>{!! $metadata['title'] !!}</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="width=device-width, initial-scale=1"/>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<script
|
||||||
|
id="api-reference"
|
||||||
|
@foreach($htmlAttributes as $attribute => $value)
|
||||||
|
{{-- Attributes specified first override later ones --}}
|
||||||
|
{!! $attribute !!}="{!! $value !!}"
|
||||||
|
@endforeach
|
||||||
|
data-url="{!! $metadata['openapi_spec_url'] !!}">
|
||||||
|
</script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\Utils as u;
|
||||||
|
@endphp
|
||||||
|
# {{ u::trans("scribe::headings.auth") }}
|
||||||
|
|
||||||
|
@if(!$isAuthed)
|
||||||
|
{!! u::trans("scribe::auth.none") !!}
|
||||||
|
@else
|
||||||
|
{!! $authDescription !!}
|
||||||
|
|
||||||
|
{!! $extraAuthInfo !!}
|
||||||
|
@endif
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\Utils as u;
|
||||||
|
@endphp
|
||||||
|
# {{ u::trans("scribe::headings.introduction") }}
|
||||||
|
|
||||||
|
{!! $description !!}
|
||||||
|
|
||||||
|
<aside>
|
||||||
|
<strong>{{ u::trans("scribe::labels.base_url") }}</strong>: <code>{!! $baseUrl !!}</code>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
{!! $introText !!}
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\WritingUtils as u;
|
||||||
|
/** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */
|
||||||
|
@endphp
|
||||||
|
```bash
|
||||||
|
curl --request {{$endpoint->httpMethods[0]}} \
|
||||||
|
{{$endpoint->httpMethods[0] == 'GET' ? '--get ' : ''}}"{!! rtrim($baseUrl, '/') !!}/{{ ltrim($endpoint->boundUri, '/') }}@if(count($endpoint->cleanQueryParameters))?{!! u::printQueryParamsAsString($endpoint->cleanQueryParameters) !!}@endif"@if(count($endpoint->headers)) \
|
||||||
|
@foreach($endpoint->headers as $header => $value)
|
||||||
|
--header "{{$header}}: {{ addslashes($value) }}"@if(! ($loop->last) || ($loop->last && count($endpoint->bodyParameters))) \
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
@if($endpoint->hasFiles() || (isset($endpoint->headers['Content-Type']) && $endpoint->headers['Content-Type'] == 'multipart/form-data' && count($endpoint->cleanBodyParameters)))
|
||||||
|
@foreach($endpoint->cleanBodyParameters as $parameter => $value)
|
||||||
|
@foreach(u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $actualValue)
|
||||||
|
--form "{!! "$key=".$actualValue !!}"@if(!($loop->parent->last) || count($endpoint->fileParameters))\
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@foreach($endpoint->fileParameters as $parameter => $value)
|
||||||
|
@foreach(u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $file)
|
||||||
|
--form "{!! "$key=@".$file->path() !!}" @if(!($loop->parent->last))\
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@elseif(count($endpoint->cleanBodyParameters))
|
||||||
|
@if ($endpoint->headers['Content-Type'] == 'application/x-www-form-urlencoded')
|
||||||
|
--data "{!! http_build_query($endpoint->cleanBodyParameters, '', '&') !!}"
|
||||||
|
@else
|
||||||
|
--data "{!! addslashes(json_encode($endpoint->cleanBodyParameters, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)) !!}"
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
|
```
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\WritingUtils as u;
|
||||||
|
/** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */
|
||||||
|
@endphp
|
||||||
|
```javascript
|
||||||
|
const url = new URL(
|
||||||
|
"{!! rtrim($baseUrl, '/') !!}/{{ ltrim($endpoint->boundUri, '/') }}"
|
||||||
|
);
|
||||||
|
@if(count($endpoint->cleanQueryParameters))
|
||||||
|
|
||||||
|
const params = {!! u::printQueryParamsAsKeyValue($endpoint->cleanQueryParameters, "\"", ":", 4, "{}") !!};
|
||||||
|
Object.keys(params)
|
||||||
|
.forEach(key => url.searchParams.append(key, params[key]));
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(!empty($endpoint->headers))
|
||||||
|
const headers = {
|
||||||
|
@foreach($endpoint->headers as $header => $value)
|
||||||
|
"{{$header}}": "{{$value}}",
|
||||||
|
@endforeach
|
||||||
|
@empty($endpoint->headers['Accept'])
|
||||||
|
"Accept": "application/json",
|
||||||
|
@endempty
|
||||||
|
};
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($endpoint->hasFiles() || (isset($endpoint->headers['Content-Type']) && $endpoint->headers['Content-Type'] == 'multipart/form-data' && count($endpoint->cleanBodyParameters)))
|
||||||
|
const body = new FormData();
|
||||||
|
@foreach($endpoint->cleanBodyParameters as $parameter => $value)
|
||||||
|
@foreach( u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $actualValue)
|
||||||
|
body.append('{!! $key !!}', '{!! $actualValue !!}');
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@foreach($endpoint->fileParameters as $parameter => $value)
|
||||||
|
@foreach( u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $file)
|
||||||
|
body.append('{!! $key !!}', document.querySelector('input[name="{!! $key !!}"]').files[0]);
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@elseif(count($endpoint->cleanBodyParameters))
|
||||||
|
@if ($endpoint->headers['Content-Type'] == 'application/x-www-form-urlencoded')
|
||||||
|
let body = "{!! http_build_query($endpoint->cleanBodyParameters, '', '&') !!}";
|
||||||
|
@else
|
||||||
|
let body = {!! json_encode($endpoint->cleanBodyParameters, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!};
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
|
fetch(url, {
|
||||||
|
method: "{{$endpoint->httpMethods[0]}}",
|
||||||
|
@if(count($endpoint->headers))
|
||||||
|
headers,
|
||||||
|
@endif
|
||||||
|
@if($endpoint->hasFiles() || (isset($endpoint->headers['Content-Type']) && $endpoint->headers['Content-Type'] == 'multipart/form-data' && count($endpoint->cleanBodyParameters)))
|
||||||
|
body,
|
||||||
|
@elseif(count($endpoint->cleanBodyParameters))
|
||||||
|
@if ($endpoint->headers['Content-Type'] == 'application/x-www-form-urlencoded')
|
||||||
|
body,
|
||||||
|
@else
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
}).then(response => response.json());
|
||||||
|
```
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\WritingUtils as u;
|
||||||
|
/** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */
|
||||||
|
@endphp
|
||||||
|
```php
|
||||||
|
$client = new \GuzzleHttp\Client();
|
||||||
|
$url = '{!! rtrim($baseUrl, '/') . '/' . ltrim($endpoint->boundUri, '/') !!}';
|
||||||
|
@if($endpoint->hasHeadersOrQueryOrBodyParams())
|
||||||
|
$response = $client->{{ strtolower($endpoint->httpMethods[0]) }}(
|
||||||
|
$url,
|
||||||
|
[
|
||||||
|
@if(!empty($endpoint->headers))
|
||||||
|
'headers' => {!! u::printPhpValue($endpoint->headers, 8) !!},
|
||||||
|
@endif
|
||||||
|
@if(!empty($endpoint->cleanQueryParameters))
|
||||||
|
'query' => {!! u::printQueryParamsAsKeyValue($endpoint->cleanQueryParameters, "'", " =>", 12, "[]", 8) !!},
|
||||||
|
@endif
|
||||||
|
@if($endpoint->hasFiles() || (isset($endpoint->headers['Content-Type']) && $endpoint->headers['Content-Type'] == 'multipart/form-data' && !empty($endpoint->cleanBodyParameters)))
|
||||||
|
'multipart' => [
|
||||||
|
@foreach($endpoint->cleanBodyParameters as $parameter => $value)
|
||||||
|
@foreach(u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $actualValue)
|
||||||
|
[
|
||||||
|
'name' => '{!! $key !!}',
|
||||||
|
'contents' => '{!! $actualValue !!}'
|
||||||
|
],
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@foreach($endpoint->fileParameters as $parameter => $value)
|
||||||
|
@foreach(u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $file)
|
||||||
|
[
|
||||||
|
'name' => '{!! $key !!}',
|
||||||
|
'contents' => fopen('{!! $file->path() !!}', 'r')
|
||||||
|
],
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
],
|
||||||
|
@elseif(count($endpoint->cleanBodyParameters))
|
||||||
|
@if ($endpoint->headers['Content-Type'] == 'application/x-www-form-urlencoded')
|
||||||
|
'form_params' => {!! u::printPhpValue($endpoint->cleanBodyParameters, 8) !!},
|
||||||
|
@else
|
||||||
|
'json' => {!! u::printPhpValue($endpoint->cleanBodyParameters, 8) !!},
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
]
|
||||||
|
);
|
||||||
|
@else
|
||||||
|
$response = $client->{{ strtolower($endpoint->httpMethods[0]) }}($url);
|
||||||
|
@endif
|
||||||
|
$body = $response->getBody();
|
||||||
|
print_r(json_decode((string) $body));
|
||||||
|
```
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\WritingUtils as u;
|
||||||
|
/** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */
|
||||||
|
@endphp
|
||||||
|
```python
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
|
||||||
|
url = '{!! rtrim($baseUrl, '/') !!}/{{ $endpoint->boundUri }}'
|
||||||
|
@if($endpoint->hasFiles() || (isset($endpoint->headers['Content-Type']) && $endpoint->headers['Content-Type'] == 'multipart/form-data' && count($endpoint->cleanBodyParameters)))
|
||||||
|
files = {
|
||||||
|
@foreach($endpoint->cleanBodyParameters as $parameter => $value)
|
||||||
|
@foreach(u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $actualValue)
|
||||||
|
'{!! $key !!}': (None, '{!! $actualValue !!}')@if(!($loop->parent->last) || count($endpoint->fileParameters)),
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@foreach($endpoint->fileParameters as $parameter => $value)
|
||||||
|
@foreach(u::getParameterNamesAndValuesForFormData($parameter, $value) as $key => $file)
|
||||||
|
'{!! $key !!}': open('{!! $file->path() !!}', 'rb')@if(!($loop->parent->last)),
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
}
|
||||||
|
@endif
|
||||||
|
@if(count($endpoint->cleanBodyParameters))
|
||||||
|
payload = {!! json_encode($endpoint->cleanBodyParameters, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!}
|
||||||
|
@endif
|
||||||
|
@if(count($endpoint->cleanQueryParameters))
|
||||||
|
params = {!! u::printQueryParamsAsKeyValue($endpoint->cleanQueryParameters, "'", ":", 2, "{}") !!}
|
||||||
|
@endif
|
||||||
|
@if(!empty($endpoint->headers))
|
||||||
|
headers = {
|
||||||
|
@foreach($endpoint->headers as $header => $value)
|
||||||
|
'{{$header}}': '{{$value}}'@if(!($loop->last)),
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@endif
|
||||||
|
@php
|
||||||
|
$optionalArguments = [];
|
||||||
|
if (count($endpoint->headers)) $optionalArguments[] = "headers=headers";
|
||||||
|
if (count($endpoint->fileParameters)) $optionalArguments[] = "files=files";
|
||||||
|
if (count($endpoint->cleanBodyParameters) && $endpoint->headers['Content-Type'] != 'multipart/form-data') $optionalArguments[] = (count($endpoint->fileParameters) || $endpoint->headers['Content-Type'] == 'application/x-www-form-urlencoded' ? "data=payload" : "json=payload");
|
||||||
|
if (count($endpoint->cleanQueryParameters)) $optionalArguments[] = "params=params";
|
||||||
|
$optionalArguments = implode(', ',$optionalArguments);
|
||||||
|
@endphp
|
||||||
|
response = requests.request('{{$endpoint->httpMethods[0]}}', url, {{ $optionalArguments }})
|
||||||
|
response.json()
|
||||||
|
```
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\Utils as u;
|
||||||
|
/** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<h2 id="{!! $endpoint->fullSlug() !!}">{{ $endpoint->name() }}</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
@component('scribe::components.badges.auth', ['authenticated' => $endpoint->isAuthed()])
|
||||||
|
@endcomponent
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{!! Parsedown::instance()->text($endpoint->metadata->description ?: '') !!}
|
||||||
|
|
||||||
|
<span id="example-requests-{!! $endpoint->endpointId() !!}">
|
||||||
|
<blockquote>{{ u::trans("scribe::endpoint.example_request") }}:</blockquote>
|
||||||
|
|
||||||
|
@foreach($metadata['example_languages'] as $language)
|
||||||
|
|
||||||
|
<div class="{{ $language }}-example">
|
||||||
|
@include("scribe::partials.example-requests.$language")
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span id="example-responses-{!! $endpoint->endpointId() !!}">
|
||||||
|
@if($endpoint->isGet() || $endpoint->hasResponses())
|
||||||
|
@foreach($endpoint->responses as $response)
|
||||||
|
<blockquote>
|
||||||
|
<p>{{ u::trans("scribe::endpoint.example_response") }} ({{ $response->fullDescription() }}):</p>
|
||||||
|
</blockquote>
|
||||||
|
@if(count($response->headers))
|
||||||
|
<details class="annotation">
|
||||||
|
<summary style="cursor: pointer;">
|
||||||
|
<small onclick="textContent = parentElement.parentElement.open ? 'Show headers' : 'Hide headers'">Show headers</small>
|
||||||
|
</summary>
|
||||||
|
<pre><code class="language-http">@foreach($response->headers as $header => $value)
|
||||||
|
{{ $header }}: {{ is_array($value) ? implode('; ', $value) : $value }}
|
||||||
|
@endforeach </code></pre></details> @endif
|
||||||
|
<pre>
|
||||||
|
@if(is_string($response->content) && Str::startsWith($response->content, "<<binary>>"))
|
||||||
|
<code>{!! u::trans("scribe::endpoint.responses.binary") !!} - {{ htmlentities(str_replace("<<binary>>", "", $response->content)) }}</code>
|
||||||
|
@elseif($response->status == 204)
|
||||||
|
<code>{!! u::trans("scribe::endpoint.responses.empty") !!}</code>
|
||||||
|
@else
|
||||||
|
@php($parsed = json_decode($response->content))
|
||||||
|
{{-- If response is a JSON string, prettify it. Otherwise, just print it --}}
|
||||||
|
<code class="language-json" style="max-height: 300px;">{!! htmlentities($parsed != null ? json_encode($parsed, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : $response->content) !!}</code>
|
||||||
|
@endif </pre>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</span>
|
||||||
|
<span id="execution-results-{{ $endpoint->endpointId() }}" hidden>
|
||||||
|
<blockquote>{{ u::trans("scribe::try_it_out.received_response") }}<span
|
||||||
|
id="execution-response-status-{{ $endpoint->endpointId() }}"></span>:
|
||||||
|
</blockquote>
|
||||||
|
<pre class="json"><code id="execution-response-content-{{ $endpoint->endpointId() }}"
|
||||||
|
data-empty-response-text="<{{ u::trans("scribe::endpoint.responses.empty") }}>" style="max-height: 400px;"></code></pre>
|
||||||
|
</span>
|
||||||
|
<span id="execution-error-{{ $endpoint->endpointId() }}" hidden>
|
||||||
|
<blockquote>{{ u::trans("scribe::try_it_out.request_failed") }}:</blockquote>
|
||||||
|
<pre><code id="execution-error-message-{{ $endpoint->endpointId() }}">{{ "\n\n".u::trans("scribe::try_it_out.error_help") }}</code></pre>
|
||||||
|
</span>
|
||||||
|
<form id="form-{{ $endpoint->endpointId() }}" data-method="{{ $endpoint->httpMethods[0] }}"
|
||||||
|
data-path="{{ $endpoint->uri }}"
|
||||||
|
data-authed="{{ $endpoint->isAuthed() ? 1 : 0 }}"
|
||||||
|
data-hasfiles="{{ $endpoint->hasFiles() ? 1 : 0 }}"
|
||||||
|
data-isarraybody="{{ $endpoint->isArrayBody() ? 1 : 0 }}"
|
||||||
|
autocomplete="off"
|
||||||
|
onsubmit="event.preventDefault(); executeTryOut('{{ $endpoint->endpointId() }}', this);">
|
||||||
|
<h3>
|
||||||
|
{{ u::trans("scribe::endpoint.request") }}
|
||||||
|
@if($metadata['try_it_out']['enabled'] ?? false)
|
||||||
|
<button type="button"
|
||||||
|
style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
||||||
|
id="btn-tryout-{{ $endpoint->endpointId() }}"
|
||||||
|
onclick="tryItOut('{{ $endpoint->endpointId() }}');">{{ u::trans("scribe::try_it_out.open") }}
|
||||||
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
||||||
|
id="btn-canceltryout-{{ $endpoint->endpointId() }}"
|
||||||
|
onclick="cancelTryOut('{{ $endpoint->endpointId() }}');" hidden>{{ u::trans("scribe::try_it_out.cancel") }}
|
||||||
|
</button>
|
||||||
|
<button type="submit"
|
||||||
|
style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
||||||
|
id="btn-executetryout-{{ $endpoint->endpointId() }}"
|
||||||
|
data-initial-text="{{ u::trans("scribe::try_it_out.send") }}"
|
||||||
|
data-loading-text="{{ u::trans("scribe::try_it_out.loading") }}"
|
||||||
|
hidden>{{ u::trans("scribe::try_it_out.send") }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
</h3>
|
||||||
|
@foreach($endpoint->httpMethods as $method)
|
||||||
|
<p>
|
||||||
|
@component('scribe::components.badges.http-method', ['method' => $method])@endcomponent
|
||||||
|
<b><code>{{$endpoint->uri}}</code></b>
|
||||||
|
</p>
|
||||||
|
@endforeach
|
||||||
|
@if(count($endpoint->headers))
|
||||||
|
<h4 class="fancy-heading-panel"><b>{{ u::trans("scribe::endpoint.headers") }}</b></h4>
|
||||||
|
@foreach($endpoint->headers as $name => $example)
|
||||||
|
<?php
|
||||||
|
$htmlOptions = [];
|
||||||
|
if ($endpoint->isAuthed() && $metadata['auth']['location'] == 'header' && $metadata['auth']['name'] == $name) {
|
||||||
|
$htmlOptions = [ 'class' => 'auth-value', ];
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div style="padding-left: 28px; clear: unset;">
|
||||||
|
@component('scribe::components.field-details', [
|
||||||
|
'name' => $name,
|
||||||
|
'type' => null,
|
||||||
|
'required' => true,
|
||||||
|
'description' => null,
|
||||||
|
'example' => $example,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
'component' => 'header',
|
||||||
|
'isInput' => true,
|
||||||
|
'html' => $htmlOptions,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
@if(count($endpoint->urlParameters))
|
||||||
|
<h4 class="fancy-heading-panel"><b>{{ u::trans("scribe::endpoint.url_parameters") }}</b></h4>
|
||||||
|
@foreach($endpoint->urlParameters as $attribute => $parameter)
|
||||||
|
<div style="padding-left: 28px; clear: unset;">
|
||||||
|
@component('scribe::components.field-details', [
|
||||||
|
'name' => $parameter->name,
|
||||||
|
'type' => $parameter->type ?? 'string',
|
||||||
|
'required' => $parameter->required,
|
||||||
|
'description' => $parameter->description,
|
||||||
|
'example' => $parameter->example ?? '',
|
||||||
|
'enumValues' => $parameter->enumValues,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
'component' => 'url',
|
||||||
|
'isInput' => true,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
@if(count($endpoint->queryParameters))
|
||||||
|
<h4 class="fancy-heading-panel"><b>{{ u::trans("scribe::endpoint.query_parameters") }}</b></h4>
|
||||||
|
@foreach($endpoint->queryParameters as $attribute => $parameter)
|
||||||
|
<?php
|
||||||
|
$htmlOptions = [];
|
||||||
|
if ($endpoint->isAuthed() && $metadata['auth']['location'] == 'query' && $metadata['auth']['name'] == $attribute) {
|
||||||
|
$htmlOptions = [ 'class' => 'auth-value', ];
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div style="padding-left: 28px; clear: unset;">
|
||||||
|
@component('scribe::components.field-details', [
|
||||||
|
'name' => $parameter->name,
|
||||||
|
'type' => $parameter->type,
|
||||||
|
'required' => $parameter->required,
|
||||||
|
'description' => $parameter->description,
|
||||||
|
'example' => $parameter->example ?? '',
|
||||||
|
'enumValues' => $parameter->enumValues,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
'component' => 'query',
|
||||||
|
'isInput' => true,
|
||||||
|
'html' => $htmlOptions,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
@if(count($endpoint->nestedBodyParameters))
|
||||||
|
<h4 class="fancy-heading-panel"><b>{{ u::trans("scribe::endpoint.body_parameters") }}</b></h4>
|
||||||
|
<x-scribe::nested-fields
|
||||||
|
:fields="$endpoint->nestedBodyParameters" :endpointId="$endpoint->endpointId()"
|
||||||
|
/>
|
||||||
|
@endif
|
||||||
|
</form>
|
||||||
|
|
||||||
|
@if(count($endpoint->responseFields))
|
||||||
|
<h3>{{ u::trans("scribe::endpoint.response") }}</h3>
|
||||||
|
<h4 class="fancy-heading-panel"><b>{{ u::trans("scribe::endpoint.response_fields") }}</b></h4>
|
||||||
|
<x-scribe::nested-fields
|
||||||
|
:fields="$endpoint->nestedResponseFields" :endpointId="$endpoint->endpointId()"
|
||||||
|
:isInput="false"
|
||||||
|
/>
|
||||||
|
@endif
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
@foreach($groupedEndpoints as $group)
|
||||||
|
<h1 id="{!! Str::slug($group['name']) !!}">{!! $group['name'] !!}</h1>
|
||||||
|
|
||||||
|
{!! Parsedown::instance()->text($group['description']) !!}
|
||||||
|
|
||||||
|
@foreach($group['subgroups'] as $subgroupName => $subgroup)
|
||||||
|
@if($subgroupName !== "")
|
||||||
|
<h2 id="{!! Str::slug($group['name']) !!}-{!! Str::slug($subgroupName) !!}">{{ $subgroupName }}</h2>
|
||||||
|
@php($subgroupDescription = collect($subgroup)->first(fn ($e) => $e->metadata->subgroupDescription)?->metadata?->subgroupDescription)
|
||||||
|
@if($subgroupDescription)
|
||||||
|
<p>
|
||||||
|
{!! Parsedown::instance()->text($subgroupDescription) !!}
|
||||||
|
</p>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
@foreach($subgroup as $endpoint)
|
||||||
|
@include("scribe::themes.default.endpoint")
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\WritingUtils as u;
|
||||||
|
@endphp
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
|
<title>{!! $metadata['title'] !!}</title>
|
||||||
|
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="{!! $assetPathPrefix !!}css/theme-default.style.css" media="screen">
|
||||||
|
<link rel="stylesheet" href="{!! $assetPathPrefix !!}css/theme-default.print.css" media="print">
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/styles/obsidian.min.css">
|
||||||
|
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/highlight.min.js"></script>
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jets/0.14.1/jets.min.js"></script>
|
||||||
|
|
||||||
|
@if(isset($metadata['example_languages']))
|
||||||
|
<style id="language-style">
|
||||||
|
/* starts out as display none and is replaced with js later */
|
||||||
|
@foreach($metadata['example_languages'] as $lang)
|
||||||
|
body .content .{{ $lang }}-example code { display: none; }
|
||||||
|
@endforeach
|
||||||
|
</style>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($tryItOut['enabled'] ?? true)
|
||||||
|
<script>
|
||||||
|
var tryItOutBaseUrl = "{!! $tryItOut['base_url'] ?? config('app.url') !!}";
|
||||||
|
var useCsrf = Boolean({!! $tryItOut['use_csrf'] ?? null !!});
|
||||||
|
var csrfUrl = "{!! $tryItOut['csrf_url'] ?? null !!}";
|
||||||
|
</script>
|
||||||
|
<script src="{{ u::getVersionedAsset($assetPathPrefix.'js/tryitout.js') }}"></script>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<script src="{{ u::getVersionedAsset($assetPathPrefix.'js/theme-default.js') }}"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body data-languages="{{ json_encode($metadata['example_languages'] ?? []) }}">
|
||||||
|
|
||||||
|
@include("scribe::themes.default.sidebar")
|
||||||
|
|
||||||
|
<div class="page-wrapper">
|
||||||
|
<div class="dark-box"></div>
|
||||||
|
<div class="content">
|
||||||
|
{!! $intro !!}
|
||||||
|
|
||||||
|
{!! $auth !!}
|
||||||
|
|
||||||
|
@include("scribe::themes.default.groups")
|
||||||
|
|
||||||
|
{!! $append !!}
|
||||||
|
</div>
|
||||||
|
<div class="dark-box">
|
||||||
|
@if(isset($metadata['example_languages']))
|
||||||
|
<div class="lang-selector">
|
||||||
|
@foreach($metadata['example_languages'] as $name => $lang)
|
||||||
|
@php if (is_numeric($name)) $name = $lang; @endphp
|
||||||
|
<button type="button" class="lang-button" data-language-name="{{$lang}}">{{$name}}</button>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\Utils as u;
|
||||||
|
@endphp
|
||||||
|
<a href="#" id="nav-button">
|
||||||
|
<span>
|
||||||
|
MENU
|
||||||
|
<img src="{!! $assetPathPrefix !!}images/navbar.png" alt="navbar-image"/>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<div class="tocify-wrapper">
|
||||||
|
@if($metadata['logo'] != false)
|
||||||
|
<img src="{{ $metadata['logo'] }}" alt="logo" class="logo" style="padding-top: 10px;" width="100%"/>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@isset($metadata['example_languages'])
|
||||||
|
<div class="lang-selector">
|
||||||
|
@foreach($metadata['example_languages'] as $name => $lang)
|
||||||
|
@php if (is_numeric($name)) $name = $lang; @endphp
|
||||||
|
<button type="button" class="lang-button" data-language-name="{{ $lang }}">{{ $name }}</button>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endisset
|
||||||
|
|
||||||
|
<div class="search">
|
||||||
|
<input type="text" class="search" id="input-search" placeholder="{{ u::trans("scribe::labels.search") }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="toc">
|
||||||
|
@foreach($headings as $h1)
|
||||||
|
<ul id="tocify-header-{{ $h1['slug'] }}" class="tocify-header">
|
||||||
|
<li class="tocify-item level-1" data-unique="{!! $h1['slug'] !!}">
|
||||||
|
<a href="#{!! $h1['slug'] !!}">{!! $h1['name'] !!}</a>
|
||||||
|
</li>
|
||||||
|
@if(count($h1['subheadings']) > 0)
|
||||||
|
<ul id="tocify-subheader-{!! $h1['slug'] !!}" class="tocify-subheader">
|
||||||
|
@foreach($h1['subheadings'] as $h2)
|
||||||
|
<li class="tocify-item level-2" data-unique="{!! $h2['slug'] !!}">
|
||||||
|
<a href="#{!! $h2['slug'] !!}">{!! $h2['name'] !!}</a>
|
||||||
|
</li>
|
||||||
|
@if(count($h2['subheadings']) > 0)
|
||||||
|
<ul id="tocify-subheader-{!! $h2['slug'] !!}" class="tocify-subheader">
|
||||||
|
@foreach($h2['subheadings'] as $h3)
|
||||||
|
<li class="tocify-item level-3" data-unique="{!! $h3['slug'] !!}">
|
||||||
|
<a href="#{!! $h3['slug'] !!}">{!! $h3['name'] !!}</a>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@endif
|
||||||
|
</ul>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="toc-footer" id="toc-footer">
|
||||||
|
@if($metadata['postman_collection_url'])
|
||||||
|
<li style="padding-bottom: 5px;"><a href="{!! $metadata['postman_collection_url'] !!}">{!! u::trans("scribe::links.postman") !!}</a></li>
|
||||||
|
@endif
|
||||||
|
@if($metadata['openapi_spec_url'])
|
||||||
|
<li style="padding-bottom: 5px;"><a href="{!! $metadata['openapi_spec_url'] !!}">{!! u::trans("scribe::links.openapi") !!}</a></li>
|
||||||
|
@endif
|
||||||
|
<li><a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="toc-footer" id="last-updated">
|
||||||
|
<li>{{ $metadata['last_updated'] }}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
@php
|
||||||
|
$hasChildren ??= false;
|
||||||
|
$isArrayBody = $name == "[]";
|
||||||
|
$expandable = $hasChildren && !$isArrayBody;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3">
|
||||||
|
<div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div>
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 @if($expandable) sl-cursor-pointer @endif">
|
||||||
|
<div class="sl-flex sl-items-center sl-max-w-full">
|
||||||
|
@if($expandable)
|
||||||
|
<div class="sl-flex sl-justify-center sl-w-8 sl--ml-8 sl-pl-3 sl-text-muted expansion-chevrons" role="button">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right"
|
||||||
|
class="svg-inline--fa fa-chevron-right fa-fw fa-sm sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@unless($isArrayBody)
|
||||||
|
<div class="sl-flex sl-items-baseline sl-text-base">
|
||||||
|
<div class="sl-font-mono sl-font-semibold sl-mr-2">{{ $name }}</div>
|
||||||
|
@if($type)
|
||||||
|
<span class="sl-truncate sl-text-muted">{{ $type }}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@if($required)
|
||||||
|
<div class="sl-flex-1 sl-h-px sl-mx-3"></div>
|
||||||
|
<span class="sl-ml-2 sl-text-warning">required</span>
|
||||||
|
@endif
|
||||||
|
@endunless
|
||||||
|
</div>
|
||||||
|
@if($description)
|
||||||
|
<div class="sl-prose sl-markdown-viewer" style="font-size: 12px;">
|
||||||
|
{!! Parsedown::instance()->text($description) !!}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if(!empty($enumValues))
|
||||||
|
Must be one of:
|
||||||
|
<ul style="list-style-position: inside; list-style-type: square;">{!! implode(" ", array_map(fn($val) => "<li><code>$val</code></li>", $enumValues)) !!}</ul>
|
||||||
|
@endif
|
||||||
|
@if($isArrayBody)
|
||||||
|
<div class="sl-flex sl-items-baseline sl-text-base">
|
||||||
|
<div class="sl-font-mono sl-font-semibold sl-mr-2">array of:</div>
|
||||||
|
@if($required)
|
||||||
|
<div class="sl-flex-1 sl-h-px sl-mx-3"></div>
|
||||||
|
<span class="sl-ml-2 sl-text-warning">required</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if(!$hasChildren && !is_null($example) && $example !== '')
|
||||||
|
<div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted">
|
||||||
|
<span>Example:</span> <!-- <span> important for spacing -->
|
||||||
|
<div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;">
|
||||||
|
<div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border">
|
||||||
|
{{ is_array($example) || is_bool($example) ? json_encode($example) : $example }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
@php
|
||||||
|
$level ??= 0;
|
||||||
|
$levelNestingClass = match($level) {
|
||||||
|
0 => "sl-ml-px",
|
||||||
|
default => "sl-ml-7"
|
||||||
|
};
|
||||||
|
$expandable ??= !isset($fields["[]"]);
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@foreach($fields as $name => $field)
|
||||||
|
<div class="{{ $expandable ? 'expandable' : '' }} sl-text-sm sl-border-l {{ $levelNestingClass }}">
|
||||||
|
@component('scribe::themes.elements.components.field-details', [
|
||||||
|
'name' => $name,
|
||||||
|
'type' => $field['type'] ?? 'string',
|
||||||
|
'required' => $field['required'] ?? false,
|
||||||
|
'description' => $field['description'] ?? '',
|
||||||
|
'example' => $field['example'] ?? '',
|
||||||
|
'enumValues' => $field['enumValues'] ?? null,
|
||||||
|
'endpointId' => $endpointId,
|
||||||
|
'hasChildren' => !empty($field['__fields']),
|
||||||
|
'component' => 'body',
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
|
||||||
|
@if(!empty($field['__fields']))
|
||||||
|
<div class="children" style="{{ $expandable ? 'display: none;' : '' }}">
|
||||||
|
@component('scribe::themes.elements.components.nested-fields', [
|
||||||
|
'fields' => $field['__fields'],
|
||||||
|
'endpointId' => $endpointId,
|
||||||
|
'level' => $level + 1,
|
||||||
|
'expandable'=> $expandable,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
@@ -0,0 +1,263 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\Utils as u;
|
||||||
|
/** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full">
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
<div class="sl-relative">
|
||||||
|
<div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center">
|
||||||
|
<h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1"
|
||||||
|
id="{!! $endpoint->fullSlug() !!}">
|
||||||
|
{{ $endpoint->name() }}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sl-relative">
|
||||||
|
<div title="{{ rtrim($baseUrl, '/') . '/'. ltrim($endpoint->uri, '/') }}"
|
||||||
|
class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg"
|
||||||
|
>
|
||||||
|
@foreach($endpoint->httpMethods as $method)
|
||||||
|
<div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg"
|
||||||
|
style="background-color: {{ \Knuckles\Scribe\Tools\WritingUtils::$httpMethodToCssColour[$method] }};"
|
||||||
|
>
|
||||||
|
{{ $method }}
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
<div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all">
|
||||||
|
<div dir="rtl"
|
||||||
|
class="sl-overflow-x-hidden sl-truncate sl-text-muted">{{ rtrim($baseUrl, '/') }}</div>
|
||||||
|
<div class="sl-flex-1 sl-font-semibold">/{{ ltrim($endpoint->uri, '/') }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if($endpoint->metadata->authenticated)
|
||||||
|
<div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg"
|
||||||
|
style="background-color: darkred"
|
||||||
|
>requires authentication
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{!! Parsedown::instance()->text($endpoint->metadata->description ?: '') !!}
|
||||||
|
</div>
|
||||||
|
<div class="sl-flex">
|
||||||
|
<div data-testid="two-column-left" class="sl-flex-1 sl-w-0">
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
@if(count($endpoint->headers))
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
<h3 class="sl-text-2xl sl-leading-snug sl-font-prose">
|
||||||
|
{{ u::trans("scribe::endpoint.headers") }}
|
||||||
|
</h3>
|
||||||
|
<div class="sl-text-sm">
|
||||||
|
@foreach($endpoint->headers as $header => $value)
|
||||||
|
@component('scribe::themes.elements.components.field-details', [
|
||||||
|
'name' => $header,
|
||||||
|
'type' => null,
|
||||||
|
'required' => false,
|
||||||
|
'description' => null,
|
||||||
|
'example' => $value,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
'component' => 'header',
|
||||||
|
'isInput' => true,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(count($endpoint->urlParameters))
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
<h3 class="sl-text-2xl sl-leading-snug sl-font-prose">{{ u::trans("scribe::endpoint.url_parameters") }}</h3>
|
||||||
|
|
||||||
|
<div class="sl-text-sm">
|
||||||
|
@foreach($endpoint->urlParameters as $attribute => $parameter)
|
||||||
|
@component('scribe::themes.elements.components.field-details', [
|
||||||
|
'name' => $parameter->name,
|
||||||
|
'type' => $parameter->type ?? 'string',
|
||||||
|
'required' => $parameter->required,
|
||||||
|
'description' => $parameter->description,
|
||||||
|
'example' => $parameter->example ?? '',
|
||||||
|
'enumValues' => $parameter->enumValues,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
'component' => 'url',
|
||||||
|
'isInput' => true,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
@if(count($endpoint->queryParameters))
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
<h3 class="sl-text-2xl sl-leading-snug sl-font-prose">{{ u::trans("scribe::endpoint.query_parameters") }}</h3>
|
||||||
|
|
||||||
|
<div class="sl-text-sm">
|
||||||
|
@foreach($endpoint->queryParameters as $attribute => $parameter)
|
||||||
|
@component('scribe::themes.elements.components.field-details', [
|
||||||
|
'name' => $parameter->name,
|
||||||
|
'type' => $parameter->type,
|
||||||
|
'required' => $parameter->required,
|
||||||
|
'description' => $parameter->description,
|
||||||
|
'example' => $parameter->example ?? '',
|
||||||
|
'enumValues' => $parameter->enumValues,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
'component' => 'query',
|
||||||
|
'isInput' => true,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(count($endpoint->nestedBodyParameters))
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
<h3 class="sl-text-2xl sl-leading-snug sl-font-prose">{{ u::trans("scribe::endpoint.body_parameters") }}</h3>
|
||||||
|
|
||||||
|
<div class="sl-text-sm">
|
||||||
|
@component('scribe::themes.elements.components.nested-fields', [
|
||||||
|
'fields' => $endpoint->nestedBodyParameters,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(count($endpoint->responseFields))
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
<h3 class="sl-text-2xl sl-leading-snug sl-font-prose">{{ u::trans("scribe::endpoint.response_fields") }}</h3>
|
||||||
|
|
||||||
|
<div class="sl-text-sm">
|
||||||
|
@component('scribe::themes.elements.components.nested-fields', [
|
||||||
|
'fields' => $endpoint->nestedResponseFields,
|
||||||
|
'endpointId' => $endpoint->endpointId(),
|
||||||
|
'isInput' => false,
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;">
|
||||||
|
<div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch">
|
||||||
|
|
||||||
|
@if($metadata['try_it_out']['enabled'] ?? false)
|
||||||
|
@include("scribe::themes.elements.try_it_out")
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($metadata['example_languages'])
|
||||||
|
<div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg">
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl--ml-2">
|
||||||
|
{{ u::trans("scribe::endpoint.example_request") }}:
|
||||||
|
<select class="example-request-lang-toggle sl-text-base"
|
||||||
|
aria-label="Request Sample Language"
|
||||||
|
onchange="switchExampleLanguage(event.target.value);">
|
||||||
|
@foreach($metadata['example_languages'] as $language)
|
||||||
|
<option>{{ $language }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@foreach($metadata['example_languages'] as $index => $language)
|
||||||
|
<div class="sl-bg-canvas-100 example-request example-request-{{ $language }}"
|
||||||
|
style="{{ $index == 0 ? '' : 'display: none;' }}">
|
||||||
|
<div class="sl-px-0 sl-py-1">
|
||||||
|
<div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded">
|
||||||
|
@include("scribe::partials.example-requests.$language")
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($endpoint->isGet() || $endpoint->hasResponses())
|
||||||
|
<div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg">
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-py-2">
|
||||||
|
<div class="sl--ml-2">
|
||||||
|
<div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border">
|
||||||
|
<div class="sl-mb-2 sl-inline-block">{{ u::trans("scribe::endpoint.example_response") }}:</div>
|
||||||
|
<div class="sl-mb-2 sl-inline-block">
|
||||||
|
<select
|
||||||
|
class="example-response-{{ $endpoint->endpointId() }}-toggle sl-text-base"
|
||||||
|
aria-label="Response sample"
|
||||||
|
onchange="switchExampleResponse('{{ $endpoint->endpointId() }}', event.target.value);">
|
||||||
|
@foreach($endpoint->responses as $index => $response)
|
||||||
|
<option value="{{ $index }}">{{ $response->fullDescription() }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button"
|
||||||
|
class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70">
|
||||||
|
<div class="sl-mx-0">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy"
|
||||||
|
class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@foreach($endpoint->responses as $index => $response)
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-{{ $endpoint->endpointId() }} example-response-{{ $endpoint->endpointId() }}-{{ $index }}"
|
||||||
|
style=" {{ $index == 0 ? '' : 'display: none;' }}"
|
||||||
|
>
|
||||||
|
<div class="sl-panel__content sl-p-0">@if(count($response->headers))
|
||||||
|
<details class="sl-pl-2">
|
||||||
|
<summary style="cursor: pointer; list-style: none;">
|
||||||
|
<small>
|
||||||
|
<span class="expansion-chevrons">
|
||||||
|
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="chevron-right"
|
||||||
|
class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
Headers
|
||||||
|
</small>
|
||||||
|
</summary>
|
||||||
|
<pre><code class="language-http">@foreach($response->headers as $header => $value)
|
||||||
|
{{ $header }}
|
||||||
|
: {{ is_array($value) ? implode('; ', $value) : $value }}
|
||||||
|
@endforeach </code></pre>
|
||||||
|
</details>
|
||||||
|
@endif
|
||||||
|
@if(is_string($response->content) && Str::startsWith($response->content, "<<binary>>"))
|
||||||
|
<pre><code>[{{ u::trans("scribe::endpoint.responses.binary") }}] - {{ htmlentities(str_replace("<<binary>>", "", $response->content)) }}</code></pre>
|
||||||
|
@elseif($response->status == 204)
|
||||||
|
<pre><code>[{{ u::trans("scribe::endpoint.responses.empty") }}]</code></pre>
|
||||||
|
@else
|
||||||
|
@php($parsed = json_decode($response->content))
|
||||||
|
{{-- If response is a JSON string, prettify it. Otherwise, just print it --}}
|
||||||
|
<pre><code style="max-height: 300px;"
|
||||||
|
class="language-json sl-overflow-x-auto sl-overflow-y-auto">{!! htmlentities($parsed != null ? json_encode($parsed, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : $response->content) !!}</code></pre>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
@foreach($groupedEndpoints as $group)
|
||||||
|
<h1 id="{!! Str::slug($group['name']) !!}"
|
||||||
|
class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading"
|
||||||
|
>
|
||||||
|
{!! $group['name'] !!}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
{!! Parsedown::instance()->text($group['description']) !!}
|
||||||
|
|
||||||
|
@foreach($group['subgroups'] as $subgroupName => $subgroup)
|
||||||
|
@if($subgroupName !== "")
|
||||||
|
<h2 id="{!! Str::slug($group['name']) !!}-{!! Str::slug($subgroupName) !!}"
|
||||||
|
class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-3"
|
||||||
|
>
|
||||||
|
{{ $subgroupName }}
|
||||||
|
</h2>
|
||||||
|
@php($subgroupDescription = collect($subgroup)->first(fn ($e) => $e->metadata->subgroupDescription)?->metadata?->subgroupDescription)
|
||||||
|
@if($subgroupDescription)
|
||||||
|
{!! Parsedown::instance()->text($subgroupDescription) !!}
|
||||||
|
@endif
|
||||||
|
<br>
|
||||||
|
@endif
|
||||||
|
@foreach($subgroup as $endpoint)
|
||||||
|
@include("scribe::themes.elements.endpoint")
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
|
||||||
@@ -0,0 +1,360 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\WritingUtils as u;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
|
<title>{!! $metadata['title'] !!}</title>
|
||||||
|
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=PT+Sans&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="{!! $assetPathPrefix !!}css/theme-elements.style.css" media="screen">
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/styles/docco.min.css">
|
||||||
|
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/highlight.min.js"></script>
|
||||||
|
<script>hljs.highlightAll();</script>
|
||||||
|
<script type="module">
|
||||||
|
import {CodeJar} from 'https://medv.io/codejar/codejar.js'
|
||||||
|
window.CodeJar = CodeJar;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
@if($tryItOut['enabled'] ?? true)
|
||||||
|
<script>
|
||||||
|
var tryItOutBaseUrl = "{{ $tryItOut['base_url'] ?? config('app.url') }}";
|
||||||
|
var useCsrf = Boolean({{ $tryItOut['use_csrf'] ?? null }});
|
||||||
|
var csrfUrl = "{{ $tryItOut['csrf_url'] ?? null }}";
|
||||||
|
</script>
|
||||||
|
<script src="{{ u::getVersionedAsset($assetPathPrefix.'js/tryitout.js') }}"></script>
|
||||||
|
<style>
|
||||||
|
.code-editor, .response-content {
|
||||||
|
color: whitesmoke;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
Problem: we want syntax highlighting for the Try It Out JSON body code editor
|
||||||
|
However, the Try It Out area uses a dark background, while request and response samples
|
||||||
|
(which are already highlighted) use a light background. HighlightJS can only use one theme per document.
|
||||||
|
Our options:
|
||||||
|
1. Change the bg of one. => No, it looks out of place on the page.
|
||||||
|
2. Use the same highlighting for both. => Nope, one would be unreadable.
|
||||||
|
3. Copy styles for a dark-bg h1js theme and prefix them for the CodeEditor, which is what we're doing.
|
||||||
|
Since it's only JSON, we only need a few styles anyway.
|
||||||
|
Styles taken from the Nord theme: https://github.com/highlightjs/highlight.js/blob/3997c9b430a568d5ad46d96693b90a74fc01ea7f/src/styles/nord.css#L2
|
||||||
|
*/
|
||||||
|
.code-editor > .hljs-attr {
|
||||||
|
color: #8FBCBB;
|
||||||
|
}
|
||||||
|
.code-editor > .hljs-string {
|
||||||
|
color: #A3BE8C;
|
||||||
|
}
|
||||||
|
.code-editor > .hljs-number {
|
||||||
|
color: #B48EAD;
|
||||||
|
}
|
||||||
|
.code-editor > .hljs-literal{
|
||||||
|
color: #81A1C1;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function tryItOut(btnElement) {
|
||||||
|
btnElement.disabled = true;
|
||||||
|
|
||||||
|
let endpointId = btnElement.dataset.endpoint;
|
||||||
|
|
||||||
|
let errorPanel = document.querySelector(`.tryItOut-error[data-endpoint=${endpointId}]`);
|
||||||
|
errorPanel.hidden = true;
|
||||||
|
let responsePanel = document.querySelector(`.tryItOut-response[data-endpoint=${endpointId}]`);
|
||||||
|
responsePanel.hidden = true;
|
||||||
|
|
||||||
|
let form = btnElement.form;
|
||||||
|
let { method, path, hasjsonbody: hasJsonBody} = form.dataset;
|
||||||
|
let body = {};
|
||||||
|
if (hasJsonBody === "1") {
|
||||||
|
body = form.querySelector('.code-editor').textContent;
|
||||||
|
} else if (form.dataset.hasfiles === "1") {
|
||||||
|
body = new FormData();
|
||||||
|
form.querySelectorAll('input[data-component=body]')
|
||||||
|
.forEach(el => {
|
||||||
|
if (el.type === 'file') {
|
||||||
|
if (el.files[0]) body.append(el.name, el.files[0])
|
||||||
|
} else body.append(el.name, el.value);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
form.querySelectorAll('input[data-component=body]').forEach(el => {
|
||||||
|
_.set(body, el.name, el.value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const urlParameters = form.querySelectorAll('input[data-component=url]');
|
||||||
|
urlParameters.forEach(el => (path = path.replace(new RegExp(`\\{${el.name}\\??}`), el.value)));
|
||||||
|
|
||||||
|
const headers = Object.fromEntries(Array.from(form.querySelectorAll('input[data-component=header]'))
|
||||||
|
.map(el => [el.name, (el.dataset.prefix || '') + el.value]));
|
||||||
|
|
||||||
|
const query = {}
|
||||||
|
form.querySelectorAll('input[data-component=query]').forEach(el => {
|
||||||
|
_.set(query, el.name, el.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
let preflightPromise = Promise.resolve();
|
||||||
|
if (window.useCsrf && window.csrfUrl) {
|
||||||
|
preflightPromise = makeAPICall('GET', window.csrfUrl).then(() => {
|
||||||
|
headers['X-XSRF-TOKEN'] = getCookie('XSRF-TOKEN');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// content type has to be unset otherwise file upload won't work
|
||||||
|
if (form.dataset.hasfiles === "1") {
|
||||||
|
delete headers['Content-Type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return preflightPromise.then(() => makeAPICall(method, path, body, query, headers, endpointId))
|
||||||
|
.then(([responseStatus, statusText, responseContent, responseHeaders]) => {
|
||||||
|
responsePanel.hidden = false;
|
||||||
|
responsePanel.querySelector(`.response-status`).textContent = responseStatus + " " + statusText ;
|
||||||
|
|
||||||
|
let contentEl = responsePanel.querySelector(`.response-content`);
|
||||||
|
if (responseContent === '') {
|
||||||
|
contentEl.textContent = contentEl.dataset.emptyResponseText;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prettify it if it's JSON
|
||||||
|
let isJson = false;
|
||||||
|
try {
|
||||||
|
const jsonParsed = JSON.parse(responseContent);
|
||||||
|
if (jsonParsed !== null) {
|
||||||
|
isJson = true;
|
||||||
|
responseContent = JSON.stringify(jsonParsed, null, 4);
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
// Replace HTML entities
|
||||||
|
responseContent = responseContent.replace(/[<>&]/g, (i) => '&#' + i.charCodeAt(0) + ';');
|
||||||
|
|
||||||
|
contentEl.innerHTML = responseContent;
|
||||||
|
isJson && window.hljs.highlightElement(contentEl);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
let errorMessage = err.message || err;
|
||||||
|
errorPanel.hidden = false;
|
||||||
|
errorPanel.querySelector(`.error-message`).textContent = errorMessage;
|
||||||
|
})
|
||||||
|
.finally(() => { btnElement.disabled = false } );
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
document.querySelectorAll('.tryItOut-btn').forEach(el => {
|
||||||
|
el.addEventListener('click', () => tryItOut(el));
|
||||||
|
});
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
@if($metadata['example_languages'])
|
||||||
|
<script>
|
||||||
|
function switchExampleLanguage(lang) {
|
||||||
|
document.querySelectorAll(`.example-request`).forEach(el => el.style.display = 'none');
|
||||||
|
document.querySelectorAll(`.example-request-${lang}`).forEach(el => el.style.display = 'initial');
|
||||||
|
document.querySelectorAll(`.example-request-lang-toggle`).forEach(el => el.value = lang);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function switchExampleResponse(endpointId, index) {
|
||||||
|
document.querySelectorAll(`.example-response-${endpointId}`).forEach(el => el.style.display = 'none');
|
||||||
|
document.querySelectorAll(`.example-response-${endpointId}-${index}`).forEach(el => el.style.display = 'initial');
|
||||||
|
document.querySelectorAll(`.example-response-${endpointId}-toggle`).forEach(el => el.value = index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Requirement: a div with class `expansion-chevrons`
|
||||||
|
* (or `expansion-chevrons-solid` to use the solid version).
|
||||||
|
* Also add the `expanded` class if your div is expanded by default.
|
||||||
|
*/
|
||||||
|
function toggleExpansionChevrons(evt) {
|
||||||
|
let elem = evt.currentTarget;
|
||||||
|
|
||||||
|
let chevronsArea = elem.querySelector('.expansion-chevrons');
|
||||||
|
const solid = chevronsArea.classList.contains('expansion-chevrons-solid');
|
||||||
|
const newState = chevronsArea.classList.contains('expanded') ? 'expand' : 'expanded';
|
||||||
|
if (newState === 'expanded') {
|
||||||
|
const selector = solid ? '#expanded-chevron-solid' : '#expanded-chevron';
|
||||||
|
const template = document.querySelector(selector);
|
||||||
|
const chevron = template.content.cloneNode(true);
|
||||||
|
chevronsArea.replaceChildren(chevron);
|
||||||
|
chevronsArea.classList.add('expanded');
|
||||||
|
} else {
|
||||||
|
const selector = solid ? '#expand-chevron-solid' : '#expand-chevron';
|
||||||
|
const template = document.querySelector(selector);
|
||||||
|
const chevron = template.content.cloneNode(true);
|
||||||
|
chevronsArea.replaceChildren(chevron);
|
||||||
|
chevronsArea.classList.remove('expanded');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Make sure the children are inside the parent element
|
||||||
|
* 2. Add `expandable` class to the parent
|
||||||
|
* 3. Add `children` class to the children.
|
||||||
|
* 4. Wrap the default chevron SVG in a div with class `expansion-chevrons`
|
||||||
|
* (or `expansion-chevrons-solid` to use the solid version).
|
||||||
|
* Also add the `expanded` class if your div is expanded by default.
|
||||||
|
*/
|
||||||
|
function toggleElementChildren(evt) {
|
||||||
|
let elem = evt.currentTarget;
|
||||||
|
let children = elem.querySelector(`.children`);
|
||||||
|
if (!children) return;
|
||||||
|
|
||||||
|
if (children.contains(event.target)) return;
|
||||||
|
|
||||||
|
let oldState = children.style.display
|
||||||
|
if (oldState === 'none') {
|
||||||
|
children.style.removeProperty('display');
|
||||||
|
toggleExpansionChevrons(evt);
|
||||||
|
} else {
|
||||||
|
children.style.display = 'none';
|
||||||
|
toggleExpansionChevrons(evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
evt.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
function highlightSidebarItem(evt = null) {
|
||||||
|
if (evt && evt.oldURL) {
|
||||||
|
let oldHash = new URL(evt.oldURL).hash.slice(1);
|
||||||
|
if (oldHash) {
|
||||||
|
let previousItem = window['sidebar'].querySelector(`#toc-item-${oldHash}`);
|
||||||
|
previousItem.classList.remove('sl-bg-primary-tint');
|
||||||
|
previousItem.classList.add('sl-bg-canvas-100');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let newHash = location.hash.slice(1);
|
||||||
|
if (newHash) {
|
||||||
|
let item = window['sidebar'].querySelector(`#toc-item-${newHash}`);
|
||||||
|
item.classList.remove('sl-bg-canvas-100');
|
||||||
|
item.classList.add('sl-bg-primary-tint');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addEventListener('DOMContentLoaded', () => {
|
||||||
|
highlightSidebarItem();
|
||||||
|
|
||||||
|
document.querySelectorAll('.code-editor').forEach(elem => CodeJar(elem, (editor) => {
|
||||||
|
// highlight.js does not trim old tags,
|
||||||
|
// which means highlighting doesn't update on type (only on paste)
|
||||||
|
// See https://github.com/antonmedv/codejar/issues/18
|
||||||
|
editor.textContent = editor.textContent
|
||||||
|
return hljs.highlightElement(editor)
|
||||||
|
}));
|
||||||
|
|
||||||
|
document.querySelectorAll('.expandable').forEach(el => {
|
||||||
|
el.addEventListener('click', toggleElementChildren);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.querySelectorAll('details').forEach(el => {
|
||||||
|
el.addEventListener('toggle', toggleExpansionChevrons);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
addEventListener('hashchange', highlightSidebarItem);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="sl-elements sl-antialiased sl-h-full sl-text-base sl-font-ui sl-text-body sl-flex sl-inset-0">
|
||||||
|
|
||||||
|
@include("scribe::themes.elements.sidebar")
|
||||||
|
|
||||||
|
<div class="sl-overflow-y-auto sl-flex-1 sl-w-full sl-px-16 sl-bg-canvas sl-py-16" style="max-width: 1500px;">
|
||||||
|
|
||||||
|
<div class="sl-mb-10">
|
||||||
|
<div class="sl-mb-4">
|
||||||
|
<h1 class="sl-text-5xl sl-leading-tight sl-font-prose sl-font-semibold sl-text-heading">
|
||||||
|
{!! $metadata['title'] !!}
|
||||||
|
</h1>
|
||||||
|
@if($metadata['postman_collection_url'])
|
||||||
|
<a title="Download Postman collection" class="sl-mx-1"
|
||||||
|
href="{!! $metadata['postman_collection_url'] !!}" target="_blank">
|
||||||
|
<small>Postman collection →</small>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
@if($metadata['openapi_spec_url'])
|
||||||
|
<a title="Download OpenAPI spec" class="sl-mx-1"
|
||||||
|
href="{!! $metadata['openapi_spec_url'] !!}" target="_blank">
|
||||||
|
<small>OpenAPI spec →</small>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sl-prose sl-markdown-viewer sl-my-4">
|
||||||
|
{!! $intro !!}
|
||||||
|
|
||||||
|
{!! $auth !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@include("scribe::themes.elements.groups")
|
||||||
|
|
||||||
|
<div class="sl-prose sl-markdown-viewer sl-my-5">
|
||||||
|
{!! $append !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template id="expand-chevron">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="chevron-right"
|
||||||
|
class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path>
|
||||||
|
</svg>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template id="expanded-chevron">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="chevron-down"
|
||||||
|
class="svg-inline--fa fa-chevron-down fa-fw sl-icon sl-text-muted"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"></path>
|
||||||
|
</svg>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template id="expand-chevron-solid">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="caret-right"
|
||||||
|
class="svg-inline--fa fa-caret-right fa-fw sl-icon" role="img" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 256 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M118.6 105.4l128 127.1C252.9 239.6 256 247.8 256 255.1s-3.125 16.38-9.375 22.63l-128 127.1c-9.156 9.156-22.91 11.9-34.88 6.943S64 396.9 64 383.1V128c0-12.94 7.781-24.62 19.75-29.58S109.5 96.23 118.6 105.4z"></path>
|
||||||
|
</svg>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template id="expanded-chevron-solid">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</template>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<div id="sidebar" class="sl-flex sl-overflow-y-auto sl-flex-col sl-sticky sl-inset-y-0 sl-pt-8 sl-bg-canvas-100 sl-border-r"
|
||||||
|
style="width: calc((100% - 1800px) / 2 + 300px); padding-left: calc((100% - 1800px) / 2); min-width: 300px; max-height: 100vh">
|
||||||
|
<div class="sl-flex sl-items-center sl-mb-5 sl-ml-4">
|
||||||
|
@if($metadata['logo'] != false)
|
||||||
|
<div class="sl-inline sl-overflow-x-hidden sl-overflow-y-hidden sl-mr-3 sl-rounded-lg"
|
||||||
|
style="background-color: transparent;">
|
||||||
|
<img src="{{ $metadata['logo'] }}" height="30px" width="30px" alt="logo">
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
<h4 class="sl-text-paragraph sl-leading-snug sl-font-prose sl-font-semibold sl-text-heading">
|
||||||
|
{{ $metadata['title'] }}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sl-flex sl-overflow-y-auto sl-flex-col sl-flex-grow sl-flex-shrink">
|
||||||
|
<div class="sl-overflow-y-auto sl-w-full sl-bg-canvas-100">
|
||||||
|
<div class="sl-my-3">
|
||||||
|
@foreach($headings as $h1)
|
||||||
|
<div class="expandable">
|
||||||
|
<div title="{!! $h1['name'] !!}" id="toc-item-{!! $h1['slug'] !!}"
|
||||||
|
class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none">
|
||||||
|
<a href="#{!! $h1['slug'] !!}"
|
||||||
|
class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">{!! $h1['name'] !!}</a>
|
||||||
|
@if(count($h1['subheadings']) > 0)
|
||||||
|
<div class="sl-flex sl-items-center sl-text-xs expansion-chevrons">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="chevron-right"
|
||||||
|
class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if(count($h1['subheadings']) > 0)
|
||||||
|
<div class="children" style="display: none;">
|
||||||
|
@foreach($h1['subheadings'] as $h2)
|
||||||
|
<div class="expandable">
|
||||||
|
<div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"
|
||||||
|
id="toc-item-{!! $h2['slug'] !!}">
|
||||||
|
<div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="{!! $h2['name'] !!}">
|
||||||
|
<a class="ElementsTableOfContentsItem sl-block sl-no-underline"
|
||||||
|
href="#{!! $h2['slug'] !!}">
|
||||||
|
{!! $h2['name'] !!}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@if(count($h2['subheadings']) > 0)
|
||||||
|
<div class="sl-flex sl-items-center sl-text-xs expansion-chevrons">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="chevron-right"
|
||||||
|
class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if(count($h2['subheadings']) > 0)
|
||||||
|
<div class="children" style="display: none;">
|
||||||
|
@foreach($h2['subheadings'] as $h3)
|
||||||
|
<a class="ElementsTableOfContentsItem sl-block sl-no-underline"
|
||||||
|
href="#{!! $h3['slug'] !!}">
|
||||||
|
<div title="{!! $h3['name'] !!}" id="toc-item-{!! $h3['slug'] !!}"
|
||||||
|
class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none">
|
||||||
|
{!! $h3['name'] !!}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="sl-flex sl-items-center sl-px-4 sl-py-3 sl-border-t">
|
||||||
|
{{ $metadata['last_updated'] }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sl-flex sl-items-center sl-px-4 sl-py-3 sl-border-t">
|
||||||
|
<a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,322 @@
|
|||||||
|
@php
|
||||||
|
use Knuckles\Scribe\Tools\Utils as u;
|
||||||
|
/** @var \Knuckles\Camel\Output\OutputEndpointData $endpoint */
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="sl-inverted">
|
||||||
|
<div class="sl-overflow-y-hidden sl-rounded-lg">
|
||||||
|
<form class="TryItPanel sl-bg-canvas-100 sl-rounded-lg"
|
||||||
|
data-method="{{ $endpoint->httpMethods[0] }}"
|
||||||
|
data-path="{{ $endpoint->uri }}"
|
||||||
|
data-hasfiles="{{ $endpoint->hasFiles() ? 1 : 0 }}"
|
||||||
|
data-hasjsonbody="{{ $endpoint->hasJsonBody() ? 1 : 0 }}">
|
||||||
|
@if($endpoint->isAuthed() && $metadata['auth']['location'] !== 'body')
|
||||||
|
<div class="sl-panel sl-outline-none sl-w-full expandable">
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-4 sl-pl-3 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-cursor-pointer sl-select-none"
|
||||||
|
role="button">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl-flex sl-items-center sl-mr-1.5 expansion-chevrons expansion-chevrons-solid expanded">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
Auth
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 children" role="region">
|
||||||
|
<div class="ParameterGrid sl-p-4">
|
||||||
|
<label aria-hidden="true"
|
||||||
|
for="auth-{{ $endpoint->endpointId() }}">{{ $metadata['auth']['name'] }}</label>
|
||||||
|
<span class="sl-mx-3">:</span>
|
||||||
|
<div class="sl-flex sl-flex-1">
|
||||||
|
<div class="sl-input sl-flex-1 sl-relative">
|
||||||
|
<code>{{ $metadata['auth']['prefix'] }}</code>
|
||||||
|
<input aria-label="{{ $metadata['auth']['name'] }}"
|
||||||
|
id="auth-{{ $endpoint->endpointId() }}"
|
||||||
|
data-component="{{ $metadata['auth']['location'] }}"
|
||||||
|
data-prefix="{{ $metadata['auth']['prefix'] }}"
|
||||||
|
name="{{ $metadata['auth']['name'] }}"
|
||||||
|
placeholder="{{ $metadata['auth']['placeholder'] }}"
|
||||||
|
class="auth-value sl-relative {{ $metadata['auth']['prefix'] ? 'sl-w-3/5' : 'sl-w-full sl-pr-2.5 sl-pl-2.5' }} sl-h-md sl-text-base sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(count($endpoint->headers))
|
||||||
|
<div class="sl-panel sl-outline-none sl-w-full expandable">
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-4 sl-pl-3 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-cursor-pointer sl-select-none"
|
||||||
|
role="button">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl-flex sl-items-center sl-mr-1.5 expansion-chevrons expansion-chevrons-solid expanded">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
Headers
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 children" role="region">
|
||||||
|
<div class="ParameterGrid sl-p-4">
|
||||||
|
@foreach($endpoint->headers as $name => $example)
|
||||||
|
@php
|
||||||
|
if($endpoint->isAuthed() && $metadata['auth']['location'] === 'header' && $name === $metadata['auth']['name']) continue;
|
||||||
|
@endphp
|
||||||
|
<label aria-hidden="true"
|
||||||
|
for="header-{{ $endpoint->endpointId() }}-{{ $name }}">{{ $name }}</label>
|
||||||
|
<span class="sl-mx-3">:</span>
|
||||||
|
<div class="sl-flex sl-flex-1">
|
||||||
|
<div class="sl-input sl-flex-1 sl-relative">
|
||||||
|
<input aria-label="{{ $name }}" name="{{ $name }}"
|
||||||
|
id="header-{{ $endpoint->endpointId() }}-{{ $name }}"
|
||||||
|
value="{{ $example }}" data-component="header"
|
||||||
|
class="sl-relative sl-w-full sl-h-md sl-text-base sl-pr-2.5 sl-pl-2.5 sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(count($endpoint->urlParameters))
|
||||||
|
<div class="sl-panel sl-outline-none sl-w-full expandable">
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-4 sl-pl-3 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-cursor-pointer sl-select-none"
|
||||||
|
role="button">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl-flex sl-items-center sl-mr-1.5 expansion-chevrons expansion-chevrons-solid expanded">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
URL Parameters
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 children" role="region">
|
||||||
|
<div class="ParameterGrid sl-p-4">
|
||||||
|
@foreach($endpoint->urlParameters as $name => $parameter)
|
||||||
|
<label aria-hidden="true"
|
||||||
|
for="urlparam-{{ $endpoint->endpointId() }}-{{ $name }}">{{ $name }}</label>
|
||||||
|
<span class="sl-mx-3">:</span>
|
||||||
|
<div class="sl-flex sl-flex-1">
|
||||||
|
<div class="sl-input sl-flex-1 sl-relative">
|
||||||
|
<input aria-label="{{ $name }}" name="{{ $name }}"
|
||||||
|
id="urlparam-{{ $endpoint->endpointId() }}-{{ $name }}"
|
||||||
|
placeholder="{{ $parameter->description }}"
|
||||||
|
value="{{ $parameter->example }}" data-component="url"
|
||||||
|
class="sl-relative sl-w-full sl-h-md sl-text-base sl-pr-2.5 sl-pl-2.5 sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(count($endpoint->queryParameters))
|
||||||
|
<div class="sl-panel sl-outline-none sl-w-full expandable">
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-4 sl-pl-3 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-cursor-pointer sl-select-none"
|
||||||
|
role="button">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl-flex sl-items-center sl-mr-1.5 expansion-chevrons expansion-chevrons-solid expanded">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
Query Parameters
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 children" role="region">
|
||||||
|
<div class="ParameterGrid sl-p-4">
|
||||||
|
@foreach($endpoint->queryParameters as $name => $parameter)
|
||||||
|
@php
|
||||||
|
/** @var \Knuckles\Camel\Output\Parameter $parameter */
|
||||||
|
if ($parameter->type == 'object') // Skip; individual object children are listed
|
||||||
|
continue;
|
||||||
|
if (str_contains($name, "[]"))
|
||||||
|
// This likely belongs to an obj-array (eg objs[].a); we only show the parent (objs[]), so skip
|
||||||
|
continue;
|
||||||
|
if($endpoint->isAuthed() && $metadata['auth']['location'] === 'query'
|
||||||
|
&& $name === $metadata['auth']['name']) continue;
|
||||||
|
@endphp
|
||||||
|
<label aria-hidden="true"
|
||||||
|
for="queryparam-{{ $endpoint->endpointId() }}-{{ $name }}">{{ $name }}</label>
|
||||||
|
<span class="sl-mx-3">:</span>
|
||||||
|
<div class="sl-flex sl-flex-1">
|
||||||
|
<div class="sl-input sl-flex-1 sl-relative">
|
||||||
|
@if(str_ends_with($parameter->type, '[]'))
|
||||||
|
<input aria-label="{{ $name }}" name="{{ $name }}"
|
||||||
|
id="queryparam-{{ $endpoint->endpointId() }}-{{ $name }}"
|
||||||
|
placeholder="{{ $parameter->description }}"
|
||||||
|
value="{{ json_encode($parameter->example) }}" data-component="query"
|
||||||
|
class="sl-relative sl-w-full sl-h-md sl-text-base sl-pr-2.5 sl-pl-2.5 sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border"
|
||||||
|
>
|
||||||
|
@else
|
||||||
|
<input aria-label="{{ $name }}" name="{{ $name }}"
|
||||||
|
id="queryparam-{{ $endpoint->endpointId() }}-{{ $name }}"
|
||||||
|
placeholder="{{ $parameter->description }}"
|
||||||
|
value="{{ $parameter->example }}" data-component="query"
|
||||||
|
class="sl-relative sl-w-full sl-h-md sl-text-base sl-pr-2.5 sl-pl-2.5 sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border"
|
||||||
|
>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(count($endpoint->bodyParameters))
|
||||||
|
<div class="sl-panel sl-outline-none sl-w-full expandable">
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-4 sl-pl-3 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-cursor-pointer sl-select-none"
|
||||||
|
role="button">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl-flex sl-items-center sl-mr-1.5 expansion-chevrons expansion-chevrons-solid expanded">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
Body
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 children" role="region">
|
||||||
|
@if($endpoint->hasJsonBody())
|
||||||
|
<div class="TextRequestBody sl-p-4">
|
||||||
|
<div class="code-editor language-json"
|
||||||
|
id="json-body-{{ $endpoint->endpointId() }}"
|
||||||
|
style="font-family: var(--font-code); font-size: 12px; line-height: var(--lh-code);"
|
||||||
|
>{!! json_encode($endpoint->getSampleBody(), JSON_PRETTY_PRINT) !!}</div>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="ParameterGrid sl-p-4">
|
||||||
|
@foreach($endpoint->bodyParameters as $name => $parameter)
|
||||||
|
@php
|
||||||
|
/** @var \Knuckles\Camel\Output\Parameter $parameter */
|
||||||
|
if ($parameter->type == 'object') // Skip; individual object children are listed
|
||||||
|
continue;
|
||||||
|
if (str_contains($name, "[]"))
|
||||||
|
// This likely belongs to an obj-array (eg objs[].a); we only show the parent (objs[]), so skip
|
||||||
|
continue;
|
||||||
|
@endphp
|
||||||
|
<label aria-hidden="true"
|
||||||
|
for="bodyparam-{{ $endpoint->endpointId() }}-{{ $name }}">{{ $name }}</label>
|
||||||
|
<span class="sl-mx-3">:</span>
|
||||||
|
<div class="sl-flex sl-flex-1">
|
||||||
|
<div class="sl-input sl-flex-1 sl-relative">
|
||||||
|
@if($parameter->type == 'file')
|
||||||
|
<input aria-label="{{ $name }}" name="{{ $name }}"
|
||||||
|
id="bodyparam-{{ $endpoint->endpointId() }}-{{ $name }}"
|
||||||
|
type="file" data-component="body"
|
||||||
|
class="sl-relative sl-w-full sl-h-md sl-text-base sl-pr-2.5 sl-pl-2.5 sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border"
|
||||||
|
>
|
||||||
|
@elseif(str_ends_with($parameter->type, '[]'))
|
||||||
|
<input aria-label="{{ $name }}" name="{{ $name }}"
|
||||||
|
id="bodyparam-{{ $endpoint->endpointId() }}-{{ $name }}"
|
||||||
|
placeholder="{{ $parameter->description }}"
|
||||||
|
value="{{ json_encode($parameter->example) }}" data-component="body"
|
||||||
|
class="sl-relative sl-w-full sl-h-md sl-text-base sl-pr-2.5 sl-pl-2.5 sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border"
|
||||||
|
>
|
||||||
|
@else
|
||||||
|
<input aria-label="{{ $name }}" name="{{ $name }}"
|
||||||
|
id="bodyparam-{{ $endpoint->endpointId() }}-{{ $name }}"
|
||||||
|
placeholder="{{ $parameter->description }}"
|
||||||
|
value="{{ $parameter->example }}" data-component="body"
|
||||||
|
class="sl-relative sl-w-full sl-h-md sl-text-base sl-pr-2.5 sl-pl-2.5 sl-rounded sl-border-transparent hover:sl-border-input focus:sl-border-primary sl-border"
|
||||||
|
>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="SendButtonHolder sl-mt-4 sl-p-4 sl-pt-0">
|
||||||
|
<div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-center">
|
||||||
|
<button type="button" data-endpoint="{{ $endpoint->endpointId() }}"
|
||||||
|
class="tryItOut-btn sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-bg-primary hover:sl-bg-primary-dark active:sl-bg-primary-darker disabled:sl-bg-canvas-100 sl-text-on-primary disabled:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"
|
||||||
|
>
|
||||||
|
{{ u::trans("scribe::try_it_out.send") }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div data-endpoint="{{ $endpoint->endpointId() }}"
|
||||||
|
class="tryItOut-error expandable sl-panel sl-outline-none sl-w-full" hidden>
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-4 sl-pl-3 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-cursor-pointer sl-select-none"
|
||||||
|
role="button">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl-flex sl-items-center sl-mr-1.5 expansion-chevrons expansion-chevrons-solid expanded">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
{{ u::trans("scribe::try_it_out.request_failed") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 children" role="region">
|
||||||
|
<div class="sl-panel__content sl-p-4">
|
||||||
|
<p class="sl-pb-2"><strong class="error-message"></strong></p>
|
||||||
|
<p class="sl-pb-2">{{ u::trans("scribe::try_it_out.error_help") }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div data-endpoint="{{ $endpoint->endpointId() }}"
|
||||||
|
class="tryItOut-response expandable sl-panel sl-outline-none sl-w-full" hidden>
|
||||||
|
<div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-4 sl-pl-3 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-cursor-pointer sl-select-none"
|
||||||
|
role="button">
|
||||||
|
<div class="sl-flex sl-flex-1 sl-items-center sl-h-lg">
|
||||||
|
<div class="sl-flex sl-items-center sl-mr-1.5 expansion-chevrons expansion-chevrons-solid expanded">
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas"
|
||||||
|
data-icon="caret-down"
|
||||||
|
class="svg-inline--fa fa-caret-down fa-fw sl-icon" role="img"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
{{ u::trans("scribe::try_it_out.received_response") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sl-panel__content-wrapper sl-bg-canvas-100 children" role="region">
|
||||||
|
<div class="sl-panel__content sl-p-4">
|
||||||
|
<p class="sl-pb-2 response-status"></p>
|
||||||
|
<pre><code class="sl-pb-2 response-content language-json"
|
||||||
|
data-empty-response-text="<{{ u::trans("scribe::endpoint.responses.empty") }}>"
|
||||||
|
style="max-height: 300px;"></code></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use App\Http\Controllers\CurrencyController;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| API Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
Route::get('/currency-rates', [CurrencyController::class, 'getCurrentRates']);
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Inspiring;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
|
||||||
|
Artisan::command('inspire', function () {
|
||||||
|
$this->comment(Inspiring::quote());
|
||||||
|
})->purpose('Display an inspiring quote')->hourly();
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::get('/', function () {
|
||||||
|
return view('welcome');
|
||||||
|
});
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
*
|
||||||
|
!private/
|
||||||
|
!public/
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
compiled.php
|
||||||
|
config.php
|
||||||
|
down
|
||||||
|
events.scanned.php
|
||||||
|
maintenance.php
|
||||||
|
routes.php
|
||||||
|
routes.scanned.php
|
||||||
|
schedule-*
|
||||||
|
services.json
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
*
|
||||||
|
!data/
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user