mcps and skills

This commit is contained in:
2026-08-11 00:42:46 +03:00
parent 6ffb24f20a
commit 4e67077e12
44 changed files with 2158 additions and 0 deletions
@@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreMcpServerRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'slug' => ['nullable', 'string', 'max:255', Rule::unique('mcp_servers', 'slug')],
'description' => ['required', 'string'],
'url' => ['required', 'url', 'max:255'],
'docs_url' => ['nullable', 'url', 'max:255'],
'logo_url' => ['nullable', 'url', 'max:255'],
'category' => ['required', Rule::in(array_keys(config('mcp_servers.categories')))],
'install_command' => ['nullable', 'string'],
'config_example' => ['nullable', 'string'],
'transport' => ['nullable', Rule::in(array_keys(config('mcp_servers.transports')))],
'language' => ['nullable', 'string', 'max:100'],
'capabilities' => ['sometimes', 'array'],
'capabilities.*' => ['string', 'max:255'],
'tags' => ['sometimes', 'array'],
'tags.*' => ['string', 'max:50'],
'featured' => ['sometimes', 'boolean'],
'approved' => ['sometimes', 'boolean'],
];
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreSkillRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'slug' => ['nullable', 'string', 'max:255', Rule::unique('skills', 'slug')],
'description' => ['required', 'string'],
'url' => ['required', 'url', 'max:255'],
'docs_url' => ['nullable', 'url', 'max:255'],
'logo_url' => ['nullable', 'url', 'max:255'],
'category' => ['required', Rule::in(array_keys(config('skills.categories')))],
'install_instructions' => ['nullable', 'string'],
'example_prompt' => ['nullable', 'string'],
'requirements' => ['nullable', 'string', 'max:255'],
'tags' => ['sometimes', 'array'],
'tags.*' => ['string', 'max:50'],
'featured' => ['sometimes', 'boolean'],
'approved' => ['sometimes', 'boolean'],
];
}
}
@@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateMcpServerRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'name' => ['sometimes', 'required', 'string', 'max:255'],
'slug' => ['sometimes', 'required', 'string', 'max:255', Rule::unique('mcp_servers', 'slug')->ignore($this->route('mcp_server'))],
'description' => ['sometimes', 'required', 'string'],
'url' => ['sometimes', 'required', 'url', 'max:255'],
'docs_url' => ['nullable', 'url', 'max:255'],
'logo_url' => ['nullable', 'url', 'max:255'],
'category' => ['sometimes', 'required', Rule::in(array_keys(config('mcp_servers.categories')))],
'install_command' => ['nullable', 'string'],
'config_example' => ['nullable', 'string'],
'transport' => ['nullable', Rule::in(array_keys(config('mcp_servers.transports')))],
'language' => ['nullable', 'string', 'max:100'],
'capabilities' => ['sometimes', 'array'],
'capabilities.*' => ['string', 'max:255'],
'tags' => ['sometimes', 'array'],
'tags.*' => ['string', 'max:50'],
'featured' => ['sometimes', 'boolean'],
'approved' => ['sometimes', 'boolean'],
];
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateSkillRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'name' => ['sometimes', 'required', 'string', 'max:255'],
'slug' => ['sometimes', 'required', 'string', 'max:255', Rule::unique('skills', 'slug')->ignore($this->route('skill'))],
'description' => ['sometimes', 'required', 'string'],
'url' => ['sometimes', 'required', 'url', 'max:255'],
'docs_url' => ['nullable', 'url', 'max:255'],
'logo_url' => ['nullable', 'url', 'max:255'],
'category' => ['sometimes', 'required', Rule::in(array_keys(config('skills.categories')))],
'install_instructions' => ['nullable', 'string'],
'example_prompt' => ['nullable', 'string'],
'requirements' => ['nullable', 'string', 'max:255'],
'tags' => ['sometimes', 'array'],
'tags.*' => ['string', 'max:50'],
'featured' => ['sometimes', 'boolean'],
'approved' => ['sometimes', 'boolean'],
];
}
}