1
0
This repository has been archived on 2021-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
Files
ttv-streamkit/app/Http/Requests/CreateDiscordWebhookMessage.php

51 lines
1.5 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest;
class CreateDiscordWebhookMessage extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
"enabled" => "required|boolean",
"discord_webhook_url" => "required|url|starts_with:https://discordapp.com/api/webhooks/,https://discord.com/api/webhooks/",
"username" => "nullable|string|max:50",
"avatar" => "nullable|file|image",
"delete_avatar" => "nullable|in:true,1",
"content" => "nullable|string|max:2000",
"embed_color" => [
"nullable",
"string",
"regex:/^#[0-9A-F]{6}$/i"
],
"embed_author_name" => "nullable|boolean",
"embed_author_url" => "nullable|boolean",
"embed_author_icon" => "nullable|boolean",
"embed_thumbnail" => "nullable|boolean",
"embed_title" => "nullable|string|max:191",
"embed_description" => "nullable|string|max:2000",
"embed_url" => "nullable|url|max:191",
"embed_image" => "nullable|boolean",
"embed_fields" => "nullable|json"
];
}
}