Http
The Playground Matrix provides controller and request handling.
playground-http
Provides the base classes, concerns, contracts and translations for API and Resource packages.
Package Information
- Packagist
- Source on GitHub
Configuration
You can publish the configuration file with:
php artisan vendor:publish --provider="Playground\Http\ServiceProvider" --tag="playground-config"
Environment Variables
PLAYGROUND_HTTP_LOAD_TRANSLATIONSConfig:
playground-http.load.translationsType:
boolDefault:
truePLAYGROUND_HTTP_PURIFIER_IFRAMESConfig:
playground-http.purifier.iframesType:
stringRegular Expression to match streaming providers.Default:
%^(https?:)?(\/\/www\.youtube(?:-nocookie)?\.com\/embed\/|\/\/player\.vimeo\.com\/)%Example:
nullPLAYGROUND_HTTP_PURIFIER_PATHConfig:
playground-http.purifier.pathType:
stringDefault:
''Example:
/tmp
<?php
/**
* Playground
*/
namespace Playground\Http\Requests\Concerns;
use HTMLPurifier;
/**
* \Playground\Http\Requests\Concerns\StoreContent
*/
trait StoreContent
{
protected ?HTMLPurifier $purifier = null;
protected ?string $safeIframeRegexp = '%^(https?:)?(\/\/www\.youtube(?:-nocookie)?\.com\/embed\/|\/\/player\.vimeo\.com\/)%';
/**
* Exorcise all html from the string.
*
* @uses \htmlspecialchars()
* @uses \strip_tags()
*/
public static function exorcise(mixed $content): string