diff --git a/_ide_helper.php b/_ide_helper.php index 1e2d852..fa8904d 100644 --- a/_ide_helper.php +++ b/_ide_helper.php @@ -23885,6 +23885,611 @@ public static function setSiteName($name) } } +namespace Barryvdh\Debugbar\Facades { + /** + * + * + * @method static void alert(mixed $message) + * @method static void critical(mixed $message) + * @method static void debug(mixed $message) + * @method static void emergency(mixed $message) + * @method static void error(mixed $message) + * @method static void info(mixed $message) + * @method static void log(mixed $message) + * @method static void notice(mixed $message) + * @method static void warning(mixed $message) + * @see \Barryvdh\Debugbar\LaravelDebugbar + */ + class Debugbar { + /** + * Returns the HTTP driver + * + * If no http driver where defined, a PhpHttpDriver is automatically created + * + * @return \DebugBar\HttpDriverInterface + * @static + */ + public static function getHttpDriver() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getHttpDriver(); + } + + /** + * Enable the Debugbar and boot, if not already booted. + * + * @static + */ + public static function enable() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->enable(); + } + + /** + * Boot the debugbar (add collectors, renderer and listener) + * + * @static + */ + public static function boot() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->boot(); + } + + /** + * + * + * @static + */ + public static function shouldCollect($name, $default = false) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->shouldCollect($name, $default); + } + + /** + * Adds a data collector + * + * @param \DebugBar\DataCollector\DataCollectorInterface $collector + * @throws DebugBarException + * @return \Barryvdh\Debugbar\LaravelDebugbar + * @static + */ + public static function addCollector($collector) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->addCollector($collector); + } + + /** + * Handle silenced errors + * + * @param $level + * @param $message + * @param string $file + * @param int $line + * @param array $context + * @throws \ErrorException + * @static + */ + public static function handleError($level, $message, $file = '', $line = 0, $context = []) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->handleError($level, $message, $file, $line, $context); + } + + /** + * Starts a measure + * + * @param string $name Internal name, used to stop the measure + * @param string $label Public name + * @param string|null $collector + * @static + */ + public static function startMeasure($name, $label = null, $collector = null) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->startMeasure($name, $label, $collector); + } + + /** + * Stops a measure + * + * @param string $name + * @static + */ + public static function stopMeasure($name) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->stopMeasure($name); + } + + /** + * Adds an exception to be profiled in the debug bar + * + * @param \Exception $e + * @deprecated in favor of addThrowable + * @static + */ + public static function addException($e) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->addException($e); + } + + /** + * Adds an exception to be profiled in the debug bar + * + * @param \Throwable $e + * @static + */ + public static function addThrowable($e) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->addThrowable($e); + } + + /** + * Returns a JavascriptRenderer for this instance + * + * @param string $baseUrl + * @param string $basePath + * @return \Barryvdh\Debugbar\JavascriptRenderer + * @static + */ + public static function getJavascriptRenderer($baseUrl = null, $basePath = null) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getJavascriptRenderer($baseUrl, $basePath); + } + + /** + * Modify the response and inject the debugbar (or data in headers) + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Response $response + * @return \Symfony\Component\HttpFoundation\Response + * @static + */ + public static function modifyResponse($request, $response) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->modifyResponse($request, $response); + } + + /** + * Check if the Debugbar is enabled + * + * @return boolean + * @static + */ + public static function isEnabled() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->isEnabled(); + } + + /** + * Collects the data from the collectors + * + * @return array + * @static + */ + public static function collect() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->collect(); + } + + /** + * Injects the web debug toolbar into the given Response. + * + * @param \Symfony\Component\HttpFoundation\Response $response A Response instance + * Based on https://github.com/symfony/WebProfilerBundle/blob/master/EventListener/WebDebugToolbarListener.php + * @static + */ + public static function injectDebugbar($response) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->injectDebugbar($response); + } + + /** + * Checks if there is stacked data in the session + * + * @return boolean + * @static + */ + public static function hasStackedData() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->hasStackedData(); + } + + /** + * Returns the data stacked in the session + * + * @param boolean $delete Whether to delete the data in the session + * @return array + * @static + */ + public static function getStackedData($delete = true) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getStackedData($delete); + } + + /** + * Disable the Debugbar + * + * @static + */ + public static function disable() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->disable(); + } + + /** + * Adds a measure + * + * @param string $label + * @param float $start + * @param float $end + * @param array|null $params + * @param string|null $collector + * @static + */ + public static function addMeasure($label, $start, $end, $params = [], $collector = null) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->addMeasure($label, $start, $end, $params, $collector); + } + + /** + * Utility function to measure the execution of a Closure + * + * @param string $label + * @param \Closure $closure + * @param string|null $collector + * @return mixed + * @static + */ + public static function measure($label, $closure, $collector = null) + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->measure($label, $closure, $collector); + } + + /** + * Collect data in a CLI request + * + * @return array + * @static + */ + public static function collectConsole() + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->collectConsole(); + } + + /** + * Adds a message to the MessagesCollector + * + * A message can be anything from an object to a string + * + * @param mixed $message + * @param string $label + * @static + */ + public static function addMessage($message, $label = 'info') + { + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->addMessage($message, $label); + } + + /** + * Checks if a data collector has been added + * + * @param string $name + * @return boolean + * @static + */ + public static function hasCollector($name) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->hasCollector($name); + } + + /** + * Returns a data collector + * + * @param string $name + * @return \DebugBar\DataCollector\DataCollectorInterface + * @throws DebugBarException + * @static + */ + public static function getCollector($name) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getCollector($name); + } + + /** + * Returns an array of all data collectors + * + * @return array[DataCollectorInterface] + * @static + */ + public static function getCollectors() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getCollectors(); + } + + /** + * Sets the request id generator + * + * @param \DebugBar\RequestIdGeneratorInterface $generator + * @return \Barryvdh\Debugbar\LaravelDebugbar + * @static + */ + public static function setRequestIdGenerator($generator) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->setRequestIdGenerator($generator); + } + + /** + * + * + * @return \DebugBar\RequestIdGeneratorInterface + * @static + */ + public static function getRequestIdGenerator() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getRequestIdGenerator(); + } + + /** + * Returns the id of the current request + * + * @return string + * @static + */ + public static function getCurrentRequestId() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getCurrentRequestId(); + } + + /** + * Sets the storage backend to use to store the collected data + * + * @param \DebugBar\StorageInterface $storage + * @return \Barryvdh\Debugbar\LaravelDebugbar + * @static + */ + public static function setStorage($storage = null) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->setStorage($storage); + } + + /** + * + * + * @return \DebugBar\StorageInterface + * @static + */ + public static function getStorage() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getStorage(); + } + + /** + * Checks if the data will be persisted + * + * @return boolean + * @static + */ + public static function isDataPersisted() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->isDataPersisted(); + } + + /** + * Sets the HTTP driver + * + * @param \DebugBar\HttpDriverInterface $driver + * @return \Barryvdh\Debugbar\LaravelDebugbar + * @static + */ + public static function setHttpDriver($driver) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->setHttpDriver($driver); + } + + /** + * Returns collected data + * + * Will collect the data if none have been collected yet + * + * @return array + * @static + */ + public static function getData() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getData(); + } + + /** + * Returns an array of HTTP headers containing the data + * + * @param string $headerName + * @param integer $maxHeaderLength + * @return array + * @static + */ + public static function getDataAsHeaders($headerName = 'phpdebugbar', $maxHeaderLength = 4096, $maxTotalHeaderLength = 250000) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getDataAsHeaders($headerName, $maxHeaderLength, $maxTotalHeaderLength); + } + + /** + * Sends the data through the HTTP headers + * + * @param bool $useOpenHandler + * @param string $headerName + * @param integer $maxHeaderLength + * @return \Barryvdh\Debugbar\LaravelDebugbar + * @static + */ + public static function sendDataInHeaders($useOpenHandler = null, $headerName = 'phpdebugbar', $maxHeaderLength = 4096) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->sendDataInHeaders($useOpenHandler, $headerName, $maxHeaderLength); + } + + /** + * Stacks the data in the session for later rendering + * + * @static + */ + public static function stackData() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->stackData(); + } + + /** + * Sets the key to use in the $_SESSION array + * + * @param string $ns + * @return \Barryvdh\Debugbar\LaravelDebugbar + * @static + */ + public static function setStackDataSessionNamespace($ns) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->setStackDataSessionNamespace($ns); + } + + /** + * Returns the key used in the $_SESSION array + * + * @return string + * @static + */ + public static function getStackDataSessionNamespace() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->getStackDataSessionNamespace(); + } + + /** + * Sets whether to only use the session to store stacked data even + * if a storage is enabled + * + * @param boolean $enabled + * @return \Barryvdh\Debugbar\LaravelDebugbar + * @static + */ + public static function setStackAlwaysUseSessionStorage($enabled = true) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->setStackAlwaysUseSessionStorage($enabled); + } + + /** + * Checks if the session is always used to store stacked data + * even if a storage is enabled + * + * @return boolean + * @static + */ + public static function isStackAlwaysUseSessionStorage() + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->isStackAlwaysUseSessionStorage(); + } + + /** + * + * + * @static + */ + public static function offsetSet($key, $value) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->offsetSet($key, $value); + } + + /** + * + * + * @static + */ + public static function offsetGet($key) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->offsetGet($key); + } + + /** + * + * + * @static + */ + public static function offsetExists($key) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->offsetExists($key); + } + + /** + * + * + * @static + */ + public static function offsetUnset($key) + { + //Method inherited from \DebugBar\DebugBar + /** @var \Barryvdh\Debugbar\LaravelDebugbar $instance */ + return $instance->offsetUnset($key); + } + + } + } + namespace Laravel\Socialite\Facades { /** * @@ -24653,6 +25258,17 @@ public static function getConfig() * @implements \Illuminate\Support\Enumerable */ class Collection { + /** + * + * + * @see \Barryvdh\Debugbar\ServiceProvider::register() + * @static + */ + public static function debug() + { + return \Illuminate\Support\Collection::debug(); + } + /** * * @@ -30076,6 +30692,7 @@ class JsonLd extends \Artesaos\SEOTools\Facades\JsonLd {} class SEOMeta extends \Artesaos\SEOTools\Facades\SEOMeta {} class Twitter extends \Artesaos\SEOTools\Facades\TwitterCard {} class OpenGraph extends \Artesaos\SEOTools\Facades\OpenGraph {} + class Debugbar extends \Barryvdh\Debugbar\Facades\Debugbar {} class Horizon extends \Laravel\Horizon\Horizon {} class Socialite extends \Laravel\Socialite\Facades\Socialite {} class Excel extends \Maatwebsite\Excel\Facades\Excel {} diff --git a/app/Http/Controllers/FrontMediaController.php b/app/Http/Controllers/FrontMediaController.php index 4836497..5634737 100644 --- a/app/Http/Controllers/FrontMediaController.php +++ b/app/Http/Controllers/FrontMediaController.php @@ -8,16 +8,24 @@ use App\Models\MemeMedia; use App\Services\TrackingAnalyticsService; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; class FrontMediaController extends Controller { public function init(Request $request) { + $skipCache = $request->input('sc') == '1'; + $cacheKey = 'front_media_init'; + + if (! $skipCache && Cache::has($cacheKey)) { + return response()->json(Cache::get($cacheKey)); + } + $meme = Meme::with('meme_media', 'background_media')->where('status', MemeGenerator::STATUS_COMPLETED)->inRandomOrder()->first(); $meme_media = MemeGenerator::getSuitableMemeMedia($meme, 15); - return response()->json([ + $response = [ 'success' => [ 'data' => [ 'init' => [ @@ -28,7 +36,13 @@ public function init(Request $request) ], ], ], - ]); + ]; + + if (! $skipCache) { + Cache::put($cacheKey, $response, 300); // Cache for 5 minutes + } + + return response()->json($response); } public function memes(Request $request) diff --git a/composer.json b/composer.json index 400fe92..e64d6dc 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "license": "MIT", "require": { "php": "^8.2", + "appstract/laravel-opcache": "^4.0", "artesaos/seotools": "^1.3", "inertiajs/inertia-laravel": "^2.0", "intervention/image": "^3.11", @@ -34,6 +35,7 @@ "vinkla/hashids": "^13.0" }, "require-dev": { + "barryvdh/laravel-debugbar": "^3.15", "barryvdh/laravel-ide-helper": "^3.5", "fakerphp/faker": "^1.23", "laravel/pail": "^1.2.2", diff --git a/composer.lock b/composer.lock index 372cb81..624e117 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,70 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5adaa56d5b09b43b9e7350387a135bf7", + "content-hash": "ef78ce386c5eee35cd5edc8050dff263", "packages": [ + { + "name": "appstract/laravel-opcache", + "version": "4.0.2", + "source": { + "type": "git", + "url": "https://github.com/appstract/laravel-opcache.git", + "reference": "d2ce88cddda6af54c14d1f9ceaaf94b54f38f9d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/appstract/laravel-opcache/zipball/d2ce88cddda6af54c14d1f9ceaaf94b54f38f9d3", + "reference": "d2ce88cddda6af54c14d1f9ceaaf94b54f38f9d3", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.3.1|^7.0", + "laravel/framework": ">=7.0", + "php": ">=7.2.5" + }, + "require-dev": { + "orchestra/testbench": "^5.0", + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Appstract\\Opcache\\OpcacheServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Appstract\\Opcache\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Olav van Schie", + "email": "mail@appstract.nl", + "homepage": "https://appstract.nl", + "role": "Developer" + } + ], + "description": "PHP OPcache Artisan commands for Laravel.", + "homepage": "https://github.com/appstract/laravel-opcache", + "keywords": [ + "Opcache", + "appstract", + "laravel", + "php" + ], + "support": { + "issues": "https://github.com/appstract/laravel-opcache/issues", + "source": "https://github.com/appstract/laravel-opcache/tree/4.0.2" + }, + "time": "2020-12-01T16:12:14+00:00" + }, { "name": "artesaos/seotools", "version": "v1.3.2", @@ -9797,6 +9859,91 @@ } ], "packages-dev": [ + { + "name": "barryvdh/laravel-debugbar", + "version": "v3.15.4", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-debugbar.git", + "reference": "c0667ea91f7185f1e074402c5788195e96bf8106" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/c0667ea91f7185f1e074402c5788195e96bf8106", + "reference": "c0667ea91f7185f1e074402c5788195e96bf8106", + "shasum": "" + }, + "require": { + "illuminate/routing": "^9|^10|^11|^12", + "illuminate/session": "^9|^10|^11|^12", + "illuminate/support": "^9|^10|^11|^12", + "php": "^8.1", + "php-debugbar/php-debugbar": "~2.1.1", + "symfony/finder": "^6|^7" + }, + "require-dev": { + "mockery/mockery": "^1.3.3", + "orchestra/testbench-dusk": "^7|^8|^9|^10", + "phpunit/phpunit": "^9.5.10|^10|^11", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar" + }, + "providers": [ + "Barryvdh\\Debugbar\\ServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "3.15-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Barryvdh\\Debugbar\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "PHP Debugbar integration for Laravel", + "keywords": [ + "debug", + "debugbar", + "dev", + "laravel", + "profiler", + "webprofiler" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-debugbar/issues", + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.15.4" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2025-04-16T06:32:06+00:00" + }, { "name": "barryvdh/laravel-ide-helper", "version": "v3.5.5", @@ -11534,6 +11681,76 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "php-debugbar/php-debugbar", + "version": "v2.1.6", + "source": { + "type": "git", + "url": "https://github.com/php-debugbar/php-debugbar.git", + "reference": "16fa68da5617220594aa5e33fa9de415f94784a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/16fa68da5617220594aa5e33fa9de415f94784a0", + "reference": "16fa68da5617220594aa5e33fa9de415f94784a0", + "shasum": "" + }, + "require": { + "php": "^8", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^4|^5|^6|^7" + }, + "require-dev": { + "dbrekelmans/bdi": "^1", + "phpunit/phpunit": "^8|^9", + "symfony/panther": "^1|^2.1", + "twig/twig": "^1.38|^2.7|^3.0" + }, + "suggest": { + "kriswallsmith/assetic": "The best way to manage assets", + "monolog/monolog": "Log using Monolog", + "predis/predis": "Redis storage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "DebugBar\\": "src/DebugBar/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maxime Bouroumeau-Fuseau", + "email": "maxime.bouroumeau@gmail.com", + "homepage": "http://maximebf.com" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Debug bar in the browser for php application", + "homepage": "https://github.com/php-debugbar/php-debugbar", + "keywords": [ + "debug", + "debug bar", + "debugbar", + "dev" + ], + "support": { + "issues": "https://github.com/php-debugbar/php-debugbar/issues", + "source": "https://github.com/php-debugbar/php-debugbar/tree/v2.1.6" + }, + "time": "2025-02-21T17:47:03+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", diff --git a/config/opcache.php b/config/opcache.php new file mode 100644 index 0000000..9f27377 --- /dev/null +++ b/config/opcache.php @@ -0,0 +1,30 @@ + env('OPCACHE_URL', config('app.url')), + 'prefix' => 'opcache-api', + 'verify' => true, + 'headers' => [], + 'directories' => [ + base_path('app'), + base_path('bootstrap'), + base_path('public'), + base_path('resources'), + base_path('routes'), + base_path('storage'), + base_path('vendor'), + ], + 'exclude' => [ + 'test', + 'Test', + 'tests', + 'Tests', + 'stub', + 'Stub', + 'stubs', + 'Stubs', + 'dumper', + 'Dumper', + 'Autoload', + ], +]; diff --git a/resources/js/modules/editor/partials/editor-controls.jsx b/resources/js/modules/editor/partials/editor-controls.jsx index 12f74de..82eb566 100644 --- a/resources/js/modules/editor/partials/editor-controls.jsx +++ b/resources/js/modules/editor/partials/editor-controls.jsx @@ -30,7 +30,7 @@ const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive = const handleRefresh = () => { handleReset(); - init(); + init(true); }; const togglePlayPause = () => { diff --git a/resources/js/stores/MediaStore.js b/resources/js/stores/MediaStore.js index 58a48df..a5fc3a4 100644 --- a/resources/js/stores/MediaStore.js +++ b/resources/js/stores/MediaStore.js @@ -133,7 +133,7 @@ const useMediaStore = create( set({ keywords: [] }); }, - init: async () => { + init: async (skipCache = false) => { const state = get(); // Skip API call completely if ALL initial values were set via props @@ -142,7 +142,12 @@ const useMediaStore = create( } try { - const response = await axiosInstance.post(route('api.app.init')); + const params = {}; + if (skipCache) { + params.sc = '1'; + } + + const response = await axiosInstance.post(route('api.app.init'), params); if (response?.data?.success?.data?.init) { const updates = {}; diff --git a/resources/js/ziggy.js b/resources/js/ziggy.js index d4a956e..51275a7 100644 --- a/resources/js/ziggy.js +++ b/resources/js/ziggy.js @@ -1,4 +1,4 @@ -const Ziggy = {"url":"https:\/\/memefa.st","port":null,"defaults":{},"routes":{"cashier.payment":{"uri":"stripe\/payment\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"cashier.webhook":{"uri":"stripe\/webhook","methods":["POST"]},"horizon.stats.index":{"uri":"chorizo\/api\/stats","methods":["GET","HEAD"]},"horizon.workload.index":{"uri":"chorizo\/api\/workload","methods":["GET","HEAD"]},"horizon.masters.index":{"uri":"chorizo\/api\/masters","methods":["GET","HEAD"]},"horizon.monitoring.index":{"uri":"chorizo\/api\/monitoring","methods":["GET","HEAD"]},"horizon.monitoring.store":{"uri":"chorizo\/api\/monitoring","methods":["POST"]},"horizon.monitoring-tag.paginate":{"uri":"chorizo\/api\/monitoring\/{tag}","methods":["GET","HEAD"],"parameters":["tag"]},"horizon.monitoring-tag.destroy":{"uri":"chorizo\/api\/monitoring\/{tag}","methods":["DELETE"],"wheres":{"tag":".*"},"parameters":["tag"]},"horizon.jobs-metrics.index":{"uri":"chorizo\/api\/metrics\/jobs","methods":["GET","HEAD"]},"horizon.jobs-metrics.show":{"uri":"chorizo\/api\/metrics\/jobs\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.queues-metrics.index":{"uri":"chorizo\/api\/metrics\/queues","methods":["GET","HEAD"]},"horizon.queues-metrics.show":{"uri":"chorizo\/api\/metrics\/queues\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.jobs-batches.index":{"uri":"chorizo\/api\/batches","methods":["GET","HEAD"]},"horizon.jobs-batches.show":{"uri":"chorizo\/api\/batches\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.jobs-batches.retry":{"uri":"chorizo\/api\/batches\/retry\/{id}","methods":["POST"],"parameters":["id"]},"horizon.pending-jobs.index":{"uri":"chorizo\/api\/jobs\/pending","methods":["GET","HEAD"]},"horizon.completed-jobs.index":{"uri":"chorizo\/api\/jobs\/completed","methods":["GET","HEAD"]},"horizon.silenced-jobs.index":{"uri":"chorizo\/api\/jobs\/silenced","methods":["GET","HEAD"]},"horizon.failed-jobs.index":{"uri":"chorizo\/api\/jobs\/failed","methods":["GET","HEAD"]},"horizon.failed-jobs.show":{"uri":"chorizo\/api\/jobs\/failed\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.retry-jobs.show":{"uri":"chorizo\/api\/jobs\/retry\/{id}","methods":["POST"],"parameters":["id"]},"horizon.jobs.show":{"uri":"chorizo\/api\/jobs\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.index":{"uri":"chorizo\/{view?}","methods":["GET","HEAD"],"wheres":{"view":"(.*)"},"parameters":["view"]},"sanctum.csrf-cookie":{"uri":"sanctum\/csrf-cookie","methods":["GET","HEAD"]},"api.pricing_page":{"uri":"api\/pricing","methods":["POST"]},"api.ai_hints":{"uri":"api\/ai-hints","methods":["POST"]},"api.basic_export.request":{"uri":"api\/basic-export\/request","methods":["POST"]},"api.basic_export.complete":{"uri":"api\/basic-export\/complete","methods":["POST"]},"api.user":{"uri":"api\/user","methods":["POST"]},"api.user.subscribe":{"uri":"api\/user\/subscribe","methods":["POST"]},"api.user.purchase":{"uri":"api\/user\/purchase","methods":["POST"]},"api.user.billing_portal":{"uri":"api\/user\/billing-portal","methods":["POST"]},"api.user.premium_export.request":{"uri":"api\/user\/premium-export\/request","methods":["POST"]},"api.user.premium_export.complete":{"uri":"api\/user\/premium-export\/complete","methods":["POST"]},"api.user.generate_meme":{"uri":"api\/user\/generate_meme","methods":["POST"]},"api.user.check_meme_job_status":{"uri":"api\/user\/generate_meme\/status","methods":["POST"]},"api.user.get_active_job":{"uri":"api\/user\/generate_meme\/active","methods":["POST"]},"api.user.get_meme_history":{"uri":"api\/user\/generate_meme\/history","methods":["POST"]},"api.app.init":{"uri":"api\/app\/init","methods":["POST"]},"api.app.memes":{"uri":"api\/app\/memes","methods":["POST"]},"api.app.search.memes":{"uri":"api\/app\/search\/memes","methods":["POST"]},"api.app.background":{"uri":"api\/app\/background","methods":["POST"]},"api.app.search.background":{"uri":"api\/app\/search\/background","methods":["POST"]},"api.app.select.meme":{"uri":"api\/app\/select\/meme","methods":["POST"]},"api.app.select.background":{"uri":"api\/app\/select\/background","methods":["POST"]},"api.app.save.meme":{"uri":"api\/app\/save\/meme","methods":["POST"]},"auth.google.redirect":{"uri":"auth\/google\/redirect","methods":["GET","HEAD"]},"auth.google.callback":{"uri":"auth\/google\/callback","methods":["GET","HEAD"]},"dashboard":{"uri":"dashboard","methods":["GET","HEAD"]},"subscribe.success":{"uri":"subscribe\/success","methods":["GET","HEAD"]},"subscribe.cancelled":{"uri":"subscribe\/cancelled","methods":["GET","HEAD"]},"purchase.success":{"uri":"purchase\/success","methods":["GET","HEAD"]},"purchase.cancelled":{"uri":"purchase\/cancelled","methods":["GET","HEAD"]},"admin.dashboard":{"uri":"admin","methods":["GET","HEAD"]},"admin.background-generation":{"uri":"admin\/background-generation","methods":["GET","HEAD"]},"admin.background-generation.generate":{"uri":"admin\/background-generation\/generate","methods":["POST"]},"admin.background-generation.save":{"uri":"admin\/background-generation\/save","methods":["POST"]},"admin.background-generation.delete":{"uri":"admin\/background-generation\/delete\/{id}","methods":["POST"],"parameters":["id"]},"profile.edit":{"uri":"settings\/profile","methods":["GET","HEAD"]},"profile.update":{"uri":"settings\/profile","methods":["PATCH"]},"profile.destroy":{"uri":"settings\/profile","methods":["DELETE"]},"password.edit":{"uri":"settings\/password","methods":["GET","HEAD"]},"password.update":{"uri":"settings\/password","methods":["PUT"]},"appearance":{"uri":"settings\/appearance","methods":["GET","HEAD"]},"register":{"uri":"register","methods":["GET","HEAD"]},"login":{"uri":"login","methods":["GET","HEAD"]},"password.request":{"uri":"forgot-password","methods":["GET","HEAD"]},"password.email":{"uri":"forgot-password","methods":["POST"]},"password.reset":{"uri":"reset-password\/{token}","methods":["GET","HEAD"],"parameters":["token"]},"password.store":{"uri":"reset-password","methods":["POST"]},"verification.notice":{"uri":"verify-email","methods":["GET","HEAD"]},"verification.verify":{"uri":"verify-email\/{id}\/{hash}","methods":["GET","HEAD"],"parameters":["id","hash"]},"verification.send":{"uri":"email\/verification-notification","methods":["POST"]},"password.confirm":{"uri":"confirm-password","methods":["GET","HEAD"]},"logout":{"uri":"logout","methods":["POST"]},"home":{"uri":"\/","methods":["GET","HEAD"]},"privacy":{"uri":"privacy","methods":["GET","HEAD"]},"terms":{"uri":"terms","methods":["GET","HEAD"]},"dmca-copyright":{"uri":"dmca-copyright","methods":["GET","HEAD"]},"memes.index":{"uri":"meme-library","methods":["GET","HEAD"]},"memes.search":{"uri":"meme-library\/{search}","methods":["GET","HEAD"],"parameters":["search"]},"memes.show":{"uri":"meme\/{slug}","methods":["GET","HEAD"],"parameters":["slug"]},"memes.og":{"uri":"meme\/og\/{ids}.jpg","methods":["GET","HEAD"],"parameters":["ids"]},"admin.duplicates":{"uri":"duplicates","methods":["GET","HEAD"]},"admin.duplicates.scan":{"uri":"duplicates\/scan","methods":["POST"]},"admin.duplicates.delete":{"uri":"duplicates\/delete","methods":["POST"]},"admin.duplicates.regenerate-hash":{"uri":"duplicates\/regenerate-hash","methods":["POST"]},"storage.local":{"uri":"storage\/{path}","methods":["GET","HEAD"],"wheres":{"path":".*"},"parameters":["path"]}}}; +const Ziggy = {"url":"https:\/\/memefa.st","port":null,"defaults":{},"routes":{"debugbar.openhandler":{"uri":"_debugbar\/open","methods":["GET","HEAD"]},"debugbar.clockwork":{"uri":"_debugbar\/clockwork\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"debugbar.assets.css":{"uri":"_debugbar\/assets\/stylesheets","methods":["GET","HEAD"]},"debugbar.assets.js":{"uri":"_debugbar\/assets\/javascript","methods":["GET","HEAD"]},"debugbar.cache.delete":{"uri":"_debugbar\/cache\/{key}\/{tags?}","methods":["DELETE"],"parameters":["key","tags"]},"debugbar.queries.explain":{"uri":"_debugbar\/queries\/explain","methods":["POST"]},"cashier.payment":{"uri":"stripe\/payment\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"cashier.webhook":{"uri":"stripe\/webhook","methods":["POST"]},"horizon.stats.index":{"uri":"chorizo\/api\/stats","methods":["GET","HEAD"]},"horizon.workload.index":{"uri":"chorizo\/api\/workload","methods":["GET","HEAD"]},"horizon.masters.index":{"uri":"chorizo\/api\/masters","methods":["GET","HEAD"]},"horizon.monitoring.index":{"uri":"chorizo\/api\/monitoring","methods":["GET","HEAD"]},"horizon.monitoring.store":{"uri":"chorizo\/api\/monitoring","methods":["POST"]},"horizon.monitoring-tag.paginate":{"uri":"chorizo\/api\/monitoring\/{tag}","methods":["GET","HEAD"],"parameters":["tag"]},"horizon.monitoring-tag.destroy":{"uri":"chorizo\/api\/monitoring\/{tag}","methods":["DELETE"],"wheres":{"tag":".*"},"parameters":["tag"]},"horizon.jobs-metrics.index":{"uri":"chorizo\/api\/metrics\/jobs","methods":["GET","HEAD"]},"horizon.jobs-metrics.show":{"uri":"chorizo\/api\/metrics\/jobs\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.queues-metrics.index":{"uri":"chorizo\/api\/metrics\/queues","methods":["GET","HEAD"]},"horizon.queues-metrics.show":{"uri":"chorizo\/api\/metrics\/queues\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.jobs-batches.index":{"uri":"chorizo\/api\/batches","methods":["GET","HEAD"]},"horizon.jobs-batches.show":{"uri":"chorizo\/api\/batches\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.jobs-batches.retry":{"uri":"chorizo\/api\/batches\/retry\/{id}","methods":["POST"],"parameters":["id"]},"horizon.pending-jobs.index":{"uri":"chorizo\/api\/jobs\/pending","methods":["GET","HEAD"]},"horizon.completed-jobs.index":{"uri":"chorizo\/api\/jobs\/completed","methods":["GET","HEAD"]},"horizon.silenced-jobs.index":{"uri":"chorizo\/api\/jobs\/silenced","methods":["GET","HEAD"]},"horizon.failed-jobs.index":{"uri":"chorizo\/api\/jobs\/failed","methods":["GET","HEAD"]},"horizon.failed-jobs.show":{"uri":"chorizo\/api\/jobs\/failed\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.retry-jobs.show":{"uri":"chorizo\/api\/jobs\/retry\/{id}","methods":["POST"],"parameters":["id"]},"horizon.jobs.show":{"uri":"chorizo\/api\/jobs\/{id}","methods":["GET","HEAD"],"parameters":["id"]},"horizon.index":{"uri":"chorizo\/{view?}","methods":["GET","HEAD"],"wheres":{"view":"(.*)"},"parameters":["view"]},"sanctum.csrf-cookie":{"uri":"sanctum\/csrf-cookie","methods":["GET","HEAD"]},"api.pricing_page":{"uri":"api\/pricing","methods":["POST"]},"api.ai_hints":{"uri":"api\/ai-hints","methods":["POST"]},"api.basic_export.request":{"uri":"api\/basic-export\/request","methods":["POST"]},"api.basic_export.complete":{"uri":"api\/basic-export\/complete","methods":["POST"]},"api.user":{"uri":"api\/user","methods":["POST"]},"api.user.subscribe":{"uri":"api\/user\/subscribe","methods":["POST"]},"api.user.purchase":{"uri":"api\/user\/purchase","methods":["POST"]},"api.user.billing_portal":{"uri":"api\/user\/billing-portal","methods":["POST"]},"api.user.premium_export.request":{"uri":"api\/user\/premium-export\/request","methods":["POST"]},"api.user.premium_export.complete":{"uri":"api\/user\/premium-export\/complete","methods":["POST"]},"api.user.generate_meme":{"uri":"api\/user\/generate_meme","methods":["POST"]},"api.user.check_meme_job_status":{"uri":"api\/user\/generate_meme\/status","methods":["POST"]},"api.user.get_active_job":{"uri":"api\/user\/generate_meme\/active","methods":["POST"]},"api.user.get_meme_history":{"uri":"api\/user\/generate_meme\/history","methods":["POST"]},"api.app.init":{"uri":"api\/app\/init","methods":["POST"]},"api.app.memes":{"uri":"api\/app\/memes","methods":["POST"]},"api.app.search.memes":{"uri":"api\/app\/search\/memes","methods":["POST"]},"api.app.background":{"uri":"api\/app\/background","methods":["POST"]},"api.app.search.background":{"uri":"api\/app\/search\/background","methods":["POST"]},"api.app.select.meme":{"uri":"api\/app\/select\/meme","methods":["POST"]},"api.app.select.background":{"uri":"api\/app\/select\/background","methods":["POST"]},"api.app.save.meme":{"uri":"api\/app\/save\/meme","methods":["POST"]},"auth.google.redirect":{"uri":"auth\/google\/redirect","methods":["GET","HEAD"]},"auth.google.callback":{"uri":"auth\/google\/callback","methods":["GET","HEAD"]},"dashboard":{"uri":"dashboard","methods":["GET","HEAD"]},"subscribe.success":{"uri":"subscribe\/success","methods":["GET","HEAD"]},"subscribe.cancelled":{"uri":"subscribe\/cancelled","methods":["GET","HEAD"]},"purchase.success":{"uri":"purchase\/success","methods":["GET","HEAD"]},"purchase.cancelled":{"uri":"purchase\/cancelled","methods":["GET","HEAD"]},"admin.dashboard":{"uri":"admin","methods":["GET","HEAD"]},"admin.background-generation":{"uri":"admin\/background-generation","methods":["GET","HEAD"]},"admin.background-generation.generate":{"uri":"admin\/background-generation\/generate","methods":["POST"]},"admin.background-generation.save":{"uri":"admin\/background-generation\/save","methods":["POST"]},"admin.background-generation.delete":{"uri":"admin\/background-generation\/delete\/{id}","methods":["POST"],"parameters":["id"]},"profile.edit":{"uri":"settings\/profile","methods":["GET","HEAD"]},"profile.update":{"uri":"settings\/profile","methods":["PATCH"]},"profile.destroy":{"uri":"settings\/profile","methods":["DELETE"]},"password.edit":{"uri":"settings\/password","methods":["GET","HEAD"]},"password.update":{"uri":"settings\/password","methods":["PUT"]},"appearance":{"uri":"settings\/appearance","methods":["GET","HEAD"]},"register":{"uri":"register","methods":["GET","HEAD"]},"login":{"uri":"login","methods":["GET","HEAD"]},"password.request":{"uri":"forgot-password","methods":["GET","HEAD"]},"password.email":{"uri":"forgot-password","methods":["POST"]},"password.reset":{"uri":"reset-password\/{token}","methods":["GET","HEAD"],"parameters":["token"]},"password.store":{"uri":"reset-password","methods":["POST"]},"verification.notice":{"uri":"verify-email","methods":["GET","HEAD"]},"verification.verify":{"uri":"verify-email\/{id}\/{hash}","methods":["GET","HEAD"],"parameters":["id","hash"]},"verification.send":{"uri":"email\/verification-notification","methods":["POST"]},"password.confirm":{"uri":"confirm-password","methods":["GET","HEAD"]},"logout":{"uri":"logout","methods":["POST"]},"home":{"uri":"\/","methods":["GET","HEAD"]},"privacy":{"uri":"privacy","methods":["GET","HEAD"]},"terms":{"uri":"terms","methods":["GET","HEAD"]},"dmca-copyright":{"uri":"dmca-copyright","methods":["GET","HEAD"]},"memes.index":{"uri":"meme-library","methods":["GET","HEAD"]},"memes.search":{"uri":"meme-library\/{search}","methods":["GET","HEAD"],"parameters":["search"]},"memes.show":{"uri":"meme\/{slug}","methods":["GET","HEAD"],"parameters":["slug"]},"memes.og":{"uri":"meme\/og\/{ids}.jpg","methods":["GET","HEAD"],"parameters":["ids"]},"admin.duplicates":{"uri":"duplicates","methods":["GET","HEAD"]},"admin.duplicates.scan":{"uri":"duplicates\/scan","methods":["POST"]},"admin.duplicates.delete":{"uri":"duplicates\/delete","methods":["POST"]},"admin.duplicates.regenerate-hash":{"uri":"duplicates\/regenerate-hash","methods":["POST"]},"storage.local":{"uri":"storage\/{path}","methods":["GET","HEAD"],"wheres":{"path":".*"},"parameters":["path"]}}}; if (typeof window !== 'undefined' && typeof window.Ziggy !== 'undefined') { Object.assign(Ziggy.routes, window.Ziggy.routes); } diff --git a/storage/debugbar/.gitignore b/storage/debugbar/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/debugbar/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore