diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 6c27ec2..0000000
--- a/.eslintignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.github/
-.vscode/
-vendor/
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 0e015c6..0000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,22 +0,0 @@
-module.exports = {
- env: {
- node: true,
- },
- extends: [
- "eslint:recommended",
- "plugin:vue/vue3-strongly-recommended",
- "prettier",
- "plugin:jsdoc/recommended",
- "plugin:@typescript-eslint/recommended",
- ],
- rules: {
- "vue/multi-word-component-names": "off",
- indent: ["off", 4, { ignoredNodes: ["ConditionalExpression"] }],
- "@typescript-eslint/no-inferrable-types": "off",
- },
- plugins: ["jsdoc", "@typescript-eslint"],
- parser: "vue-eslint-parser",
- parserOptions: {
- parser: "@typescript-eslint/parser",
- },
-};
diff --git a/.ls-lint.yml b/.ls-lint.yml
deleted file mode 100644
index 1269e23..0000000
--- a/.ls-lint.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-ls:
- resources/js/store:
- .ts: pascalcase
- "*":
- .js: camelcase
- .ts: camelcase
- .vue: pascalcase
- .dir: snakecase
- .type.ts: camelcase
-ignore:
- - node_modules
- - vendor
- - public/build
- - public/tinymce
diff --git a/.prettierrc.json b/.prettierrc.json
deleted file mode 100644
index 57d158c..0000000
--- a/.prettierrc.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "bracketSameLine": true,
- "tabWidth": 4,
- "htmlWhitespaceSensitivity": "css"
-}
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 47b1aed..0000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "editor.formatOnType": true,
- "editor.formatOnSave": true,
- "editor.codeActionsOnSave": {
- "source.fixAll.eslint": "explicit"
- },
- "editor.defaultFormatter": "esbenp.prettier-vscode",
- "[vue]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode"
- },
- "[javascript]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode"
- },
- "[php]": {
- // "editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
- "editor.defaultFormatter": "wongjn.php-sniffer"
- },
- "cSpell.words": ["TIMESTAMPDIFF"]
-}
diff --git a/README.md b/README.md
index bf0ddd9..1a4c26b 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@

-
+
@@ -27,27 +27,27 @@ Laravel has the most extensive and thorough [documentation](https://laravel.com/
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 over 2000 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.
+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 [Patreon page](https://patreon.com/taylorotwell).
+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)**
-- **[Cubet Techno Labs](https://cubettech.com)**
-- **[Cyber-Duck](https://cyber-duck.co.uk)**
-- **[Many](https://www.many.co.uk)**
-- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
-- **[DevSquad](https://devsquad.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)**
-- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
-- **[Lendio](https://lendio.com)**
## Contributing
diff --git a/_ide_helper.php b/_ide_helper.php
deleted file mode 100644
index fea124a..0000000
--- a/_ide_helper.php
+++ /dev/null
@@ -1,23355 +0,0 @@
-
- * @see https://github.com/barryvdh/laravel-ide-helper
- */
-
- namespace Illuminate\Support\Facades {
- /**
- *
- *
- * @see \Illuminate\Foundation\Application
- */
- class App {
- /**
- * Get the version number of the application.
- *
- * @return string
- * @static
- */
- public static function version()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->version();
- }
- /**
- * Run the given array of bootstrap classes.
- *
- * @param string[] $bootstrappers
- * @return void
- * @static
- */
- public static function bootstrapWith($bootstrappers)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->bootstrapWith($bootstrappers);
- }
- /**
- * Register a callback to run after loading the environment.
- *
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function afterLoadingEnvironment($callback)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->afterLoadingEnvironment($callback);
- }
- /**
- * Register a callback to run before a bootstrapper.
- *
- * @param string $bootstrapper
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function beforeBootstrapping($bootstrapper, $callback)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->beforeBootstrapping($bootstrapper, $callback);
- }
- /**
- * Register a callback to run after a bootstrapper.
- *
- * @param string $bootstrapper
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function afterBootstrapping($bootstrapper, $callback)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->afterBootstrapping($bootstrapper, $callback);
- }
- /**
- * Determine if the application has been bootstrapped before.
- *
- * @return bool
- * @static
- */
- public static function hasBeenBootstrapped()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->hasBeenBootstrapped();
- }
- /**
- * Set the base path for the application.
- *
- * @param string $basePath
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function setBasePath($basePath)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->setBasePath($basePath);
- }
- /**
- * Get the path to the application "app" directory.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function path($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->path($path);
- }
- /**
- * Set the application directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function useAppPath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->useAppPath($path);
- }
- /**
- * Get the base path of the Laravel installation.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function basePath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->basePath($path);
- }
- /**
- * Get the path to the bootstrap directory.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function bootstrapPath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->bootstrapPath($path);
- }
- /**
- * Set the bootstrap file directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function useBootstrapPath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->useBootstrapPath($path);
- }
- /**
- * Get the path to the application configuration files.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function configPath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->configPath($path);
- }
- /**
- * Set the configuration directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function useConfigPath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->useConfigPath($path);
- }
- /**
- * Get the path to the database directory.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function databasePath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->databasePath($path);
- }
- /**
- * Set the database directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function useDatabasePath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->useDatabasePath($path);
- }
- /**
- * Get the path to the language files.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function langPath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->langPath($path);
- }
- /**
- * Set the language file directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function useLangPath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->useLangPath($path);
- }
- /**
- * Get the path to the public / web directory.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function publicPath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->publicPath($path);
- }
- /**
- * Set the public / web directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function usePublicPath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->usePublicPath($path);
- }
- /**
- * Get the path to the storage directory.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function storagePath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->storagePath($path);
- }
- /**
- * Set the storage directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function useStoragePath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->useStoragePath($path);
- }
- /**
- * Get the path to the resources directory.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function resourcePath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->resourcePath($path);
- }
- /**
- * Get the path to the views directory.
- *
- * This method returns the first configured path in the array of view paths.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function viewPath($path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->viewPath($path);
- }
- /**
- * Join the given paths together.
- *
- * @param string $basePath
- * @param string $path
- * @return string
- * @static
- */
- public static function joinPaths($basePath, $path = '')
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->joinPaths($basePath, $path);
- }
- /**
- * Get the path to the environment file directory.
- *
- * @return string
- * @static
- */
- public static function environmentPath()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->environmentPath();
- }
- /**
- * Set the directory for the environment file.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function useEnvironmentPath($path)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->useEnvironmentPath($path);
- }
- /**
- * Set the environment file to be loaded during bootstrapping.
- *
- * @param string $file
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function loadEnvironmentFrom($file)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->loadEnvironmentFrom($file);
- }
- /**
- * Get the environment file the application is using.
- *
- * @return string
- * @static
- */
- public static function environmentFile()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->environmentFile();
- }
- /**
- * Get the fully qualified path to the environment file.
- *
- * @return string
- * @static
- */
- public static function environmentFilePath()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->environmentFilePath();
- }
- /**
- * Get or check the current application environment.
- *
- * @param string|array $environments
- * @return string|bool
- * @static
- */
- public static function environment(...$environments)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->environment(...$environments);
- }
- /**
- * Determine if the application is in the local environment.
- *
- * @return bool
- * @static
- */
- public static function isLocal()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isLocal();
- }
- /**
- * Determine if the application is in the production environment.
- *
- * @return bool
- * @static
- */
- public static function isProduction()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isProduction();
- }
- /**
- * Detect the application's current environment.
- *
- * @param \Closure $callback
- * @return string
- * @static
- */
- public static function detectEnvironment($callback)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->detectEnvironment($callback);
- }
- /**
- * Determine if the application is running in the console.
- *
- * @return bool
- * @static
- */
- public static function runningInConsole()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->runningInConsole();
- }
- /**
- * Determine if the application is running unit tests.
- *
- * @return bool
- * @static
- */
- public static function runningUnitTests()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->runningUnitTests();
- }
- /**
- * Determine if the application is running with debug mode enabled.
- *
- * @return bool
- * @static
- */
- public static function hasDebugModeEnabled()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->hasDebugModeEnabled();
- }
- /**
- * Register all of the configured providers.
- *
- * @return void
- * @static
- */
- public static function registerConfiguredProviders()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->registerConfiguredProviders();
- }
- /**
- * Register a service provider with the application.
- *
- * @param \Illuminate\Support\ServiceProvider|string $provider
- * @param bool $force
- * @return \Illuminate\Support\ServiceProvider
- * @static
- */
- public static function register($provider, $force = false)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->register($provider, $force);
- }
- /**
- * Get the registered service provider instance if it exists.
- *
- * @param \Illuminate\Support\ServiceProvider|string $provider
- * @return \Illuminate\Support\ServiceProvider|null
- * @static
- */
- public static function getProvider($provider)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getProvider($provider);
- }
- /**
- * Get the registered service provider instances if any exist.
- *
- * @param \Illuminate\Support\ServiceProvider|string $provider
- * @return array
- * @static
- */
- public static function getProviders($provider)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getProviders($provider);
- }
- /**
- * Resolve a service provider instance from the class name.
- *
- * @param string $provider
- * @return \Illuminate\Support\ServiceProvider
- * @static
- */
- public static function resolveProvider($provider)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->resolveProvider($provider);
- }
- /**
- * Load and boot all of the remaining deferred providers.
- *
- * @return void
- * @static
- */
- public static function loadDeferredProviders()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->loadDeferredProviders();
- }
- /**
- * Load the provider for a deferred service.
- *
- * @param string $service
- * @return void
- * @static
- */
- public static function loadDeferredProvider($service)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->loadDeferredProvider($service);
- }
- /**
- * Register a deferred provider and service.
- *
- * @param string $provider
- * @param string|null $service
- * @return void
- * @static
- */
- public static function registerDeferredProvider($provider, $service = null)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->registerDeferredProvider($provider, $service);
- }
- /**
- * Resolve the given type from the container.
- *
- * @param string $abstract
- * @param array $parameters
- * @return mixed
- * @static
- */
- public static function make($abstract, $parameters = [])
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->make($abstract, $parameters);
- }
- /**
- * Determine if the given abstract type has been bound.
- *
- * @param string $abstract
- * @return bool
- * @static
- */
- public static function bound($abstract)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->bound($abstract);
- }
- /**
- * Determine if the application has booted.
- *
- * @return bool
- * @static
- */
- public static function isBooted()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isBooted();
- }
- /**
- * Boot the application's service providers.
- *
- * @return void
- * @static
- */
- public static function boot()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->boot();
- }
- /**
- * Register a new boot listener.
- *
- * @param callable $callback
- * @return void
- * @static
- */
- public static function booting($callback)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->booting($callback);
- }
- /**
- * Register a new "booted" listener.
- *
- * @param callable $callback
- * @return void
- * @static
- */
- public static function booted($callback)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->booted($callback);
- }
- /**
- * {@inheritdoc}
- *
- * @return \Symfony\Component\HttpFoundation\Response
- * @static
- */
- public static function handle($request, $type = 1, $catch = true)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->handle($request, $type, $catch);
- }
- /**
- * Determine if middleware has been disabled for the application.
- *
- * @return bool
- * @static
- */
- public static function shouldSkipMiddleware()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->shouldSkipMiddleware();
- }
- /**
- * Get the path to the cached services.php file.
- *
- * @return string
- * @static
- */
- public static function getCachedServicesPath()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getCachedServicesPath();
- }
- /**
- * Get the path to the cached packages.php file.
- *
- * @return string
- * @static
- */
- public static function getCachedPackagesPath()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getCachedPackagesPath();
- }
- /**
- * Determine if the application configuration is cached.
- *
- * @return bool
- * @static
- */
- public static function configurationIsCached()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->configurationIsCached();
- }
- /**
- * Get the path to the configuration cache file.
- *
- * @return string
- * @static
- */
- public static function getCachedConfigPath()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getCachedConfigPath();
- }
- /**
- * Determine if the application routes are cached.
- *
- * @return bool
- * @static
- */
- public static function routesAreCached()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->routesAreCached();
- }
- /**
- * Get the path to the routes cache file.
- *
- * @return string
- * @static
- */
- public static function getCachedRoutesPath()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getCachedRoutesPath();
- }
- /**
- * Determine if the application events are cached.
- *
- * @return bool
- * @static
- */
- public static function eventsAreCached()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->eventsAreCached();
- }
- /**
- * Get the path to the events cache file.
- *
- * @return string
- * @static
- */
- public static function getCachedEventsPath()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getCachedEventsPath();
- }
- /**
- * Add new prefix to list of absolute path prefixes.
- *
- * @param string $prefix
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function addAbsoluteCachePathPrefix($prefix)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->addAbsoluteCachePathPrefix($prefix);
- }
- /**
- * Get an instance of the maintenance mode manager implementation.
- *
- * @return \Illuminate\Contracts\Foundation\MaintenanceMode
- * @static
- */
- public static function maintenanceMode()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->maintenanceMode();
- }
- /**
- * Determine if the application is currently down for maintenance.
- *
- * @return bool
- * @static
- */
- public static function isDownForMaintenance()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isDownForMaintenance();
- }
- /**
- * Throw an HttpException with the given data.
- *
- * @param int $code
- * @param string $message
- * @param array $headers
- * @return \Illuminate\Foundation\never
- * @throws \Symfony\Component\HttpKernel\Exception\HttpException
- * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
- * @static
- */
- public static function abort($code, $message = '', $headers = [])
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->abort($code, $message, $headers);
- }
- /**
- * Register a terminating callback with the application.
- *
- * @param callable|string $callback
- * @return \Illuminate\Foundation\Application
- * @static
- */
- public static function terminating($callback)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->terminating($callback);
- }
- /**
- * Terminate the application.
- *
- * @return void
- * @static
- */
- public static function terminate()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->terminate();
- }
- /**
- * Get the service providers that have been loaded.
- *
- * @return array
- * @static
- */
- public static function getLoadedProviders()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getLoadedProviders();
- }
- /**
- * Determine if the given service provider is loaded.
- *
- * @param string $provider
- * @return bool
- * @static
- */
- public static function providerIsLoaded($provider)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->providerIsLoaded($provider);
- }
- /**
- * Get the application's deferred services.
- *
- * @return array
- * @static
- */
- public static function getDeferredServices()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getDeferredServices();
- }
- /**
- * Set the application's deferred services.
- *
- * @param array $services
- * @return void
- * @static
- */
- public static function setDeferredServices($services)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->setDeferredServices($services);
- }
- /**
- * Add an array of services to the application's deferred services.
- *
- * @param array $services
- * @return void
- * @static
- */
- public static function addDeferredServices($services)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->addDeferredServices($services);
- }
- /**
- * Determine if the given service is a deferred service.
- *
- * @param string $service
- * @return bool
- * @static
- */
- public static function isDeferredService($service)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isDeferredService($service);
- }
- /**
- * Configure the real-time facade namespace.
- *
- * @param string $namespace
- * @return void
- * @static
- */
- public static function provideFacades($namespace)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->provideFacades($namespace);
- }
- /**
- * Get the current application locale.
- *
- * @return string
- * @static
- */
- public static function getLocale()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getLocale();
- }
- /**
- * Get the current application locale.
- *
- * @return string
- * @static
- */
- public static function currentLocale()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->currentLocale();
- }
- /**
- * Get the current application fallback locale.
- *
- * @return string
- * @static
- */
- public static function getFallbackLocale()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getFallbackLocale();
- }
- /**
- * Set the current application locale.
- *
- * @param string $locale
- * @return void
- * @static
- */
- public static function setLocale($locale)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->setLocale($locale);
- }
- /**
- * Set the current application fallback locale.
- *
- * @param string $fallbackLocale
- * @return void
- * @static
- */
- public static function setFallbackLocale($fallbackLocale)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->setFallbackLocale($fallbackLocale);
- }
- /**
- * Determine if the application locale is the given locale.
- *
- * @param string $locale
- * @return bool
- * @static
- */
- public static function isLocale($locale)
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isLocale($locale);
- }
- /**
- * Register the core class aliases in the container.
- *
- * @return void
- * @static
- */
- public static function registerCoreContainerAliases()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->registerCoreContainerAliases();
- }
- /**
- * Flush the container of all bindings and resolved instances.
- *
- * @return void
- * @static
- */
- public static function flush()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->flush();
- }
- /**
- * Get the application namespace.
- *
- * @return string
- * @throws \RuntimeException
- * @static
- */
- public static function getNamespace()
- {
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getNamespace();
- }
- /**
- * Define a contextual binding.
- *
- * @param array|string $concrete
- * @return \Illuminate\Contracts\Container\ContextualBindingBuilder
- * @static
- */
- public static function when($concrete)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->when($concrete);
- }
- /**
- * Returns true if the container can return an entry for the given identifier.
- *
- * Returns false otherwise.
- *
- * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
- * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
- *
- * @return bool
- * @param string $id Identifier of the entry to look for.
- * @return bool
- * @static
- */
- public static function has($id)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->has($id);
- }
- /**
- * Determine if the given abstract type has been resolved.
- *
- * @param string $abstract
- * @return bool
- * @static
- */
- public static function resolved($abstract)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->resolved($abstract);
- }
- /**
- * Determine if a given type is shared.
- *
- * @param string $abstract
- * @return bool
- * @static
- */
- public static function isShared($abstract)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isShared($abstract);
- }
- /**
- * Determine if a given string is an alias.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function isAlias($name)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->isAlias($name);
- }
- /**
- * Register a binding with the container.
- *
- * @param string $abstract
- * @param \Closure|string|null $concrete
- * @param bool $shared
- * @return void
- * @throws \TypeError
- * @static
- */
- public static function bind($abstract, $concrete = null, $shared = false)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->bind($abstract, $concrete, $shared);
- }
- /**
- * Determine if the container has a method binding.
- *
- * @param string $method
- * @return bool
- * @static
- */
- public static function hasMethodBinding($method)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->hasMethodBinding($method);
- }
- /**
- * Bind a callback to resolve with Container::call.
- *
- * @param array|string $method
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function bindMethod($method, $callback)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->bindMethod($method, $callback);
- }
- /**
- * Get the method binding for the given method.
- *
- * @param string $method
- * @param mixed $instance
- * @return mixed
- * @static
- */
- public static function callMethodBinding($method, $instance)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->callMethodBinding($method, $instance);
- }
- /**
- * Add a contextual binding to the container.
- *
- * @param string $concrete
- * @param string $abstract
- * @param \Closure|string $implementation
- * @return void
- * @static
- */
- public static function addContextualBinding($concrete, $abstract, $implementation)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->addContextualBinding($concrete, $abstract, $implementation);
- }
- /**
- * Register a binding if it hasn't already been registered.
- *
- * @param string $abstract
- * @param \Closure|string|null $concrete
- * @param bool $shared
- * @return void
- * @static
- */
- public static function bindIf($abstract, $concrete = null, $shared = false)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->bindIf($abstract, $concrete, $shared);
- }
- /**
- * Register a shared binding in the container.
- *
- * @param string $abstract
- * @param \Closure|string|null $concrete
- * @return void
- * @static
- */
- public static function singleton($abstract, $concrete = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->singleton($abstract, $concrete);
- }
- /**
- * Register a shared binding if it hasn't already been registered.
- *
- * @param string $abstract
- * @param \Closure|string|null $concrete
- * @return void
- * @static
- */
- public static function singletonIf($abstract, $concrete = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->singletonIf($abstract, $concrete);
- }
- /**
- * Register a scoped binding in the container.
- *
- * @param string $abstract
- * @param \Closure|string|null $concrete
- * @return void
- * @static
- */
- public static function scoped($abstract, $concrete = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->scoped($abstract, $concrete);
- }
- /**
- * Register a scoped binding if it hasn't already been registered.
- *
- * @param string $abstract
- * @param \Closure|string|null $concrete
- * @return void
- * @static
- */
- public static function scopedIf($abstract, $concrete = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->scopedIf($abstract, $concrete);
- }
- /**
- * "Extend" an abstract type in the container.
- *
- * @param string $abstract
- * @param \Closure $closure
- * @return void
- * @throws \InvalidArgumentException
- * @static
- */
- public static function extend($abstract, $closure)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->extend($abstract, $closure);
- }
- /**
- * Register an existing instance as shared in the container.
- *
- * @param string $abstract
- * @param mixed $instance
- * @return mixed
- * @static
- */
- public static function instance($abstract, $instance)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->instance($abstract, $instance);
- }
- /**
- * Assign a set of tags to a given binding.
- *
- * @param array|string $abstracts
- * @param array|mixed $tags
- * @return void
- * @static
- */
- public static function tag($abstracts, $tags)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->tag($abstracts, $tags);
- }
- /**
- * Resolve all of the bindings for a given tag.
- *
- * @param string $tag
- * @return \Illuminate\Container\iterable
- * @static
- */
- public static function tagged($tag)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->tagged($tag);
- }
- /**
- * Alias a type to a different name.
- *
- * @param string $abstract
- * @param string $alias
- * @return void
- * @throws \LogicException
- * @static
- */
- public static function alias($abstract, $alias)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->alias($abstract, $alias);
- }
- /**
- * Bind a new callback to an abstract's rebind event.
- *
- * @param string $abstract
- * @param \Closure $callback
- * @return mixed
- * @static
- */
- public static function rebinding($abstract, $callback)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->rebinding($abstract, $callback);
- }
- /**
- * Refresh an instance on the given target and method.
- *
- * @param string $abstract
- * @param mixed $target
- * @param string $method
- * @return mixed
- * @static
- */
- public static function refresh($abstract, $target, $method)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->refresh($abstract, $target, $method);
- }
- /**
- * Wrap the given closure such that its dependencies will be injected when executed.
- *
- * @param \Closure $callback
- * @param array $parameters
- * @return \Closure
- * @static
- */
- public static function wrap($callback, $parameters = [])
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->wrap($callback, $parameters);
- }
- /**
- * Call the given Closure / class@method and inject its dependencies.
- *
- * @param callable|string $callback
- * @param array $parameters
- * @param string|null $defaultMethod
- * @return mixed
- * @throws \InvalidArgumentException
- * @static
- */
- public static function call($callback, $parameters = [], $defaultMethod = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->call($callback, $parameters, $defaultMethod);
- }
- /**
- * Get a closure to resolve the given type from the container.
- *
- * @param string $abstract
- * @return \Closure
- * @static
- */
- public static function factory($abstract)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->factory($abstract);
- }
- /**
- * An alias function name for make().
- *
- * @param string|callable $abstract
- * @param array $parameters
- * @return mixed
- * @throws \Illuminate\Contracts\Container\BindingResolutionException
- * @static
- */
- public static function makeWith($abstract, $parameters = [])
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->makeWith($abstract, $parameters);
- }
- /**
- * Finds an entry of the container by its identifier and returns it.
- *
- * @return mixed
- * @param string $id Identifier of the entry to look for.
- * @throws NotFoundExceptionInterface No entry was found for **this** identifier.
- * @throws ContainerExceptionInterface Error while retrieving the entry.
- * @return mixed Entry.
- * @static
- */
- public static function get($id)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->get($id);
- }
- /**
- * Instantiate a concrete instance of the given type.
- *
- * @param \Closure|string $concrete
- * @return mixed
- * @throws \Illuminate\Contracts\Container\BindingResolutionException
- * @throws \Illuminate\Contracts\Container\CircularDependencyException
- * @static
- */
- public static function build($concrete)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->build($concrete);
- }
- /**
- * Register a new before resolving callback for all types.
- *
- * @param \Closure|string $abstract
- * @param \Closure|null $callback
- * @return void
- * @static
- */
- public static function beforeResolving($abstract, $callback = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->beforeResolving($abstract, $callback);
- }
- /**
- * Register a new resolving callback.
- *
- * @param \Closure|string $abstract
- * @param \Closure|null $callback
- * @return void
- * @static
- */
- public static function resolving($abstract, $callback = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->resolving($abstract, $callback);
- }
- /**
- * Register a new after resolving callback for all types.
- *
- * @param \Closure|string $abstract
- * @param \Closure|null $callback
- * @return void
- * @static
- */
- public static function afterResolving($abstract, $callback = null)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->afterResolving($abstract, $callback);
- }
- /**
- * Get the container's bindings.
- *
- * @return array
- * @static
- */
- public static function getBindings()
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getBindings();
- }
- /**
- * Get the alias for an abstract if available.
- *
- * @param string $abstract
- * @return string
- * @static
- */
- public static function getAlias($abstract)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->getAlias($abstract);
- }
- /**
- * Remove all of the extender callbacks for a given type.
- *
- * @param string $abstract
- * @return void
- * @static
- */
- public static function forgetExtenders($abstract)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->forgetExtenders($abstract);
- }
- /**
- * Remove a resolved instance from the instance cache.
- *
- * @param string $abstract
- * @return void
- * @static
- */
- public static function forgetInstance($abstract)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->forgetInstance($abstract);
- }
- /**
- * Clear all of the instances from the container.
- *
- * @return void
- * @static
- */
- public static function forgetInstances()
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->forgetInstances();
- }
- /**
- * Clear all of the scoped instances from the container.
- *
- * @return void
- * @static
- */
- public static function forgetScopedInstances()
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->forgetScopedInstances();
- }
- /**
- * Get the globally available instance of the container.
- *
- * @return static
- * @static
- */
- public static function getInstance()
- { //Method inherited from \Illuminate\Container\Container
- return \Illuminate\Foundation\Application::getInstance();
- }
- /**
- * Set the shared instance of the container.
- *
- * @param \Illuminate\Contracts\Container\Container|null $container
- * @return \Illuminate\Contracts\Container\Container|static
- * @static
- */
- public static function setInstance($container = null)
- { //Method inherited from \Illuminate\Container\Container
- return \Illuminate\Foundation\Application::setInstance($container);
- }
- /**
- * Determine if a given offset exists.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function offsetExists($key)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->offsetExists($key);
- }
- /**
- * Get the value at a given offset.
- *
- * @param string $key
- * @return mixed
- * @static
- */
- public static function offsetGet($key)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- return $instance->offsetGet($key);
- }
- /**
- * Set the value at a given offset.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function offsetSet($key, $value)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->offsetSet($key, $value);
- }
- /**
- * Unset the value at a given offset.
- *
- * @param string $key
- * @return void
- * @static
- */
- public static function offsetUnset($key)
- { //Method inherited from \Illuminate\Container\Container
- /** @var \Illuminate\Foundation\Application $instance */
- $instance->offsetUnset($key);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Foundation\Application::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Foundation\Application::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Foundation\Application::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Foundation\Application::flushMacros();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Console\Kernel
- */
- class Artisan {
- /**
- * Re-route the Symfony command events to their Laravel counterparts.
- *
- * @internal
- * @return \App\Console\Kernel
- * @static
- */
- public static function rerouteSymfonyCommandEvents()
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->rerouteSymfonyCommandEvents();
- }
- /**
- * Run the console application.
- *
- * @param \Symfony\Component\Console\Input\InputInterface $input
- * @param \Symfony\Component\Console\Output\OutputInterface|null $output
- * @return int
- * @static
- */
- public static function handle($input, $output = null)
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->handle($input, $output);
- }
- /**
- * Terminate the application.
- *
- * @param \Symfony\Component\Console\Input\InputInterface $input
- * @param int $status
- * @return void
- * @static
- */
- public static function terminate($input, $status)
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- $instance->terminate($input, $status);
- }
- /**
- * Register a callback to be invoked when the command lifecycle duration exceeds a given amount of time.
- *
- * @param \DateTimeInterface|\Carbon\CarbonInterval|float|int $threshold
- * @param callable $handler
- * @return void
- * @static
- */
- public static function whenCommandLifecycleIsLongerThan($threshold, $handler)
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- $instance->whenCommandLifecycleIsLongerThan($threshold, $handler);
- }
- /**
- * When the command being handled started.
- *
- * @return \Illuminate\Support\Carbon|null
- * @static
- */
- public static function commandStartedAt()
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->commandStartedAt();
- }
- /**
- * Register a Closure based command with the application.
- *
- * @param string $signature
- * @param \Closure $callback
- * @return \Illuminate\Foundation\Console\ClosureCommand
- * @static
- */
- public static function command($signature, $callback)
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->command($signature, $callback);
- }
- /**
- * Register the given command with the console application.
- *
- * @param \Symfony\Component\Console\Command\Command $command
- * @return void
- * @static
- */
- public static function registerCommand($command)
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- $instance->registerCommand($command);
- }
- /**
- * Run an Artisan console command by name.
- *
- * @param string $command
- * @param array $parameters
- * @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer
- * @return int
- * @throws \Symfony\Component\Console\Exception\CommandNotFoundException
- * @static
- */
- public static function call($command, $parameters = [], $outputBuffer = null)
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->call($command, $parameters, $outputBuffer);
- }
- /**
- * Queue the given console command.
- *
- * @param string $command
- * @param array $parameters
- * @return \Illuminate\Foundation\Bus\PendingDispatch
- * @static
- */
- public static function queue($command, $parameters = [])
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->queue($command, $parameters);
- }
- /**
- * Get all of the commands registered with the console.
- *
- * @return array
- * @static
- */
- public static function all()
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->all();
- }
- /**
- * Get the output for the last run command.
- *
- * @return string
- * @static
- */
- public static function output()
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- return $instance->output();
- }
- /**
- * Bootstrap the application for artisan commands.
- *
- * @return void
- * @static
- */
- public static function bootstrap()
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- $instance->bootstrap();
- }
- /**
- * Bootstrap the application without booting service providers.
- *
- * @return void
- * @static
- */
- public static function bootstrapWithoutBootingProviders()
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- $instance->bootstrapWithoutBootingProviders();
- }
- /**
- * Set the Artisan application instance.
- *
- * @param \Illuminate\Console\Application|null $artisan
- * @return void
- * @static
- */
- public static function setArtisan($artisan)
- { //Method inherited from \Illuminate\Foundation\Console\Kernel
- /** @var \App\Console\Kernel $instance */
- $instance->setArtisan($artisan);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Auth\AuthManager
- * @see \Illuminate\Auth\SessionGuard
- */
- class Auth {
- /**
- * Attempt to get the guard from the local cache.
- *
- * @param string|null $name
- * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard
- * @static
- */
- public static function guard($name = null)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->guard($name);
- }
- /**
- * Create a session based authentication guard.
- *
- * @param string $name
- * @param array $config
- * @return \Illuminate\Auth\SessionGuard
- * @static
- */
- public static function createSessionDriver($name, $config)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->createSessionDriver($name, $config);
- }
- /**
- * Create a token based authentication guard.
- *
- * @param string $name
- * @param array $config
- * @return \Illuminate\Auth\TokenGuard
- * @static
- */
- public static function createTokenDriver($name, $config)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->createTokenDriver($name, $config);
- }
- /**
- * Get the default authentication driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the default guard driver the factory should serve.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function shouldUse($name)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- $instance->shouldUse($name);
- }
- /**
- * Set the default authentication driver name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- $instance->setDefaultDriver($name);
- }
- /**
- * Register a new callback based request guard.
- *
- * @param string $driver
- * @param callable $callback
- * @return \Illuminate\Auth\AuthManager
- * @static
- */
- public static function viaRequest($driver, $callback)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->viaRequest($driver, $callback);
- }
- /**
- * Get the user resolver callback.
- *
- * @return \Closure
- * @static
- */
- public static function userResolver()
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->userResolver();
- }
- /**
- * Set the callback to be used to resolve users.
- *
- * @param \Closure $userResolver
- * @return \Illuminate\Auth\AuthManager
- * @static
- */
- public static function resolveUsersUsing($userResolver)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->resolveUsersUsing($userResolver);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Auth\AuthManager
- * @static
- */
- public static function extend($driver, $callback)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Register a custom provider creator Closure.
- *
- * @param string $name
- * @param \Closure $callback
- * @return \Illuminate\Auth\AuthManager
- * @static
- */
- public static function provider($name, $callback)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->provider($name, $callback);
- }
- /**
- * Determines if any guards have already been resolved.
- *
- * @return bool
- * @static
- */
- public static function hasResolvedGuards()
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->hasResolvedGuards();
- }
- /**
- * Forget all of the resolved guard instances.
- *
- * @return \Illuminate\Auth\AuthManager
- * @static
- */
- public static function forgetGuards()
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->forgetGuards();
- }
- /**
- * Set the application instance used by the manager.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return \Illuminate\Auth\AuthManager
- * @static
- */
- public static function setApplication($app)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->setApplication($app);
- }
- /**
- * Create the user provider implementation for the driver.
- *
- * @param string|null $provider
- * @return \Illuminate\Contracts\Auth\UserProvider|null
- * @throws \InvalidArgumentException
- * @static
- */
- public static function createUserProvider($provider = null)
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->createUserProvider($provider);
- }
- /**
- * Get the default user provider name.
- *
- * @return string
- * @static
- */
- public static function getDefaultUserProvider()
- {
- /** @var \Illuminate\Auth\AuthManager $instance */
- return $instance->getDefaultUserProvider();
- }
- /**
- * Get the currently authenticated user.
- *
- * @return \App\Models\User|null
- * @static
- */
- public static function user()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->user();
- }
- /**
- * Get the ID for the currently authenticated user.
- *
- * @return int|string|null
- * @static
- */
- public static function id()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->id();
- }
- /**
- * Log a user into the application without sessions or cookies.
- *
- * @param array $credentials
- * @return bool
- * @static
- */
- public static function once($credentials = [])
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->once($credentials);
- }
- /**
- * Log the given user ID into the application without sessions or cookies.
- *
- * @param mixed $id
- * @return \App\Models\User|false
- * @static
- */
- public static function onceUsingId($id)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->onceUsingId($id);
- }
- /**
- * Validate a user's credentials.
- *
- * @param array $credentials
- * @return bool
- * @static
- */
- public static function validate($credentials = [])
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->validate($credentials);
- }
- /**
- * Attempt to authenticate using HTTP Basic Auth.
- *
- * @param string $field
- * @param array $extraConditions
- * @return \Symfony\Component\HttpFoundation\Response|null
- * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
- * @static
- */
- public static function basic($field = 'email', $extraConditions = [])
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->basic($field, $extraConditions);
- }
- /**
- * Perform a stateless HTTP Basic login attempt.
- *
- * @param string $field
- * @param array $extraConditions
- * @return \Symfony\Component\HttpFoundation\Response|null
- * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
- * @static
- */
- public static function onceBasic($field = 'email', $extraConditions = [])
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->onceBasic($field, $extraConditions);
- }
- /**
- * Attempt to authenticate a user using the given credentials.
- *
- * @param array $credentials
- * @param bool $remember
- * @return bool
- * @static
- */
- public static function attempt($credentials = [], $remember = false)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->attempt($credentials, $remember);
- }
- /**
- * Attempt to authenticate a user with credentials and additional callbacks.
- *
- * @param array $credentials
- * @param array|callable|null $callbacks
- * @param bool $remember
- * @return bool
- * @static
- */
- public static function attemptWhen($credentials = [], $callbacks = null, $remember = false)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->attemptWhen($credentials, $callbacks, $remember);
- }
- /**
- * Log the given user ID into the application.
- *
- * @param mixed $id
- * @param bool $remember
- * @return \App\Models\User|false
- * @static
- */
- public static function loginUsingId($id, $remember = false)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->loginUsingId($id, $remember);
- }
- /**
- * Log a user into the application.
- *
- * @param \Illuminate\Contracts\Auth\Authenticatable $user
- * @param bool $remember
- * @return void
- * @static
- */
- public static function login($user, $remember = false)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- $instance->login($user, $remember);
- }
- /**
- * Log the user out of the application.
- *
- * @return void
- * @static
- */
- public static function logout()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- $instance->logout();
- }
- /**
- * Log the user out of the application on their current device only.
- *
- * This method does not cycle the "remember" token.
- *
- * @return void
- * @static
- */
- public static function logoutCurrentDevice()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- $instance->logoutCurrentDevice();
- }
- /**
- * Invalidate other sessions for the current user.
- *
- * The application must be using the AuthenticateSession middleware.
- *
- * @param string $password
- * @param string $attribute
- * @return \App\Models\User|null
- * @throws \Illuminate\Auth\AuthenticationException
- * @static
- */
- public static function logoutOtherDevices($password, $attribute = 'password')
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->logoutOtherDevices($password, $attribute);
- }
- /**
- * Register an authentication attempt event listener.
- *
- * @param mixed $callback
- * @return void
- * @static
- */
- public static function attempting($callback)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- $instance->attempting($callback);
- }
- /**
- * Get the last user we attempted to authenticate.
- *
- * @return \App\Models\User
- * @static
- */
- public static function getLastAttempted()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getLastAttempted();
- }
- /**
- * Get a unique identifier for the auth session value.
- *
- * @return string
- * @static
- */
- public static function getName()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getName();
- }
- /**
- * Get the name of the cookie used to store the "recaller".
- *
- * @return string
- * @static
- */
- public static function getRecallerName()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getRecallerName();
- }
- /**
- * Determine if the user was authenticated via "remember me" cookie.
- *
- * @return bool
- * @static
- */
- public static function viaRemember()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->viaRemember();
- }
- /**
- * Set the number of minutes the remember me cookie should be valid for.
- *
- * @param int $minutes
- * @return \Illuminate\Auth\SessionGuard
- * @static
- */
- public static function setRememberDuration($minutes)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->setRememberDuration($minutes);
- }
- /**
- * Get the cookie creator instance used by the guard.
- *
- * @return \Illuminate\Contracts\Cookie\QueueingFactory
- * @throws \RuntimeException
- * @static
- */
- public static function getCookieJar()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getCookieJar();
- }
- /**
- * Set the cookie creator instance used by the guard.
- *
- * @param \Illuminate\Contracts\Cookie\QueueingFactory $cookie
- * @return void
- * @static
- */
- public static function setCookieJar($cookie)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- $instance->setCookieJar($cookie);
- }
- /**
- * Get the event dispatcher instance.
- *
- * @return \Illuminate\Contracts\Events\Dispatcher
- * @static
- */
- public static function getDispatcher()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getDispatcher();
- }
- /**
- * Set the event dispatcher instance.
- *
- * @param \Illuminate\Contracts\Events\Dispatcher $events
- * @return void
- * @static
- */
- public static function setDispatcher($events)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- $instance->setDispatcher($events);
- }
- /**
- * Get the session store used by the guard.
- *
- * @return \Illuminate\Contracts\Session\Session
- * @static
- */
- public static function getSession()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getSession();
- }
- /**
- * Return the currently cached user.
- *
- * @return \App\Models\User|null
- * @static
- */
- public static function getUser()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getUser();
- }
- /**
- * Set the current user.
- *
- * @param \Illuminate\Contracts\Auth\Authenticatable $user
- * @return \Illuminate\Auth\SessionGuard
- * @static
- */
- public static function setUser($user)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->setUser($user);
- }
- /**
- * Get the current request instance.
- *
- * @return \Symfony\Component\HttpFoundation\Request
- * @static
- */
- public static function getRequest()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getRequest();
- }
- /**
- * Set the current request instance.
- *
- * @param \Symfony\Component\HttpFoundation\Request $request
- * @return \Illuminate\Auth\SessionGuard
- * @static
- */
- public static function setRequest($request)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->setRequest($request);
- }
- /**
- * Get the timebox instance used by the guard.
- *
- * @return \Illuminate\Support\Timebox
- * @static
- */
- public static function getTimebox()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getTimebox();
- }
- /**
- * Determine if the current user is authenticated. If not, throw an exception.
- *
- * @return \App\Models\User
- * @throws \Illuminate\Auth\AuthenticationException
- * @static
- */
- public static function authenticate()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->authenticate();
- }
- /**
- * Determine if the guard has a user instance.
- *
- * @return bool
- * @static
- */
- public static function hasUser()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->hasUser();
- }
- /**
- * Determine if the current user is authenticated.
- *
- * @return bool
- * @static
- */
- public static function check()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->check();
- }
- /**
- * Determine if the current user is a guest.
- *
- * @return bool
- * @static
- */
- public static function guest()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->guest();
- }
- /**
- * Forget the current user.
- *
- * @return \Illuminate\Auth\SessionGuard
- * @static
- */
- public static function forgetUser()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->forgetUser();
- }
- /**
- * Get the user provider used by the guard.
- *
- * @return \Illuminate\Contracts\Auth\UserProvider
- * @static
- */
- public static function getProvider()
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- return $instance->getProvider();
- }
- /**
- * Set the user provider used by the guard.
- *
- * @param \Illuminate\Contracts\Auth\UserProvider $provider
- * @return void
- * @static
- */
- public static function setProvider($provider)
- {
- /** @var \Illuminate\Auth\SessionGuard $instance */
- $instance->setProvider($provider);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Auth\SessionGuard::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Auth\SessionGuard::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Auth\SessionGuard::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Auth\SessionGuard::flushMacros();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\View\Compilers\BladeCompiler
- */
- class Blade {
- /**
- * Compile the view at the given path.
- *
- * @param string|null $path
- * @return void
- * @static
- */
- public static function compile($path = null)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->compile($path);
- }
- /**
- * Get the path currently being compiled.
- *
- * @return string
- * @static
- */
- public static function getPath()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getPath();
- }
- /**
- * Set the path currently being compiled.
- *
- * @param string $path
- * @return void
- * @static
- */
- public static function setPath($path)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->setPath($path);
- }
- /**
- * Compile the given Blade template contents.
- *
- * @param string $value
- * @return string
- * @static
- */
- public static function compileString($value)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->compileString($value);
- }
- /**
- * Evaluate and render a Blade string to HTML.
- *
- * @param string $string
- * @param array $data
- * @param bool $deleteCachedView
- * @return string
- * @static
- */
- public static function render($string, $data = [], $deleteCachedView = false)
- {
- return \Illuminate\View\Compilers\BladeCompiler::render($string, $data, $deleteCachedView);
- }
- /**
- * Render a component instance to HTML.
- *
- * @param \Illuminate\View\Component $component
- * @return string
- * @static
- */
- public static function renderComponent($component)
- {
- return \Illuminate\View\Compilers\BladeCompiler::renderComponent($component);
- }
- /**
- * Strip the parentheses from the given expression.
- *
- * @param string $expression
- * @return string
- * @static
- */
- public static function stripParentheses($expression)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->stripParentheses($expression);
- }
- /**
- * Register a custom Blade compiler.
- *
- * @param callable $compiler
- * @return void
- * @static
- */
- public static function extend($compiler)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->extend($compiler);
- }
- /**
- * Get the extensions used by the compiler.
- *
- * @return array
- * @static
- */
- public static function getExtensions()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getExtensions();
- }
- /**
- * Register an "if" statement directive.
- *
- * @param string $name
- * @param callable $callback
- * @return void
- * @static
- */
- public static function if($name, $callback)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->if($name, $callback);
- }
- /**
- * Check the result of a condition.
- *
- * @param string $name
- * @param mixed $parameters
- * @return bool
- * @static
- */
- public static function check($name, ...$parameters)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->check($name, ...$parameters);
- }
- /**
- * Register a class-based component alias directive.
- *
- * @param string $class
- * @param string|null $alias
- * @param string $prefix
- * @return void
- * @static
- */
- public static function component($class, $alias = null, $prefix = '')
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->component($class, $alias, $prefix);
- }
- /**
- * Register an array of class-based components.
- *
- * @param array $components
- * @param string $prefix
- * @return void
- * @static
- */
- public static function components($components, $prefix = '')
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->components($components, $prefix);
- }
- /**
- * Get the registered class component aliases.
- *
- * @return array
- * @static
- */
- public static function getClassComponentAliases()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getClassComponentAliases();
- }
- /**
- * Register a new anonymous component path.
- *
- * @param string $path
- * @param string|null $prefix
- * @return void
- * @static
- */
- public static function anonymousComponentPath($path, $prefix = null)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->anonymousComponentPath($path, $prefix);
- }
- /**
- * Register an anonymous component namespace.
- *
- * @param string $directory
- * @param string|null $prefix
- * @return void
- * @static
- */
- public static function anonymousComponentNamespace($directory, $prefix = null)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->anonymousComponentNamespace($directory, $prefix);
- }
- /**
- * Register a class-based component namespace.
- *
- * @param string $namespace
- * @param string $prefix
- * @return void
- * @static
- */
- public static function componentNamespace($namespace, $prefix)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->componentNamespace($namespace, $prefix);
- }
- /**
- * Get the registered anonymous component paths.
- *
- * @return array
- * @static
- */
- public static function getAnonymousComponentPaths()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getAnonymousComponentPaths();
- }
- /**
- * Get the registered anonymous component namespaces.
- *
- * @return array
- * @static
- */
- public static function getAnonymousComponentNamespaces()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getAnonymousComponentNamespaces();
- }
- /**
- * Get the registered class component namespaces.
- *
- * @return array
- * @static
- */
- public static function getClassComponentNamespaces()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getClassComponentNamespaces();
- }
- /**
- * Register a component alias directive.
- *
- * @param string $path
- * @param string|null $alias
- * @return void
- * @static
- */
- public static function aliasComponent($path, $alias = null)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->aliasComponent($path, $alias);
- }
- /**
- * Register an include alias directive.
- *
- * @param string $path
- * @param string|null $alias
- * @return void
- * @static
- */
- public static function include($path, $alias = null)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->include($path, $alias);
- }
- /**
- * Register an include alias directive.
- *
- * @param string $path
- * @param string|null $alias
- * @return void
- * @static
- */
- public static function aliasInclude($path, $alias = null)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->aliasInclude($path, $alias);
- }
- /**
- * Register a handler for custom directives.
- *
- * @param string $name
- * @param callable $handler
- * @return void
- * @throws \InvalidArgumentException
- * @static
- */
- public static function directive($name, $handler)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->directive($name, $handler);
- }
- /**
- * Get the list of custom directives.
- *
- * @return array
- * @static
- */
- public static function getCustomDirectives()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getCustomDirectives();
- }
- /**
- * Indicate that the following callable should be used to prepare strings for compilation.
- *
- * @param callable $callback
- * @return \Illuminate\View\Compilers\BladeCompiler
- * @static
- */
- public static function prepareStringsForCompilationUsing($callback)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->prepareStringsForCompilationUsing($callback);
- }
- /**
- * Register a new precompiler.
- *
- * @param callable $precompiler
- * @return void
- * @static
- */
- public static function precompiler($precompiler)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->precompiler($precompiler);
- }
- /**
- * Set the echo format to be used by the compiler.
- *
- * @param string $format
- * @return void
- * @static
- */
- public static function setEchoFormat($format)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->setEchoFormat($format);
- }
- /**
- * Set the "echo" format to double encode entities.
- *
- * @return void
- * @static
- */
- public static function withDoubleEncoding()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->withDoubleEncoding();
- }
- /**
- * Set the "echo" format to not double encode entities.
- *
- * @return void
- * @static
- */
- public static function withoutDoubleEncoding()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->withoutDoubleEncoding();
- }
- /**
- * Indicate that component tags should not be compiled.
- *
- * @return void
- * @static
- */
- public static function withoutComponentTags()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->withoutComponentTags();
- }
- /**
- * Get the path to the compiled version of a view.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function getCompiledPath($path)
- { //Method inherited from \Illuminate\View\Compilers\Compiler
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->getCompiledPath($path);
- }
- /**
- * Determine if the view at the given path is expired.
- *
- * @param string $path
- * @return bool
- * @throws \ErrorException
- * @static
- */
- public static function isExpired($path)
- { //Method inherited from \Illuminate\View\Compilers\Compiler
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->isExpired($path);
- }
- /**
- * Get a new component hash for a component name.
- *
- * @param string $component
- * @return string
- * @static
- */
- public static function newComponentHash($component)
- {
- return \Illuminate\View\Compilers\BladeCompiler::newComponentHash($component);
- }
- /**
- * Compile a class component opening.
- *
- * @param string $component
- * @param string $alias
- * @param string $data
- * @param string $hash
- * @return string
- * @static
- */
- public static function compileClassComponentOpening($component, $alias, $data, $hash)
- {
- return \Illuminate\View\Compilers\BladeCompiler::compileClassComponentOpening($component, $alias, $data, $hash);
- }
- /**
- * Compile the end-component statements into valid PHP.
- *
- * @return string
- * @static
- */
- public static function compileEndComponentClass()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->compileEndComponentClass();
- }
- /**
- * Sanitize the given component attribute value.
- *
- * @param mixed $value
- * @return mixed
- * @static
- */
- public static function sanitizeComponentAttribute($value)
- {
- return \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($value);
- }
- /**
- * Compile an end-once block into valid PHP.
- *
- * @return string
- * @static
- */
- public static function compileEndOnce()
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->compileEndOnce();
- }
- /**
- * Add a handler to be executed before echoing a given class.
- *
- * @param string|callable $class
- * @param callable|null $handler
- * @return void
- * @static
- */
- public static function stringable($class, $handler = null)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- $instance->stringable($class, $handler);
- }
- /**
- * Compile Blade echos into valid PHP.
- *
- * @param string $value
- * @return string
- * @static
- */
- public static function compileEchos($value)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->compileEchos($value);
- }
- /**
- * Apply the echo handler for the value if it exists.
- *
- * @param string $value
- * @return string
- * @static
- */
- public static function applyEchoHandler($value)
- {
- /** @var \Illuminate\View\Compilers\BladeCompiler $instance */
- return $instance->applyEchoHandler($value);
- }
-
- }
- /**
- *
- *
- * @method static mixed auth(\Illuminate\Http\Request $request)
- * @method static mixed validAuthenticationResponse(\Illuminate\Http\Request $request, mixed $result)
- * @method static void broadcast(array $channels, string $event, array $payload = [])
- * @method static array|null resolveAuthenticatedUser(\Illuminate\Http\Request $request)
- * @method static void resolveAuthenticatedUserUsing(\Closure $callback)
- * @method static \Illuminate\Broadcasting\Broadcasters\Broadcaster channel(\Illuminate\Contracts\Broadcasting\HasBroadcastChannel|string $channel, callable|string $callback, array $options = [])
- * @method static \Illuminate\Support\Collection getChannels()
- * @see \Illuminate\Broadcasting\BroadcastManager
- * @see \Illuminate\Broadcasting\Broadcasters\Broadcaster
- */
- class Broadcast {
- /**
- * Register the routes for handling broadcast channel authentication and sockets.
- *
- * @param array|null $attributes
- * @return void
- * @static
- */
- public static function routes($attributes = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- $instance->routes($attributes);
- }
- /**
- * Register the routes for handling broadcast user authentication.
- *
- * @param array|null $attributes
- * @return void
- * @static
- */
- public static function userRoutes($attributes = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- $instance->userRoutes($attributes);
- }
- /**
- * Register the routes for handling broadcast authentication and sockets.
- *
- * Alias of "routes" method.
- *
- * @param array|null $attributes
- * @return void
- * @static
- */
- public static function channelRoutes($attributes = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- $instance->channelRoutes($attributes);
- }
- /**
- * Get the socket ID for the given request.
- *
- * @param \Illuminate\Http\Request|null $request
- * @return string|null
- * @static
- */
- public static function socket($request = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->socket($request);
- }
- /**
- * Begin broadcasting an event.
- *
- * @param mixed|null $event
- * @return \Illuminate\Broadcasting\PendingBroadcast
- * @static
- */
- public static function event($event = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->event($event);
- }
- /**
- * Queue the given event for broadcast.
- *
- * @param mixed $event
- * @return void
- * @static
- */
- public static function queue($event)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- $instance->queue($event);
- }
- /**
- * Get a driver instance.
- *
- * @param string|null $driver
- * @return mixed
- * @static
- */
- public static function connection($driver = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->connection($driver);
- }
- /**
- * Get a driver instance.
- *
- * @param string|null $name
- * @return mixed
- * @static
- */
- public static function driver($name = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->driver($name);
- }
- /**
- * Get a Pusher instance for the given configuration.
- *
- * @param array $config
- * @return \Pusher\Pusher
- * @static
- */
- public static function pusher($config)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->pusher($config);
- }
- /**
- * Get an Ably instance for the given configuration.
- *
- * @param array $config
- * @return \Ably\AblyRest
- * @static
- */
- public static function ably($config)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->ably($config);
- }
- /**
- * Get the default driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the default driver name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- $instance->setDefaultDriver($name);
- }
- /**
- * Disconnect the given disk and remove from local cache.
- *
- * @param string|null $name
- * @return void
- * @static
- */
- public static function purge($name = null)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- $instance->purge($name);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Broadcasting\BroadcastManager
- * @static
- */
- public static function extend($driver, $callback)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Get the application instance used by the manager.
- *
- * @return \Illuminate\Contracts\Foundation\Application
- * @static
- */
- public static function getApplication()
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->getApplication();
- }
- /**
- * Set the application instance used by the manager.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return \Illuminate\Broadcasting\BroadcastManager
- * @static
- */
- public static function setApplication($app)
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->setApplication($app);
- }
- /**
- * Forget all of the resolved driver instances.
- *
- * @return \Illuminate\Broadcasting\BroadcastManager
- * @static
- */
- public static function forgetDrivers()
- {
- /** @var \Illuminate\Broadcasting\BroadcastManager $instance */
- return $instance->forgetDrivers();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Bus\Dispatcher
- * @see \Illuminate\Support\Testing\Fakes\BusFake
- */
- class Bus {
- /**
- * Dispatch a command to its appropriate handler.
- *
- * @param mixed $command
- * @return mixed
- * @static
- */
- public static function dispatch($command)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->dispatch($command);
- }
- /**
- * Dispatch a command to its appropriate handler in the current process.
- *
- * Queueable jobs will be dispatched to the "sync" queue.
- *
- * @param mixed $command
- * @param mixed $handler
- * @return mixed
- * @static
- */
- public static function dispatchSync($command, $handler = null)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->dispatchSync($command, $handler);
- }
- /**
- * Dispatch a command to its appropriate handler in the current process without using the synchronous queue.
- *
- * @param mixed $command
- * @param mixed $handler
- * @return mixed
- * @static
- */
- public static function dispatchNow($command, $handler = null)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->dispatchNow($command, $handler);
- }
- /**
- * Attempt to find the batch with the given ID.
- *
- * @param string $batchId
- * @return \Illuminate\Bus\Batch|null
- * @static
- */
- public static function findBatch($batchId)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->findBatch($batchId);
- }
- /**
- * Create a new batch of queueable jobs.
- *
- * @param \Illuminate\Support\Collection|array|mixed $jobs
- * @return \Illuminate\Bus\PendingBatch
- * @static
- */
- public static function batch($jobs)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->batch($jobs);
- }
- /**
- * Create a new chain of queueable jobs.
- *
- * @param \Illuminate\Support\Collection|array $jobs
- * @return \Illuminate\Foundation\Bus\PendingChain
- * @static
- */
- public static function chain($jobs)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->chain($jobs);
- }
- /**
- * Determine if the given command has a handler.
- *
- * @param mixed $command
- * @return bool
- * @static
- */
- public static function hasCommandHandler($command)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->hasCommandHandler($command);
- }
- /**
- * Retrieve the handler for a command.
- *
- * @param mixed $command
- * @return bool|mixed
- * @static
- */
- public static function getCommandHandler($command)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->getCommandHandler($command);
- }
- /**
- * Dispatch a command to its appropriate handler behind a queue.
- *
- * @param mixed $command
- * @return mixed
- * @throws \RuntimeException
- * @static
- */
- public static function dispatchToQueue($command)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->dispatchToQueue($command);
- }
- /**
- * Dispatch a command to its appropriate handler after the current process.
- *
- * @param mixed $command
- * @param mixed $handler
- * @return void
- * @static
- */
- public static function dispatchAfterResponse($command, $handler = null)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- $instance->dispatchAfterResponse($command, $handler);
- }
- /**
- * Set the pipes through which commands should be piped before dispatching.
- *
- * @param array $pipes
- * @return \Illuminate\Bus\Dispatcher
- * @static
- */
- public static function pipeThrough($pipes)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->pipeThrough($pipes);
- }
- /**
- * Map a command to a handler.
- *
- * @param array $map
- * @return \Illuminate\Bus\Dispatcher
- * @static
- */
- public static function map($map)
- {
- /** @var \Illuminate\Bus\Dispatcher $instance */
- return $instance->map($map);
- }
- /**
- * Specify the jobs that should be dispatched instead of faked.
- *
- * @param array|string $jobsToDispatch
- * @return \Illuminate\Support\Testing\Fakes\BusFake
- * @static
- */
- public static function except($jobsToDispatch)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->except($jobsToDispatch);
- }
- /**
- * Assert if a job was dispatched based on a truth-test callback.
- *
- * @param string|\Closure $command
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertDispatched($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertDispatched($command, $callback);
- }
- /**
- * Assert if a job was pushed a number of times.
- *
- * @param string|\Closure $command
- * @param int $times
- * @return void
- * @static
- */
- public static function assertDispatchedTimes($command, $times = 1)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertDispatchedTimes($command, $times);
- }
- /**
- * Determine if a job was dispatched based on a truth-test callback.
- *
- * @param string|\Closure $command
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotDispatched($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertNotDispatched($command, $callback);
- }
- /**
- * Assert that no jobs were dispatched.
- *
- * @return void
- * @static
- */
- public static function assertNothingDispatched()
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertNothingDispatched();
- }
- /**
- * Assert if a job was explicitly dispatched synchronously based on a truth-test callback.
- *
- * @param string|\Closure $command
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertDispatchedSync($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertDispatchedSync($command, $callback);
- }
- /**
- * Assert if a job was pushed synchronously a number of times.
- *
- * @param string|\Closure $command
- * @param int $times
- * @return void
- * @static
- */
- public static function assertDispatchedSyncTimes($command, $times = 1)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertDispatchedSyncTimes($command, $times);
- }
- /**
- * Determine if a job was dispatched based on a truth-test callback.
- *
- * @param string|\Closure $command
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotDispatchedSync($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertNotDispatchedSync($command, $callback);
- }
- /**
- * Assert if a job was dispatched after the response was sent based on a truth-test callback.
- *
- * @param string|\Closure $command
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertDispatchedAfterResponse($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertDispatchedAfterResponse($command, $callback);
- }
- /**
- * Assert if a job was pushed after the response was sent a number of times.
- *
- * @param string|\Closure $command
- * @param int $times
- * @return void
- * @static
- */
- public static function assertDispatchedAfterResponseTimes($command, $times = 1)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertDispatchedAfterResponseTimes($command, $times);
- }
- /**
- * Determine if a job was dispatched based on a truth-test callback.
- *
- * @param string|\Closure $command
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotDispatchedAfterResponse($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertNotDispatchedAfterResponse($command, $callback);
- }
- /**
- * Assert if a chain of jobs was dispatched.
- *
- * @param array $expectedChain
- * @return void
- * @static
- */
- public static function assertChained($expectedChain)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertChained($expectedChain);
- }
- /**
- * Assert if a job was dispatched with an empty chain based on a truth-test callback.
- *
- * @param string|\Closure $command
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertDispatchedWithoutChain($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertDispatchedWithoutChain($command, $callback);
- }
- /**
- * Assert if a batch was dispatched based on a truth-test callback.
- *
- * @param callable $callback
- * @return void
- * @static
- */
- public static function assertBatched($callback)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertBatched($callback);
- }
- /**
- * Assert the number of batches that have been dispatched.
- *
- * @param int $count
- * @return void
- * @static
- */
- public static function assertBatchCount($count)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertBatchCount($count);
- }
- /**
- * Assert that no batched jobs were dispatched.
- *
- * @return void
- * @static
- */
- public static function assertNothingBatched()
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- $instance->assertNothingBatched();
- }
- /**
- * Get all of the jobs matching a truth-test callback.
- *
- * @param string $command
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function dispatched($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->dispatched($command, $callback);
- }
- /**
- * Get all of the jobs dispatched synchronously matching a truth-test callback.
- *
- * @param string $command
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function dispatchedSync($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->dispatchedSync($command, $callback);
- }
- /**
- * Get all of the jobs dispatched after the response was sent matching a truth-test callback.
- *
- * @param string $command
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function dispatchedAfterResponse($command, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->dispatchedAfterResponse($command, $callback);
- }
- /**
- * Get all of the pending batches matching a truth-test callback.
- *
- * @param callable $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function batched($callback)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->batched($callback);
- }
- /**
- * Determine if there are any stored commands for a given class.
- *
- * @param string $command
- * @return bool
- * @static
- */
- public static function hasDispatched($command)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->hasDispatched($command);
- }
- /**
- * Determine if there are any stored commands for a given class.
- *
- * @param string $command
- * @return bool
- * @static
- */
- public static function hasDispatchedSync($command)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->hasDispatchedSync($command);
- }
- /**
- * Determine if there are any stored commands for a given class.
- *
- * @param string $command
- * @return bool
- * @static
- */
- public static function hasDispatchedAfterResponse($command)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->hasDispatchedAfterResponse($command);
- }
- /**
- * Dispatch an empty job batch for testing.
- *
- * @param string $name
- * @return \Illuminate\Bus\Batch
- * @static
- */
- public static function dispatchFakeBatch($name = '')
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->dispatchFakeBatch($name);
- }
- /**
- * Record the fake pending batch dispatch.
- *
- * @param \Illuminate\Bus\PendingBatch $pendingBatch
- * @return \Illuminate\Bus\Batch
- * @static
- */
- public static function recordPendingBatch($pendingBatch)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->recordPendingBatch($pendingBatch);
- }
- /**
- * Specify if commands should be serialized and restored when being batched.
- *
- * @param bool $serializeAndRestore
- * @return \Illuminate\Support\Testing\Fakes\BusFake
- * @static
- */
- public static function serializeAndRestore($serializeAndRestore = true)
- {
- /** @var \Illuminate\Support\Testing\Fakes\BusFake $instance */
- return $instance->serializeAndRestore($serializeAndRestore);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Cache\CacheManager
- * @mixin \Illuminate\Cache\Repository
- */
- class Cache {
- /**
- * Get a cache store instance by name, wrapped in a repository.
- *
- * @param string|null $name
- * @return \Illuminate\Contracts\Cache\Repository
- * @static
- */
- public static function store($name = null)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->store($name);
- }
- /**
- * Get a cache driver instance.
- *
- * @param string|null $driver
- * @return \Illuminate\Contracts\Cache\Repository
- * @static
- */
- public static function driver($driver = null)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->driver($driver);
- }
- /**
- * Resolve the given store.
- *
- * @param string $name
- * @return \Illuminate\Contracts\Cache\Repository
- * @throws \InvalidArgumentException
- * @static
- */
- public static function resolve($name)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->resolve($name);
- }
- /**
- * Create a new cache repository with the given implementation.
- *
- * @param \Illuminate\Contracts\Cache\Store $store
- * @return \Illuminate\Cache\Repository
- * @static
- */
- public static function repository($store)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->repository($store);
- }
- /**
- * Re-set the event dispatcher on all resolved cache repositories.
- *
- * @return void
- * @static
- */
- public static function refreshEventDispatcher()
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- $instance->refreshEventDispatcher();
- }
- /**
- * Get the default cache driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the default cache driver name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- $instance->setDefaultDriver($name);
- }
- /**
- * Unset the given driver instances.
- *
- * @param array|string|null $name
- * @return \Illuminate\Cache\CacheManager
- * @static
- */
- public static function forgetDriver($name = null)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->forgetDriver($name);
- }
- /**
- * Disconnect the given driver and remove from local cache.
- *
- * @param string|null $name
- * @return void
- * @static
- */
- public static function purge($name = null)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- $instance->purge($name);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Cache\CacheManager
- * @static
- */
- public static function extend($driver, $callback)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Set the application instance used by the manager.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return \Illuminate\Cache\CacheManager
- * @static
- */
- public static function setApplication($app)
- {
- /** @var \Illuminate\Cache\CacheManager $instance */
- return $instance->setApplication($app);
- }
- /**
- * Determine if an item exists in the cache.
- *
- * @param array|string $key
- * @return bool
- * @static
- */
- public static function has($key)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->has($key);
- }
- /**
- * Determine if an item doesn't exist in the cache.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function missing($key)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->missing($key);
- }
- /**
- * Retrieve an item from the cache by key.
- *
- * @template TCacheValue
- * @param array|string $key
- * @param \Illuminate\Cache\TCacheValue|\Illuminate\Cache\(\Closure(): TCacheValue) $default
- * @return \Illuminate\Cache\(TCacheValue is null ? mixed : TCacheValue)
- * @static
- */
- public static function get($key, $default = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->get($key, $default);
- }
- /**
- * Retrieve multiple items from the cache by key.
- *
- * Items not found in the cache will have a null value.
- *
- * @param array $keys
- * @return array
- * @static
- */
- public static function many($keys)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->many($keys);
- }
- /**
- * Obtains multiple cache items by their unique keys.
- *
- * @return \Illuminate\Cache\iterable
- * @param \Psr\SimpleCache\iterable $keys A list of keys that can be obtained in a single operation.
- * @param mixed $default Default value to return for keys that do not exist.
- * @return \Psr\SimpleCache\iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
- * @throws \Psr\SimpleCache\InvalidArgumentException
- * MUST be thrown if $keys is neither an array nor a Traversable,
- * or if any of the $keys are not a legal value.
- * @static
- */
- public static function getMultiple($keys, $default = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->getMultiple($keys, $default);
- }
- /**
- * Retrieve an item from the cache and delete it.
- *
- * @template TCacheValue
- * @param array|string $key
- * @param \Illuminate\Cache\TCacheValue|\Illuminate\Cache\(\Closure(): TCacheValue) $default
- * @return \Illuminate\Cache\(TCacheValue is null ? mixed : TCacheValue)
- * @static
- */
- public static function pull($key, $default = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->pull($key, $default);
- }
- /**
- * Store an item in the cache.
- *
- * @param array|string $key
- * @param mixed $value
- * @param \DateTimeInterface|\DateInterval|int|null $ttl
- * @return bool
- * @static
- */
- public static function put($key, $value, $ttl = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->put($key, $value, $ttl);
- }
- /**
- * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
- *
- * @return bool
- * @param string $key The key of the item to store.
- * @param mixed $value The value of the item to store, must be serializable.
- * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
- * the driver supports TTL then the library may set a default value
- * for it or let the driver take care of that.
- * @return bool True on success and false on failure.
- * @throws \Psr\SimpleCache\InvalidArgumentException
- * MUST be thrown if the $key string is not a legal value.
- * @static
- */
- public static function set($key, $value, $ttl = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->set($key, $value, $ttl);
- }
- /**
- * Store multiple items in the cache for a given number of seconds.
- *
- * @param array $values
- * @param \DateTimeInterface|\DateInterval|int|null $ttl
- * @return bool
- * @static
- */
- public static function putMany($values, $ttl = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->putMany($values, $ttl);
- }
- /**
- * Persists a set of key => value pairs in the cache, with an optional TTL.
- *
- * @return bool
- * @param \Psr\SimpleCache\iterable $values A list of key => value pairs for a multiple-set operation.
- * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
- * the driver supports TTL then the library may set a default value
- * for it or let the driver take care of that.
- * @return bool True on success and false on failure.
- * @throws \Psr\SimpleCache\InvalidArgumentException
- * MUST be thrown if $values is neither an array nor a Traversable,
- * or if any of the $values are not a legal value.
- * @static
- */
- public static function setMultiple($values, $ttl = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->setMultiple($values, $ttl);
- }
- /**
- * Store an item in the cache if the key does not exist.
- *
- * @param string $key
- * @param mixed $value
- * @param \DateTimeInterface|\DateInterval|int|null $ttl
- * @return bool
- * @static
- */
- public static function add($key, $value, $ttl = null)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->add($key, $value, $ttl);
- }
- /**
- * Increment the value of an item in the cache.
- *
- * @param string $key
- * @param mixed $value
- * @return int|bool
- * @static
- */
- public static function increment($key, $value = 1)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->increment($key, $value);
- }
- /**
- * Decrement the value of an item in the cache.
- *
- * @param string $key
- * @param mixed $value
- * @return int|bool
- * @static
- */
- public static function decrement($key, $value = 1)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->decrement($key, $value);
- }
- /**
- * Store an item in the cache indefinitely.
- *
- * @param string $key
- * @param mixed $value
- * @return bool
- * @static
- */
- public static function forever($key, $value)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->forever($key, $value);
- }
- /**
- * Get an item from the cache, or execute the given Closure and store the result.
- *
- * @template TCacheValue
- * @param string $key
- * @param \Closure|\DateTimeInterface|\DateInterval|int|null $ttl
- * @param \Closure(): TCacheValue $callback
- * @return \Illuminate\Cache\TCacheValue
- * @static
- */
- public static function remember($key, $ttl, $callback)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->remember($key, $ttl, $callback);
- }
- /**
- * Get an item from the cache, or execute the given Closure and store the result forever.
- *
- * @template TCacheValue
- * @param string $key
- * @param \Closure(): TCacheValue $callback
- * @return \Illuminate\Cache\TCacheValue
- * @static
- */
- public static function sear($key, $callback)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->sear($key, $callback);
- }
- /**
- * Get an item from the cache, or execute the given Closure and store the result forever.
- *
- * @template TCacheValue
- * @param string $key
- * @param \Closure(): TCacheValue $callback
- * @return \Illuminate\Cache\TCacheValue
- * @static
- */
- public static function rememberForever($key, $callback)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->rememberForever($key, $callback);
- }
- /**
- * Remove an item from the cache.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function forget($key)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->forget($key);
- }
- /**
- * Delete an item from the cache by its unique key.
- *
- * @return bool
- * @param string $key The unique cache key of the item to delete.
- * @return bool True if the item was successfully removed. False if there was an error.
- * @throws \Psr\SimpleCache\InvalidArgumentException
- * MUST be thrown if the $key string is not a legal value.
- * @static
- */
- public static function delete($key)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->delete($key);
- }
- /**
- * Deletes multiple cache items in a single operation.
- *
- * @return bool
- * @param \Psr\SimpleCache\iterable $keys A list of string-based keys to be deleted.
- * @return bool True if the items were successfully removed. False if there was an error.
- * @throws \Psr\SimpleCache\InvalidArgumentException
- * MUST be thrown if $keys is neither an array nor a Traversable,
- * or if any of the $keys are not a legal value.
- * @static
- */
- public static function deleteMultiple($keys)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->deleteMultiple($keys);
- }
- /**
- * Wipes clean the entire cache's keys.
- *
- * @return bool
- * @return bool True on success and false on failure.
- * @static
- */
- public static function clear()
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->clear();
- }
- /**
- * Begin executing a new tags operation if the store supports it.
- *
- * @param array|mixed $names
- * @return \Illuminate\Cache\TaggedCache
- * @throws \BadMethodCallException
- * @static
- */
- public static function tags($names)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->tags($names);
- }
- /**
- * Determine if the current store supports tags.
- *
- * @return bool
- * @static
- */
- public static function supportsTags()
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->supportsTags();
- }
- /**
- * Get the default cache time.
- *
- * @return int|null
- * @static
- */
- public static function getDefaultCacheTime()
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->getDefaultCacheTime();
- }
- /**
- * Set the default cache time in seconds.
- *
- * @param int|null $seconds
- * @return \Illuminate\Cache\Repository
- * @static
- */
- public static function setDefaultCacheTime($seconds)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->setDefaultCacheTime($seconds);
- }
- /**
- * Get the cache store implementation.
- *
- * @return \Illuminate\Contracts\Cache\Store
- * @static
- */
- public static function getStore()
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->getStore();
- }
- /**
- * Set the cache store implementation.
- *
- * @param \Illuminate\Contracts\Cache\Store $store
- * @return static
- * @static
- */
- public static function setStore($store)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->setStore($store);
- }
- /**
- * Get the event dispatcher instance.
- *
- * @return \Illuminate\Contracts\Events\Dispatcher
- * @static
- */
- public static function getEventDispatcher()
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->getEventDispatcher();
- }
- /**
- * Set the event dispatcher instance.
- *
- * @param \Illuminate\Contracts\Events\Dispatcher $events
- * @return void
- * @static
- */
- public static function setEventDispatcher($events)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- $instance->setEventDispatcher($events);
- }
- /**
- * Determine if a cached value exists.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function offsetExists($key)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->offsetExists($key);
- }
- /**
- * Retrieve an item from the cache by key.
- *
- * @param string $key
- * @return mixed
- * @static
- */
- public static function offsetGet($key)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->offsetGet($key);
- }
- /**
- * Store an item in the cache for the default time.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function offsetSet($key, $value)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- $instance->offsetSet($key, $value);
- }
- /**
- * Remove an item from the cache.
- *
- * @param string $key
- * @return void
- * @static
- */
- public static function offsetUnset($key)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- $instance->offsetUnset($key);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Cache\Repository::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Cache\Repository::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Cache\Repository::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Cache\Repository::flushMacros();
- }
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- * @throws \BadMethodCallException
- * @static
- */
- public static function macroCall($method, $parameters)
- {
- /** @var \Illuminate\Cache\Repository $instance */
- return $instance->macroCall($method, $parameters);
- }
- /**
- * Get a lock instance.
- *
- * @param string $name
- * @param int $seconds
- * @param string|null $owner
- * @return \Illuminate\Contracts\Cache\Lock
- * @static
- */
- public static function lock($name, $seconds = 0, $owner = null)
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->lock($name, $seconds, $owner);
- }
- /**
- * Restore a lock instance using the owner identifier.
- *
- * @param string $name
- * @param string $owner
- * @return \Illuminate\Contracts\Cache\Lock
- * @static
- */
- public static function restoreLock($name, $owner)
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->restoreLock($name, $owner);
- }
- /**
- * Remove all items from the cache.
- *
- * @return bool
- * @static
- */
- public static function flush()
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->flush();
- }
- /**
- * Remove all expired tag set entries.
- *
- * @return void
- * @static
- */
- public static function flushStaleTags()
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- $instance->flushStaleTags();
- }
- /**
- * Get the Redis connection instance.
- *
- * @return \Illuminate\Redis\Connections\Connection
- * @static
- */
- public static function connection()
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->connection();
- }
- /**
- * Get the Redis connection instance that should be used to manage locks.
- *
- * @return \Illuminate\Redis\Connections\Connection
- * @static
- */
- public static function lockConnection()
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->lockConnection();
- }
- /**
- * Specify the name of the connection that should be used to store data.
- *
- * @param string $connection
- * @return void
- * @static
- */
- public static function setConnection($connection)
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- $instance->setConnection($connection);
- }
- /**
- * Specify the name of the connection that should be used to manage locks.
- *
- * @param string $connection
- * @return \Illuminate\Cache\RedisStore
- * @static
- */
- public static function setLockConnection($connection)
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->setLockConnection($connection);
- }
- /**
- * Get the Redis database instance.
- *
- * @return \Illuminate\Contracts\Redis\Factory
- * @static
- */
- public static function getRedis()
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->getRedis();
- }
- /**
- * Get the cache key prefix.
- *
- * @return string
- * @static
- */
- public static function getPrefix()
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- return $instance->getPrefix();
- }
- /**
- * Set the cache key prefix.
- *
- * @param string $prefix
- * @return void
- * @static
- */
- public static function setPrefix($prefix)
- {
- /** @var \Illuminate\Cache\RedisStore $instance */
- $instance->setPrefix($prefix);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Config\Repository
- */
- class Config {
- /**
- * Determine if the given configuration value exists.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function has($key)
- {
- /** @var \Illuminate\Config\Repository $instance */
- return $instance->has($key);
- }
- /**
- * Get the specified configuration value.
- *
- * @param array|string $key
- * @param mixed $default
- * @return mixed
- * @static
- */
- public static function get($key, $default = null)
- {
- /** @var \Illuminate\Config\Repository $instance */
- return $instance->get($key, $default);
- }
- /**
- * Get many configuration values.
- *
- * @param array $keys
- * @return array
- * @static
- */
- public static function getMany($keys)
- {
- /** @var \Illuminate\Config\Repository $instance */
- return $instance->getMany($keys);
- }
- /**
- * Set a given configuration value.
- *
- * @param array|string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function set($key, $value = null)
- {
- /** @var \Illuminate\Config\Repository $instance */
- $instance->set($key, $value);
- }
- /**
- * Prepend a value onto an array configuration value.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function prepend($key, $value)
- {
- /** @var \Illuminate\Config\Repository $instance */
- $instance->prepend($key, $value);
- }
- /**
- * Push a value onto an array configuration value.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function push($key, $value)
- {
- /** @var \Illuminate\Config\Repository $instance */
- $instance->push($key, $value);
- }
- /**
- * Get all of the configuration items for the application.
- *
- * @return array
- * @static
- */
- public static function all()
- {
- /** @var \Illuminate\Config\Repository $instance */
- return $instance->all();
- }
- /**
- * Determine if the given configuration option exists.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function offsetExists($key)
- {
- /** @var \Illuminate\Config\Repository $instance */
- return $instance->offsetExists($key);
- }
- /**
- * Get a configuration option.
- *
- * @param string $key
- * @return mixed
- * @static
- */
- public static function offsetGet($key)
- {
- /** @var \Illuminate\Config\Repository $instance */
- return $instance->offsetGet($key);
- }
- /**
- * Set a configuration option.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function offsetSet($key, $value)
- {
- /** @var \Illuminate\Config\Repository $instance */
- $instance->offsetSet($key, $value);
- }
- /**
- * Unset a configuration option.
- *
- * @param string $key
- * @return void
- * @static
- */
- public static function offsetUnset($key)
- {
- /** @var \Illuminate\Config\Repository $instance */
- $instance->offsetUnset($key);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Config\Repository::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Config\Repository::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Config\Repository::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Config\Repository::flushMacros();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Cookie\CookieJar
- */
- class Cookie {
- /**
- * Create a new cookie instance.
- *
- * @param string $name
- * @param string $value
- * @param int $minutes
- * @param string|null $path
- * @param string|null $domain
- * @param bool|null $secure
- * @param bool $httpOnly
- * @param bool $raw
- * @param string|null $sameSite
- * @return \Symfony\Component\HttpFoundation\Cookie
- * @static
- */
- public static function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->make($name, $value, $minutes, $path, $domain, $secure, $httpOnly, $raw, $sameSite);
- }
- /**
- * Create a cookie that lasts "forever" (400 days).
- *
- * @param string $name
- * @param string $value
- * @param string|null $path
- * @param string|null $domain
- * @param bool|null $secure
- * @param bool $httpOnly
- * @param bool $raw
- * @param string|null $sameSite
- * @return \Symfony\Component\HttpFoundation\Cookie
- * @static
- */
- public static function forever($name, $value, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->forever($name, $value, $path, $domain, $secure, $httpOnly, $raw, $sameSite);
- }
- /**
- * Expire the given cookie.
- *
- * @param string $name
- * @param string|null $path
- * @param string|null $domain
- * @return \Symfony\Component\HttpFoundation\Cookie
- * @static
- */
- public static function forget($name, $path = null, $domain = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->forget($name, $path, $domain);
- }
- /**
- * Determine if a cookie has been queued.
- *
- * @param string $key
- * @param string|null $path
- * @return bool
- * @static
- */
- public static function hasQueued($key, $path = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->hasQueued($key, $path);
- }
- /**
- * Get a queued cookie instance.
- *
- * @param string $key
- * @param mixed $default
- * @param string|null $path
- * @return \Symfony\Component\HttpFoundation\Cookie|null
- * @static
- */
- public static function queued($key, $default = null, $path = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->queued($key, $default, $path);
- }
- /**
- * Queue a cookie to send with the next response.
- *
- * @param mixed $parameters
- * @return void
- * @static
- */
- public static function queue(...$parameters)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- $instance->queue(...$parameters);
- }
- /**
- * Queue a cookie to expire with the next response.
- *
- * @param string $name
- * @param string|null $path
- * @param string|null $domain
- * @return void
- * @static
- */
- public static function expire($name, $path = null, $domain = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- $instance->expire($name, $path, $domain);
- }
- /**
- * Remove a cookie from the queue.
- *
- * @param string $name
- * @param string|null $path
- * @return void
- * @static
- */
- public static function unqueue($name, $path = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- $instance->unqueue($name, $path);
- }
- /**
- * Set the default path and domain for the jar.
- *
- * @param string $path
- * @param string|null $domain
- * @param bool|null $secure
- * @param string|null $sameSite
- * @return \Illuminate\Cookie\CookieJar
- * @static
- */
- public static function setDefaultPathAndDomain($path, $domain, $secure = false, $sameSite = null)
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->setDefaultPathAndDomain($path, $domain, $secure, $sameSite);
- }
- /**
- * Get the cookies which have been queued for the next request.
- *
- * @return \Symfony\Component\HttpFoundation\Cookie[]
- * @static
- */
- public static function getQueuedCookies()
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->getQueuedCookies();
- }
- /**
- * Flush the cookies which have been queued for the next request.
- *
- * @return \Illuminate\Cookie\CookieJar
- * @static
- */
- public static function flushQueuedCookies()
- {
- /** @var \Illuminate\Cookie\CookieJar $instance */
- return $instance->flushQueuedCookies();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Cookie\CookieJar::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Cookie\CookieJar::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Cookie\CookieJar::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Cookie\CookieJar::flushMacros();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Encryption\Encrypter
- */
- class Crypt {
- /**
- * Determine if the given key and cipher combination is valid.
- *
- * @param string $key
- * @param string $cipher
- * @return bool
- * @static
- */
- public static function supported($key, $cipher)
- {
- return \Illuminate\Encryption\Encrypter::supported($key, $cipher);
- }
- /**
- * Create a new encryption key for the given cipher.
- *
- * @param string $cipher
- * @return string
- * @static
- */
- public static function generateKey($cipher)
- {
- return \Illuminate\Encryption\Encrypter::generateKey($cipher);
- }
- /**
- * Encrypt the given value.
- *
- * @param mixed $value
- * @param bool $serialize
- * @return string
- * @throws \Illuminate\Contracts\Encryption\EncryptException
- * @static
- */
- public static function encrypt($value, $serialize = true)
- {
- /** @var \Illuminate\Encryption\Encrypter $instance */
- return $instance->encrypt($value, $serialize);
- }
- /**
- * Encrypt a string without serialization.
- *
- * @param string $value
- * @return string
- * @throws \Illuminate\Contracts\Encryption\EncryptException
- * @static
- */
- public static function encryptString($value)
- {
- /** @var \Illuminate\Encryption\Encrypter $instance */
- return $instance->encryptString($value);
- }
- /**
- * Decrypt the given value.
- *
- * @param string $payload
- * @param bool $unserialize
- * @return mixed
- * @throws \Illuminate\Contracts\Encryption\DecryptException
- * @static
- */
- public static function decrypt($payload, $unserialize = true)
- {
- /** @var \Illuminate\Encryption\Encrypter $instance */
- return $instance->decrypt($payload, $unserialize);
- }
- /**
- * Decrypt the given string without unserialization.
- *
- * @param string $payload
- * @return string
- * @throws \Illuminate\Contracts\Encryption\DecryptException
- * @static
- */
- public static function decryptString($payload)
- {
- /** @var \Illuminate\Encryption\Encrypter $instance */
- return $instance->decryptString($payload);
- }
- /**
- * Get the encryption key that the encrypter is currently using.
- *
- * @return string
- * @static
- */
- public static function getKey()
- {
- /** @var \Illuminate\Encryption\Encrypter $instance */
- return $instance->getKey();
- }
-
- }
- /**
- *
- *
- * @see https://carbon.nesbot.com/docs/
- * @see https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Factory.php
- * @method static \Illuminate\Support\Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null)
- * @method static \Illuminate\Support\Carbon createFromDate($year = null, $month = null, $day = null, $tz = null)
- * @method static \Illuminate\Support\Carbon|false createFromFormat($format, $time, $tz = null)
- * @method static \Illuminate\Support\Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null)
- * @method static \Illuminate\Support\Carbon createFromTimeString($time, $tz = null)
- * @method static \Illuminate\Support\Carbon createFromTimestamp($timestamp, $tz = null)
- * @method static \Illuminate\Support\Carbon createFromTimestampMs($timestamp, $tz = null)
- * @method static \Illuminate\Support\Carbon createFromTimestampUTC($timestamp)
- * @method static \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null)
- * @method static \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
- * @method static void disableHumanDiffOption($humanDiffOption)
- * @method static void enableHumanDiffOption($humanDiffOption)
- * @method static mixed executeWithLocale($locale, $func)
- * @method static \Illuminate\Support\Carbon fromSerialized($value)
- * @method static array getAvailableLocales()
- * @method static array getDays()
- * @method static int getHumanDiffOptions()
- * @method static array getIsoUnits()
- * @method static array getLastErrors()
- * @method static string getLocale()
- * @method static int getMidDayAt()
- * @method static \Illuminate\Support\Carbon|null getTestNow()
- * @method static \Symfony\Component\Translation\TranslatorInterface getTranslator()
- * @method static int getWeekEndsAt()
- * @method static int getWeekStartsAt()
- * @method static array getWeekendDays()
- * @method static bool hasFormat($date, $format)
- * @method static bool hasMacro($name)
- * @method static bool hasRelativeKeywords($time)
- * @method static bool hasTestNow()
- * @method static \Illuminate\Support\Carbon instance($date)
- * @method static bool isImmutable()
- * @method static bool isModifiableUnit($unit)
- * @method static bool isMutable()
- * @method static bool isStrictModeEnabled()
- * @method static bool localeHasDiffOneDayWords($locale)
- * @method static bool localeHasDiffSyntax($locale)
- * @method static bool localeHasDiffTwoDayWords($locale)
- * @method static bool localeHasPeriodSyntax($locale)
- * @method static bool localeHasShortUnits($locale)
- * @method static void macro($name, $macro)
- * @method static \Illuminate\Support\Carbon|null make($var)
- * @method static \Illuminate\Support\Carbon maxValue()
- * @method static \Illuminate\Support\Carbon minValue()
- * @method static void mixin($mixin)
- * @method static \Illuminate\Support\Carbon now($tz = null)
- * @method static \Illuminate\Support\Carbon parse($time = null, $tz = null)
- * @method static string pluralUnit(string $unit)
- * @method static void resetMonthsOverflow()
- * @method static void resetToStringFormat()
- * @method static void resetYearsOverflow()
- * @method static void serializeUsing($callback)
- * @method static void setHumanDiffOptions($humanDiffOptions)
- * @method static bool setLocale($locale)
- * @method static void setMidDayAt($hour)
- * @method static void setTestNow($testNow = null)
- * @method static void setToStringFormat($format)
- * @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator)
- * @method static void setUtf8($utf8)
- * @method static void setWeekEndsAt($day)
- * @method static void setWeekStartsAt($day)
- * @method static void setWeekendDays($days)
- * @method static bool shouldOverflowMonths()
- * @method static bool shouldOverflowYears()
- * @method static string singularUnit(string $unit)
- * @method static \Illuminate\Support\Carbon today($tz = null)
- * @method static \Illuminate\Support\Carbon tomorrow($tz = null)
- * @method static void useMonthsOverflow($monthsOverflow = true)
- * @method static void useStrictMode($strictModeEnabled = true)
- * @method static void useYearsOverflow($yearsOverflow = true)
- * @method static \Illuminate\Support\Carbon yesterday($tz = null)
- * @see \Illuminate\Support\DateFactory
- */
- class Date {
- /**
- * Use the given handler when generating dates (class name, callable, or factory).
- *
- * @param mixed $handler
- * @return mixed
- * @throws \InvalidArgumentException
- * @static
- */
- public static function use($handler)
- {
- return \Illuminate\Support\DateFactory::use($handler);
- }
- /**
- * Use the default date class when generating dates.
- *
- * @return void
- * @static
- */
- public static function useDefault()
- {
- \Illuminate\Support\DateFactory::useDefault();
- }
- /**
- * Execute the given callable on each date creation.
- *
- * @param callable $callable
- * @return void
- * @static
- */
- public static function useCallable($callable)
- {
- \Illuminate\Support\DateFactory::useCallable($callable);
- }
- /**
- * Use the given date type (class) when generating dates.
- *
- * @param string $dateClass
- * @return void
- * @static
- */
- public static function useClass($dateClass)
- {
- \Illuminate\Support\DateFactory::useClass($dateClass);
- }
- /**
- * Use the given Carbon factory when generating dates.
- *
- * @param object $factory
- * @return void
- * @static
- */
- public static function useFactory($factory)
- {
- \Illuminate\Support\DateFactory::useFactory($factory);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Database\DatabaseManager
- */
- class DB {
- /**
- * Get a database connection instance.
- *
- * @param string|null $name
- * @return \Illuminate\Database\Connection
- * @static
- */
- public static function connection($name = null)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->connection($name);
- }
- /**
- * Register a custom Doctrine type.
- *
- * @param string $class
- * @param string $name
- * @param string $type
- * @return void
- * @throws \Doctrine\DBAL\Exception
- * @throws \RuntimeException
- * @static
- */
- public static function registerDoctrineType($class, $name, $type)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- $instance->registerDoctrineType($class, $name, $type);
- }
- /**
- * Disconnect from the given database and remove from local cache.
- *
- * @param string|null $name
- * @return void
- * @static
- */
- public static function purge($name = null)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- $instance->purge($name);
- }
- /**
- * Disconnect from the given database.
- *
- * @param string|null $name
- * @return void
- * @static
- */
- public static function disconnect($name = null)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- $instance->disconnect($name);
- }
- /**
- * Reconnect to the given database.
- *
- * @param string|null $name
- * @return \Illuminate\Database\Connection
- * @static
- */
- public static function reconnect($name = null)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->reconnect($name);
- }
- /**
- * Set the default database connection for the callback execution.
- *
- * @param string $name
- * @param callable $callback
- * @return mixed
- * @static
- */
- public static function usingConnection($name, $callback)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->usingConnection($name, $callback);
- }
- /**
- * Get the default connection name.
- *
- * @return string
- * @static
- */
- public static function getDefaultConnection()
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->getDefaultConnection();
- }
- /**
- * Set the default connection name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultConnection($name)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- $instance->setDefaultConnection($name);
- }
- /**
- * Get all of the support drivers.
- *
- * @return string[]
- * @static
- */
- public static function supportedDrivers()
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->supportedDrivers();
- }
- /**
- * Get all of the drivers that are actually available.
- *
- * @return string[]
- * @static
- */
- public static function availableDrivers()
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->availableDrivers();
- }
- /**
- * Register an extension connection resolver.
- *
- * @param string $name
- * @param callable $resolver
- * @return void
- * @static
- */
- public static function extend($name, $resolver)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- $instance->extend($name, $resolver);
- }
- /**
- * Remove an extension connection resolver.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function forgetExtension($name)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- $instance->forgetExtension($name);
- }
- /**
- * Return all of the created connections.
- *
- * @return array
- * @static
- */
- public static function getConnections()
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->getConnections();
- }
- /**
- * Set the database reconnector callback.
- *
- * @param callable $reconnector
- * @return void
- * @static
- */
- public static function setReconnector($reconnector)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- $instance->setReconnector($reconnector);
- }
- /**
- * Set the application instance used by the manager.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return \Illuminate\Database\DatabaseManager
- * @static
- */
- public static function setApplication($app)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->setApplication($app);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Database\DatabaseManager::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Database\DatabaseManager::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Database\DatabaseManager::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Database\DatabaseManager::flushMacros();
- }
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- * @throws \BadMethodCallException
- * @static
- */
- public static function macroCall($method, $parameters)
- {
- /** @var \Illuminate\Database\DatabaseManager $instance */
- return $instance->macroCall($method, $parameters);
- }
- /**
- * Determine if the connected database is a MariaDB database.
- *
- * @return bool
- * @static
- */
- public static function isMaria()
- {
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->isMaria();
- }
- /**
- * Get a schema builder instance for the connection.
- *
- * @return \Illuminate\Database\Schema\MySqlBuilder
- * @static
- */
- public static function getSchemaBuilder()
- {
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getSchemaBuilder();
- }
- /**
- * Get the schema state for the connection.
- *
- * @param \Illuminate\Filesystem\Filesystem|null $files
- * @param callable|null $processFactory
- * @return \Illuminate\Database\Schema\MySqlSchemaState
- * @static
- */
- public static function getSchemaState($files = null, $processFactory = null)
- {
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getSchemaState($files, $processFactory);
- }
- /**
- * Set the query grammar to the default implementation.
- *
- * @return void
- * @static
- */
- public static function useDefaultQueryGrammar()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->useDefaultQueryGrammar();
- }
- /**
- * Set the schema grammar to the default implementation.
- *
- * @return void
- * @static
- */
- public static function useDefaultSchemaGrammar()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->useDefaultSchemaGrammar();
- }
- /**
- * Set the query post processor to the default implementation.
- *
- * @return void
- * @static
- */
- public static function useDefaultPostProcessor()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->useDefaultPostProcessor();
- }
- /**
- * Begin a fluent query against a database table.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string $table
- * @param string|null $as
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function table($table, $as = null)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->table($table, $as);
- }
- /**
- * Get a new query builder instance.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function query()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->query();
- }
- /**
- * Run a select statement and return a single result.
- *
- * @param string $query
- * @param array $bindings
- * @param bool $useReadPdo
- * @return mixed
- * @static
- */
- public static function selectOne($query, $bindings = [], $useReadPdo = true)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->selectOne($query, $bindings, $useReadPdo);
- }
- /**
- * Run a select statement and return the first column of the first row.
- *
- * @param string $query
- * @param array $bindings
- * @param bool $useReadPdo
- * @return mixed
- * @throws \Illuminate\Database\MultipleColumnsSelectedException
- * @static
- */
- public static function scalar($query, $bindings = [], $useReadPdo = true)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->scalar($query, $bindings, $useReadPdo);
- }
- /**
- * Run a select statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return array
- * @static
- */
- public static function selectFromWriteConnection($query, $bindings = [])
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->selectFromWriteConnection($query, $bindings);
- }
- /**
- * Run a select statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @param bool $useReadPdo
- * @return array
- * @static
- */
- public static function select($query, $bindings = [], $useReadPdo = true)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->select($query, $bindings, $useReadPdo);
- }
- /**
- * Run a select statement against the database and returns all of the result sets.
- *
- * @param string $query
- * @param array $bindings
- * @param bool $useReadPdo
- * @return array
- * @static
- */
- public static function selectResultSets($query, $bindings = [], $useReadPdo = true)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->selectResultSets($query, $bindings, $useReadPdo);
- }
- /**
- * Run a select statement against the database and returns a generator.
- *
- * @param string $query
- * @param array $bindings
- * @param bool $useReadPdo
- * @return \Generator
- * @static
- */
- public static function cursor($query, $bindings = [], $useReadPdo = true)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->cursor($query, $bindings, $useReadPdo);
- }
- /**
- * Run an insert statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return bool
- * @static
- */
- public static function insert($query, $bindings = [])
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->insert($query, $bindings);
- }
- /**
- * Run an update statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return int
- * @static
- */
- public static function update($query, $bindings = [])
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->update($query, $bindings);
- }
- /**
- * Run a delete statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return int
- * @static
- */
- public static function delete($query, $bindings = [])
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->delete($query, $bindings);
- }
- /**
- * Execute an SQL statement and return the boolean result.
- *
- * @param string $query
- * @param array $bindings
- * @return bool
- * @static
- */
- public static function statement($query, $bindings = [])
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->statement($query, $bindings);
- }
- /**
- * Run an SQL statement and get the number of rows affected.
- *
- * @param string $query
- * @param array $bindings
- * @return int
- * @static
- */
- public static function affectingStatement($query, $bindings = [])
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->affectingStatement($query, $bindings);
- }
- /**
- * Run a raw, unprepared query against the PDO connection.
- *
- * @param string $query
- * @return bool
- * @static
- */
- public static function unprepared($query)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->unprepared($query);
- }
- /**
- * Execute the given callback in "dry run" mode.
- *
- * @param \Closure $callback
- * @return array
- * @static
- */
- public static function pretend($callback)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->pretend($callback);
- }
- /**
- * Bind values to their parameters in the given statement.
- *
- * @param \PDOStatement $statement
- * @param array $bindings
- * @return void
- * @static
- */
- public static function bindValues($statement, $bindings)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->bindValues($statement, $bindings);
- }
- /**
- * Prepare the query bindings for execution.
- *
- * @param array $bindings
- * @return array
- * @static
- */
- public static function prepareBindings($bindings)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->prepareBindings($bindings);
- }
- /**
- * Log a query in the connection's query log.
- *
- * @param string $query
- * @param array $bindings
- * @param float|null $time
- * @return void
- * @static
- */
- public static function logQuery($query, $bindings, $time = null)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->logQuery($query, $bindings, $time);
- }
- /**
- * Register a callback to be invoked when the connection queries for longer than a given amount of time.
- *
- * @param \DateTimeInterface|\Carbon\CarbonInterval|float|int $threshold
- * @param callable $handler
- * @return void
- * @static
- */
- public static function whenQueryingForLongerThan($threshold, $handler)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->whenQueryingForLongerThan($threshold, $handler);
- }
- /**
- * Allow all the query duration handlers to run again, even if they have already run.
- *
- * @return void
- * @static
- */
- public static function allowQueryDurationHandlersToRunAgain()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->allowQueryDurationHandlersToRunAgain();
- }
- /**
- * Get the duration of all run queries in milliseconds.
- *
- * @return float
- * @static
- */
- public static function totalQueryDuration()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->totalQueryDuration();
- }
- /**
- * Reset the duration of all run queries.
- *
- * @return void
- * @static
- */
- public static function resetTotalQueryDuration()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->resetTotalQueryDuration();
- }
- /**
- * Reconnect to the database if a PDO connection is missing.
- *
- * @return void
- * @static
- */
- public static function reconnectIfMissingConnection()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->reconnectIfMissingConnection();
- }
- /**
- * Register a hook to be run just before a database query is executed.
- *
- * @param \Closure $callback
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function beforeExecuting($callback)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->beforeExecuting($callback);
- }
- /**
- * Register a database query listener with the connection.
- *
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function listen($callback)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->listen($callback);
- }
- /**
- * Get a new raw query expression.
- *
- * @param mixed $value
- * @return \Illuminate\Contracts\Database\Query\Expression
- * @static
- */
- public static function raw($value)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->raw($value);
- }
- /**
- * Escape a value for safe SQL embedding.
- *
- * @param string|float|int|bool|null $value
- * @param bool $binary
- * @return string
- * @static
- */
- public static function escape($value, $binary = false)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->escape($value, $binary);
- }
- /**
- * Determine if the database connection has modified any database records.
- *
- * @return bool
- * @static
- */
- public static function hasModifiedRecords()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->hasModifiedRecords();
- }
- /**
- * Indicate if any records have been modified.
- *
- * @param bool $value
- * @return void
- * @static
- */
- public static function recordsHaveBeenModified($value = true)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->recordsHaveBeenModified($value);
- }
- /**
- * Set the record modification state.
- *
- * @param bool $value
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setRecordModificationState($value)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setRecordModificationState($value);
- }
- /**
- * Reset the record modification state.
- *
- * @return void
- * @static
- */
- public static function forgetRecordModificationState()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->forgetRecordModificationState();
- }
- /**
- * Indicate that the connection should use the write PDO connection for reads.
- *
- * @param bool $value
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function useWriteConnectionWhenReading($value = true)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->useWriteConnectionWhenReading($value);
- }
- /**
- * Is Doctrine available?
- *
- * @return bool
- * @static
- */
- public static function isDoctrineAvailable()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->isDoctrineAvailable();
- }
- /**
- * Indicates whether native alter operations will be used when dropping, renaming, or modifying columns, even if Doctrine DBAL is installed.
- *
- * @return bool
- * @static
- */
- public static function usingNativeSchemaOperations()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->usingNativeSchemaOperations();
- }
- /**
- * Get a Doctrine Schema Column instance.
- *
- * @param string $table
- * @param string $column
- * @return \Doctrine\DBAL\Schema\Column
- * @static
- */
- public static function getDoctrineColumn($table, $column)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getDoctrineColumn($table, $column);
- }
- /**
- * Get the Doctrine DBAL schema manager for the connection.
- *
- * @return \Doctrine\DBAL\Schema\AbstractSchemaManager
- * @static
- */
- public static function getDoctrineSchemaManager()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getDoctrineSchemaManager();
- }
- /**
- * Get the Doctrine DBAL database connection instance.
- *
- * @return \Doctrine\DBAL\Connection
- * @static
- */
- public static function getDoctrineConnection()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getDoctrineConnection();
- }
- /**
- * Get the current PDO connection.
- *
- * @return \PDO
- * @static
- */
- public static function getPdo()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getPdo();
- }
- /**
- * Get the current PDO connection parameter without executing any reconnect logic.
- *
- * @return \PDO|\Closure|null
- * @static
- */
- public static function getRawPdo()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getRawPdo();
- }
- /**
- * Get the current PDO connection used for reading.
- *
- * @return \PDO
- * @static
- */
- public static function getReadPdo()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getReadPdo();
- }
- /**
- * Get the current read PDO connection parameter without executing any reconnect logic.
- *
- * @return \PDO|\Closure|null
- * @static
- */
- public static function getRawReadPdo()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getRawReadPdo();
- }
- /**
- * Set the PDO connection.
- *
- * @param \PDO|\Closure|null $pdo
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setPdo($pdo)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setPdo($pdo);
- }
- /**
- * Set the PDO connection used for reading.
- *
- * @param \PDO|\Closure|null $pdo
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setReadPdo($pdo)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setReadPdo($pdo);
- }
- /**
- * Get the database connection name.
- *
- * @return string|null
- * @static
- */
- public static function getName()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getName();
- }
- /**
- * Get the database connection full name.
- *
- * @return string|null
- * @static
- */
- public static function getNameWithReadWriteType()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getNameWithReadWriteType();
- }
- /**
- * Get an option from the configuration options.
- *
- * @param string|null $option
- * @return mixed
- * @static
- */
- public static function getConfig($option = null)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getConfig($option);
- }
- /**
- * Get the PDO driver name.
- *
- * @return string
- * @static
- */
- public static function getDriverName()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getDriverName();
- }
- /**
- * Get the query grammar used by the connection.
- *
- * @return \Illuminate\Database\Query\Grammars\Grammar
- * @static
- */
- public static function getQueryGrammar()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getQueryGrammar();
- }
- /**
- * Set the query grammar used by the connection.
- *
- * @param \Illuminate\Database\Query\Grammars\Grammar $grammar
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setQueryGrammar($grammar)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setQueryGrammar($grammar);
- }
- /**
- * Get the schema grammar used by the connection.
- *
- * @return \Illuminate\Database\Schema\Grammars\Grammar
- * @static
- */
- public static function getSchemaGrammar()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getSchemaGrammar();
- }
- /**
- * Set the schema grammar used by the connection.
- *
- * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setSchemaGrammar($grammar)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setSchemaGrammar($grammar);
- }
- /**
- * Get the query post processor used by the connection.
- *
- * @return \Illuminate\Database\Query\Processors\Processor
- * @static
- */
- public static function getPostProcessor()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getPostProcessor();
- }
- /**
- * Set the query post processor used by the connection.
- *
- * @param \Illuminate\Database\Query\Processors\Processor $processor
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setPostProcessor($processor)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setPostProcessor($processor);
- }
- /**
- * Get the event dispatcher used by the connection.
- *
- * @return \Illuminate\Contracts\Events\Dispatcher
- * @static
- */
- public static function getEventDispatcher()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getEventDispatcher();
- }
- /**
- * Set the event dispatcher instance on the connection.
- *
- * @param \Illuminate\Contracts\Events\Dispatcher $events
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setEventDispatcher($events)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setEventDispatcher($events);
- }
- /**
- * Unset the event dispatcher for this connection.
- *
- * @return void
- * @static
- */
- public static function unsetEventDispatcher()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->unsetEventDispatcher();
- }
- /**
- * Set the transaction manager instance on the connection.
- *
- * @param \Illuminate\Database\DatabaseTransactionsManager $manager
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setTransactionManager($manager)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setTransactionManager($manager);
- }
- /**
- * Unset the transaction manager for this connection.
- *
- * @return void
- * @static
- */
- public static function unsetTransactionManager()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->unsetTransactionManager();
- }
- /**
- * Determine if the connection is in a "dry run".
- *
- * @return bool
- * @static
- */
- public static function pretending()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->pretending();
- }
- /**
- * Get the connection query log.
- *
- * @return array
- * @static
- */
- public static function getQueryLog()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getQueryLog();
- }
- /**
- * Get the connection query log with embedded bindings.
- *
- * @return array
- * @static
- */
- public static function getRawQueryLog()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getRawQueryLog();
- }
- /**
- * Clear the query log.
- *
- * @return void
- * @static
- */
- public static function flushQueryLog()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->flushQueryLog();
- }
- /**
- * Enable the query log on the connection.
- *
- * @return void
- * @static
- */
- public static function enableQueryLog()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->enableQueryLog();
- }
- /**
- * Disable the query log on the connection.
- *
- * @return void
- * @static
- */
- public static function disableQueryLog()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->disableQueryLog();
- }
- /**
- * Determine whether we're logging queries.
- *
- * @return bool
- * @static
- */
- public static function logging()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->logging();
- }
- /**
- * Get the name of the connected database.
- *
- * @return string
- * @static
- */
- public static function getDatabaseName()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getDatabaseName();
- }
- /**
- * Set the name of the connected database.
- *
- * @param string $database
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setDatabaseName($database)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setDatabaseName($database);
- }
- /**
- * Set the read / write type of the connection.
- *
- * @param string|null $readWriteType
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setReadWriteType($readWriteType)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setReadWriteType($readWriteType);
- }
- /**
- * Get the table prefix for the connection.
- *
- * @return string
- * @static
- */
- public static function getTablePrefix()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->getTablePrefix();
- }
- /**
- * Set the table prefix in use by the connection.
- *
- * @param string $prefix
- * @return \Illuminate\Database\MySqlConnection
- * @static
- */
- public static function setTablePrefix($prefix)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->setTablePrefix($prefix);
- }
- /**
- * Set the table prefix and return the grammar.
- *
- * @param \Illuminate\Database\Grammar $grammar
- * @return \Illuminate\Database\Grammar
- * @static
- */
- public static function withTablePrefix($grammar)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->withTablePrefix($grammar);
- }
- /**
- * Register a connection resolver.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function resolverFor($driver, $callback)
- { //Method inherited from \Illuminate\Database\Connection
- \Illuminate\Database\MySqlConnection::resolverFor($driver, $callback);
- }
- /**
- * Get the connection resolver for the given driver.
- *
- * @param string $driver
- * @return mixed
- * @static
- */
- public static function getResolver($driver)
- { //Method inherited from \Illuminate\Database\Connection
- return \Illuminate\Database\MySqlConnection::getResolver($driver);
- }
- /**
- * Execute a Closure within a transaction.
- *
- * @param \Closure $callback
- * @param int $attempts
- * @return mixed
- * @throws \Throwable
- * @static
- */
- public static function transaction($callback, $attempts = 1)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->transaction($callback, $attempts);
- }
- /**
- * Start a new database transaction.
- *
- * @return void
- * @throws \Throwable
- * @static
- */
- public static function beginTransaction()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->beginTransaction();
- }
- /**
- * Commit the active database transaction.
- *
- * @return void
- * @throws \Throwable
- * @static
- */
- public static function commit()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->commit();
- }
- /**
- * Rollback the active database transaction.
- *
- * @param int|null $toLevel
- * @return void
- * @throws \Throwable
- * @static
- */
- public static function rollBack($toLevel = null)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->rollBack($toLevel);
- }
- /**
- * Get the number of active transactions.
- *
- * @return int
- * @static
- */
- public static function transactionLevel()
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- return $instance->transactionLevel();
- }
- /**
- * Execute the callback after a transaction commits.
- *
- * @param callable $callback
- * @return void
- * @throws \RuntimeException
- * @static
- */
- public static function afterCommit($callback)
- { //Method inherited from \Illuminate\Database\Connection
- /** @var \Illuminate\Database\MySqlConnection $instance */
- $instance->afterCommit($callback);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Events\Dispatcher
- * @see \Illuminate\Support\Testing\Fakes\EventFake
- */
- class Event {
- /**
- * Register an event listener with the dispatcher.
- *
- * @param \Closure|string|array $events
- * @param \Closure|string|array|null $listener
- * @return void
- * @static
- */
- public static function listen($events, $listener = null)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- $instance->listen($events, $listener);
- }
- /**
- * Determine if a given event has listeners.
- *
- * @param string $eventName
- * @return bool
- * @static
- */
- public static function hasListeners($eventName)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->hasListeners($eventName);
- }
- /**
- * Determine if the given event has any wildcard listeners.
- *
- * @param string $eventName
- * @return bool
- * @static
- */
- public static function hasWildcardListeners($eventName)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->hasWildcardListeners($eventName);
- }
- /**
- * Register an event and payload to be fired later.
- *
- * @param string $event
- * @param object|array $payload
- * @return void
- * @static
- */
- public static function push($event, $payload = [])
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- $instance->push($event, $payload);
- }
- /**
- * Flush a set of pushed events.
- *
- * @param string $event
- * @return void
- * @static
- */
- public static function flush($event)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- $instance->flush($event);
- }
- /**
- * Register an event subscriber with the dispatcher.
- *
- * @param object|string $subscriber
- * @return void
- * @static
- */
- public static function subscribe($subscriber)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- $instance->subscribe($subscriber);
- }
- /**
- * Fire an event until the first non-null response is returned.
- *
- * @param string|object $event
- * @param mixed $payload
- * @return mixed
- * @static
- */
- public static function until($event, $payload = [])
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->until($event, $payload);
- }
- /**
- * Fire an event and call the listeners.
- *
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- * @return array|null
- * @static
- */
- public static function dispatch($event, $payload = [], $halt = false)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->dispatch($event, $payload, $halt);
- }
- /**
- * Get all of the listeners for a given event name.
- *
- * @param string $eventName
- * @return array
- * @static
- */
- public static function getListeners($eventName)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->getListeners($eventName);
- }
- /**
- * Register an event listener with the dispatcher.
- *
- * @param \Closure|string|array $listener
- * @param bool $wildcard
- * @return \Closure
- * @static
- */
- public static function makeListener($listener, $wildcard = false)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->makeListener($listener, $wildcard);
- }
- /**
- * Create a class based listener using the IoC container.
- *
- * @param string $listener
- * @param bool $wildcard
- * @return \Closure
- * @static
- */
- public static function createClassListener($listener, $wildcard = false)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->createClassListener($listener, $wildcard);
- }
- /**
- * Remove a set of listeners from the dispatcher.
- *
- * @param string $event
- * @return void
- * @static
- */
- public static function forget($event)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- $instance->forget($event);
- }
- /**
- * Forget all of the pushed listeners.
- *
- * @return void
- * @static
- */
- public static function forgetPushed()
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- $instance->forgetPushed();
- }
- /**
- * Set the queue resolver implementation.
- *
- * @param callable $resolver
- * @return \Illuminate\Events\Dispatcher
- * @static
- */
- public static function setQueueResolver($resolver)
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->setQueueResolver($resolver);
- }
- /**
- * Gets the raw, unprepared listeners.
- *
- * @return array
- * @static
- */
- public static function getRawListeners()
- {
- /** @var \Illuminate\Events\Dispatcher $instance */
- return $instance->getRawListeners();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Events\Dispatcher::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Events\Dispatcher::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Events\Dispatcher::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Events\Dispatcher::flushMacros();
- }
- /**
- * Specify the events that should be dispatched instead of faked.
- *
- * @param array|string $eventsToDispatch
- * @return \Illuminate\Support\Testing\Fakes\EventFake
- * @static
- */
- public static function except($eventsToDispatch)
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- return $instance->except($eventsToDispatch);
- }
- /**
- * Assert if an event has a listener attached to it.
- *
- * @param string $expectedEvent
- * @param string|array $expectedListener
- * @return void
- * @static
- */
- public static function assertListening($expectedEvent, $expectedListener)
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- $instance->assertListening($expectedEvent, $expectedListener);
- }
- /**
- * Assert if an event was dispatched based on a truth-test callback.
- *
- * @param string|\Closure $event
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertDispatched($event, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- $instance->assertDispatched($event, $callback);
- }
- /**
- * Assert if an event was dispatched a number of times.
- *
- * @param string $event
- * @param int $times
- * @return void
- * @static
- */
- public static function assertDispatchedTimes($event, $times = 1)
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- $instance->assertDispatchedTimes($event, $times);
- }
- /**
- * Determine if an event was dispatched based on a truth-test callback.
- *
- * @param string|\Closure $event
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotDispatched($event, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- $instance->assertNotDispatched($event, $callback);
- }
- /**
- * Assert that no events were dispatched.
- *
- * @return void
- * @static
- */
- public static function assertNothingDispatched()
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- $instance->assertNothingDispatched();
- }
- /**
- * Get all of the events matching a truth-test callback.
- *
- * @param string $event
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function dispatched($event, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- return $instance->dispatched($event, $callback);
- }
- /**
- * Determine if the given event has been dispatched.
- *
- * @param string $event
- * @return bool
- * @static
- */
- public static function hasDispatched($event)
- {
- /** @var \Illuminate\Support\Testing\Fakes\EventFake $instance */
- return $instance->hasDispatched($event);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Filesystem\Filesystem
- */
- class File {
- /**
- * Determine if a file or directory exists.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function exists($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->exists($path);
- }
- /**
- * Determine if a file or directory is missing.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function missing($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->missing($path);
- }
- /**
- * Get the contents of a file.
- *
- * @param string $path
- * @param bool $lock
- * @return string
- * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
- * @static
- */
- public static function get($path, $lock = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->get($path, $lock);
- }
- /**
- * Get the contents of a file as decoded JSON.
- *
- * @param string $path
- * @param int $flags
- * @param bool $lock
- * @return array
- * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
- * @static
- */
- public static function json($path, $flags = 0, $lock = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->json($path, $flags, $lock);
- }
- /**
- * Get contents of a file with shared access.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function sharedGet($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->sharedGet($path);
- }
- /**
- * Get the returned value of a file.
- *
- * @param string $path
- * @param array $data
- * @return mixed
- * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
- * @static
- */
- public static function getRequire($path, $data = [])
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->getRequire($path, $data);
- }
- /**
- * Require the given file once.
- *
- * @param string $path
- * @param array $data
- * @return mixed
- * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
- * @static
- */
- public static function requireOnce($path, $data = [])
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->requireOnce($path, $data);
- }
- /**
- * Get the contents of a file one line at a time.
- *
- * @param string $path
- * @return \Illuminate\Support\LazyCollection
- * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
- * @static
- */
- public static function lines($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->lines($path);
- }
- /**
- * Get the hash of the file at the given path.
- *
- * @param string $path
- * @param string $algorithm
- * @return string
- * @static
- */
- public static function hash($path, $algorithm = 'md5')
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->hash($path, $algorithm);
- }
- /**
- * Write the contents of a file.
- *
- * @param string $path
- * @param string $contents
- * @param bool $lock
- * @return int|bool
- * @static
- */
- public static function put($path, $contents, $lock = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->put($path, $contents, $lock);
- }
- /**
- * Write the contents of a file, replacing it atomically if it already exists.
- *
- * @param string $path
- * @param string $content
- * @param int|null $mode
- * @return void
- * @static
- */
- public static function replace($path, $content, $mode = null)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- $instance->replace($path, $content, $mode);
- }
- /**
- * Replace a given string within a given file.
- *
- * @param array|string $search
- * @param array|string $replace
- * @param string $path
- * @return void
- * @static
- */
- public static function replaceInFile($search, $replace, $path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- $instance->replaceInFile($search, $replace, $path);
- }
- /**
- * Prepend to a file.
- *
- * @param string $path
- * @param string $data
- * @return int
- * @static
- */
- public static function prepend($path, $data)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->prepend($path, $data);
- }
- /**
- * Append to a file.
- *
- * @param string $path
- * @param string $data
- * @return int
- * @static
- */
- public static function append($path, $data)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->append($path, $data);
- }
- /**
- * Get or set UNIX mode of a file or directory.
- *
- * @param string $path
- * @param int|null $mode
- * @return mixed
- * @static
- */
- public static function chmod($path, $mode = null)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->chmod($path, $mode);
- }
- /**
- * Delete the file at a given path.
- *
- * @param string|array $paths
- * @return bool
- * @static
- */
- public static function delete($paths)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->delete($paths);
- }
- /**
- * Move a file to a new location.
- *
- * @param string $path
- * @param string $target
- * @return bool
- * @static
- */
- public static function move($path, $target)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->move($path, $target);
- }
- /**
- * Copy a file to a new location.
- *
- * @param string $path
- * @param string $target
- * @return bool
- * @static
- */
- public static function copy($path, $target)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->copy($path, $target);
- }
- /**
- * Create a symlink to the target file or directory. On Windows, a hard link is created if the target is a file.
- *
- * @param string $target
- * @param string $link
- * @return void
- * @static
- */
- public static function link($target, $link)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- $instance->link($target, $link);
- }
- /**
- * Create a relative symlink to the target file or directory.
- *
- * @param string $target
- * @param string $link
- * @return void
- * @throws \RuntimeException
- * @static
- */
- public static function relativeLink($target, $link)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- $instance->relativeLink($target, $link);
- }
- /**
- * Extract the file name from a file path.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function name($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->name($path);
- }
- /**
- * Extract the trailing name component from a file path.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function basename($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->basename($path);
- }
- /**
- * Extract the parent directory from a file path.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function dirname($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->dirname($path);
- }
- /**
- * Extract the file extension from a file path.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function extension($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->extension($path);
- }
- /**
- * Guess the file extension from the mime-type of a given file.
- *
- * @param string $path
- * @return string|null
- * @throws \RuntimeException
- * @static
- */
- public static function guessExtension($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->guessExtension($path);
- }
- /**
- * Get the file type of a given file.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function type($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->type($path);
- }
- /**
- * Get the mime-type of a given file.
- *
- * @param string $path
- * @return string|false
- * @static
- */
- public static function mimeType($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->mimeType($path);
- }
- /**
- * Get the file size of a given file.
- *
- * @param string $path
- * @return int
- * @static
- */
- public static function size($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->size($path);
- }
- /**
- * Get the file's last modification time.
- *
- * @param string $path
- * @return int
- * @static
- */
- public static function lastModified($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->lastModified($path);
- }
- /**
- * Determine if the given path is a directory.
- *
- * @param string $directory
- * @return bool
- * @static
- */
- public static function isDirectory($directory)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->isDirectory($directory);
- }
- /**
- * Determine if the given path is a directory that does not contain any other files or directories.
- *
- * @param string $directory
- * @param bool $ignoreDotFiles
- * @return bool
- * @static
- */
- public static function isEmptyDirectory($directory, $ignoreDotFiles = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->isEmptyDirectory($directory, $ignoreDotFiles);
- }
- /**
- * Determine if the given path is readable.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function isReadable($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->isReadable($path);
- }
- /**
- * Determine if the given path is writable.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function isWritable($path)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->isWritable($path);
- }
- /**
- * Determine if two files are the same by comparing their hashes.
- *
- * @param string $firstFile
- * @param string $secondFile
- * @return bool
- * @static
- */
- public static function hasSameHash($firstFile, $secondFile)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->hasSameHash($firstFile, $secondFile);
- }
- /**
- * Determine if the given path is a file.
- *
- * @param string $file
- * @return bool
- * @static
- */
- public static function isFile($file)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->isFile($file);
- }
- /**
- * Find path names matching a given pattern.
- *
- * @param string $pattern
- * @param int $flags
- * @return array
- * @static
- */
- public static function glob($pattern, $flags = 0)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->glob($pattern, $flags);
- }
- /**
- * Get an array of all files in a directory.
- *
- * @param string $directory
- * @param bool $hidden
- * @return \Symfony\Component\Finder\SplFileInfo[]
- * @static
- */
- public static function files($directory, $hidden = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->files($directory, $hidden);
- }
- /**
- * Get all of the files from the given directory (recursive).
- *
- * @param string $directory
- * @param bool $hidden
- * @return \Symfony\Component\Finder\SplFileInfo[]
- * @static
- */
- public static function allFiles($directory, $hidden = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->allFiles($directory, $hidden);
- }
- /**
- * Get all of the directories within a given directory.
- *
- * @param string $directory
- * @return array
- * @static
- */
- public static function directories($directory)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->directories($directory);
- }
- /**
- * Ensure a directory exists.
- *
- * @param string $path
- * @param int $mode
- * @param bool $recursive
- * @return void
- * @static
- */
- public static function ensureDirectoryExists($path, $mode = 493, $recursive = true)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- $instance->ensureDirectoryExists($path, $mode, $recursive);
- }
- /**
- * Create a directory.
- *
- * @param string $path
- * @param int $mode
- * @param bool $recursive
- * @param bool $force
- * @return bool
- * @static
- */
- public static function makeDirectory($path, $mode = 493, $recursive = false, $force = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->makeDirectory($path, $mode, $recursive, $force);
- }
- /**
- * Move a directory.
- *
- * @param string $from
- * @param string $to
- * @param bool $overwrite
- * @return bool
- * @static
- */
- public static function moveDirectory($from, $to, $overwrite = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->moveDirectory($from, $to, $overwrite);
- }
- /**
- * Copy a directory from one location to another.
- *
- * @param string $directory
- * @param string $destination
- * @param int|null $options
- * @return bool
- * @static
- */
- public static function copyDirectory($directory, $destination, $options = null)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->copyDirectory($directory, $destination, $options);
- }
- /**
- * Recursively delete a directory.
- *
- * The directory itself may be optionally preserved.
- *
- * @param string $directory
- * @param bool $preserve
- * @return bool
- * @static
- */
- public static function deleteDirectory($directory, $preserve = false)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->deleteDirectory($directory, $preserve);
- }
- /**
- * Remove all of the directories within a given directory.
- *
- * @param string $directory
- * @return bool
- * @static
- */
- public static function deleteDirectories($directory)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->deleteDirectories($directory);
- }
- /**
- * Empty the specified directory of all files and folders.
- *
- * @param string $directory
- * @return bool
- * @static
- */
- public static function cleanDirectory($directory)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->cleanDirectory($directory);
- }
- /**
- * Apply the callback if the given "value" is (or resolves to) truthy.
- *
- * @template TWhenParameter
- * @template TWhenReturnType
- * @param \Illuminate\Filesystem\(\Closure($this): TWhenParameter)|TWhenParameter|null $value
- * @param \Illuminate\Filesystem\(callable($this, TWhenParameter): TWhenReturnType)|null $callback
- * @param \Illuminate\Filesystem\(callable($this, TWhenParameter): TWhenReturnType)|null $default
- * @return $this|\Illuminate\Filesystem\TWhenReturnType
- * @static
- */
- public static function when($value = null, $callback = null, $default = null)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->when($value, $callback, $default);
- }
- /**
- * Apply the callback if the given "value" is (or resolves to) falsy.
- *
- * @template TUnlessParameter
- * @template TUnlessReturnType
- * @param \Illuminate\Filesystem\(\Closure($this): TUnlessParameter)|TUnlessParameter|null $value
- * @param \Illuminate\Filesystem\(callable($this, TUnlessParameter): TUnlessReturnType)|null $callback
- * @param \Illuminate\Filesystem\(callable($this, TUnlessParameter): TUnlessReturnType)|null $default
- * @return $this|\Illuminate\Filesystem\TUnlessReturnType
- * @static
- */
- public static function unless($value = null, $callback = null, $default = null)
- {
- /** @var \Illuminate\Filesystem\Filesystem $instance */
- return $instance->unless($value, $callback, $default);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Filesystem\Filesystem::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Filesystem\Filesystem::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Filesystem\Filesystem::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Filesystem\Filesystem::flushMacros();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Auth\Access\Gate
- */
- class Gate {
- /**
- * Determine if a given ability has been defined.
- *
- * @param string|array $ability
- * @return bool
- * @static
- */
- public static function has($ability)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->has($ability);
- }
- /**
- * Perform an on-demand authorization check. Throw an authorization exception if the condition or callback is false.
- *
- * @param \Illuminate\Auth\Access\Response|\Closure|bool $condition
- * @param string|null $message
- * @param string|null $code
- * @return \Illuminate\Auth\Access\Response
- * @throws \Illuminate\Auth\Access\AuthorizationException
- * @static
- */
- public static function allowIf($condition, $message = null, $code = null)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->allowIf($condition, $message, $code);
- }
- /**
- * Perform an on-demand authorization check. Throw an authorization exception if the condition or callback is true.
- *
- * @param \Illuminate\Auth\Access\Response|\Closure|bool $condition
- * @param string|null $message
- * @param string|null $code
- * @return \Illuminate\Auth\Access\Response
- * @throws \Illuminate\Auth\Access\AuthorizationException
- * @static
- */
- public static function denyIf($condition, $message = null, $code = null)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->denyIf($condition, $message, $code);
- }
- /**
- * Define a new ability.
- *
- * @param string $ability
- * @param callable|array|string $callback
- * @return \Illuminate\Auth\Access\Gate
- * @throws \InvalidArgumentException
- * @static
- */
- public static function define($ability, $callback)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->define($ability, $callback);
- }
- /**
- * Define abilities for a resource.
- *
- * @param string $name
- * @param string $class
- * @param array|null $abilities
- * @return \Illuminate\Auth\Access\Gate
- * @static
- */
- public static function resource($name, $class, $abilities = null)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->resource($name, $class, $abilities);
- }
- /**
- * Define a policy class for a given class type.
- *
- * @param string $class
- * @param string $policy
- * @return \Illuminate\Auth\Access\Gate
- * @static
- */
- public static function policy($class, $policy)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->policy($class, $policy);
- }
- /**
- * Register a callback to run before all Gate checks.
- *
- * @param callable $callback
- * @return \Illuminate\Auth\Access\Gate
- * @static
- */
- public static function before($callback)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->before($callback);
- }
- /**
- * Register a callback to run after all Gate checks.
- *
- * @param callable $callback
- * @return \Illuminate\Auth\Access\Gate
- * @static
- */
- public static function after($callback)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->after($callback);
- }
- /**
- * Determine if the given ability should be granted for the current user.
- *
- * @param string $ability
- * @param array|mixed $arguments
- * @return bool
- * @static
- */
- public static function allows($ability, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->allows($ability, $arguments);
- }
- /**
- * Determine if the given ability should be denied for the current user.
- *
- * @param string $ability
- * @param array|mixed $arguments
- * @return bool
- * @static
- */
- public static function denies($ability, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->denies($ability, $arguments);
- }
- /**
- * Determine if all of the given abilities should be granted for the current user.
- *
- * @param \Illuminate\Auth\Access\iterable|string $abilities
- * @param array|mixed $arguments
- * @return bool
- * @static
- */
- public static function check($abilities, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->check($abilities, $arguments);
- }
- /**
- * Determine if any one of the given abilities should be granted for the current user.
- *
- * @param \Illuminate\Auth\Access\iterable|string $abilities
- * @param array|mixed $arguments
- * @return bool
- * @static
- */
- public static function any($abilities, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->any($abilities, $arguments);
- }
- /**
- * Determine if all of the given abilities should be denied for the current user.
- *
- * @param \Illuminate\Auth\Access\iterable|string $abilities
- * @param array|mixed $arguments
- * @return bool
- * @static
- */
- public static function none($abilities, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->none($abilities, $arguments);
- }
- /**
- * Determine if the given ability should be granted for the current user.
- *
- * @param string $ability
- * @param array|mixed $arguments
- * @return \Illuminate\Auth\Access\Response
- * @throws \Illuminate\Auth\Access\AuthorizationException
- * @static
- */
- public static function authorize($ability, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->authorize($ability, $arguments);
- }
- /**
- * Inspect the user for the given ability.
- *
- * @param string $ability
- * @param array|mixed $arguments
- * @return \Illuminate\Auth\Access\Response
- * @static
- */
- public static function inspect($ability, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->inspect($ability, $arguments);
- }
- /**
- * Get the raw result from the authorization callback.
- *
- * @param string $ability
- * @param array|mixed $arguments
- * @return mixed
- * @throws \Illuminate\Auth\Access\AuthorizationException
- * @static
- */
- public static function raw($ability, $arguments = [])
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->raw($ability, $arguments);
- }
- /**
- * Get a policy instance for a given class.
- *
- * @param object|string $class
- * @return mixed
- * @static
- */
- public static function getPolicyFor($class)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->getPolicyFor($class);
- }
- /**
- * Specify a callback to be used to guess policy names.
- *
- * @param callable $callback
- * @return \Illuminate\Auth\Access\Gate
- * @static
- */
- public static function guessPolicyNamesUsing($callback)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->guessPolicyNamesUsing($callback);
- }
- /**
- * Build a policy class instance of the given type.
- *
- * @param object|string $class
- * @return mixed
- * @throws \Illuminate\Contracts\Container\BindingResolutionException
- * @static
- */
- public static function resolvePolicy($class)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->resolvePolicy($class);
- }
- /**
- * Get a gate instance for the given user.
- *
- * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user
- * @return static
- * @static
- */
- public static function forUser($user)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->forUser($user);
- }
- /**
- * Get all of the defined abilities.
- *
- * @return array
- * @static
- */
- public static function abilities()
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->abilities();
- }
- /**
- * Get all of the defined policies.
- *
- * @return array
- * @static
- */
- public static function policies()
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->policies();
- }
- /**
- * Set the default denial response for gates and policies.
- *
- * @param \Illuminate\Auth\Access\Response $response
- * @return \Illuminate\Auth\Access\Gate
- * @static
- */
- public static function defaultDenialResponse($response)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->defaultDenialResponse($response);
- }
- /**
- * Set the container instance used by the gate.
- *
- * @param \Illuminate\Contracts\Container\Container $container
- * @return \Illuminate\Auth\Access\Gate
- * @static
- */
- public static function setContainer($container)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->setContainer($container);
- }
- /**
- * Deny with a HTTP status code.
- *
- * @param int $status
- * @param string|null $message
- * @param int|null $code
- * @return \Illuminate\Auth\Access\Response
- * @static
- */
- public static function denyWithStatus($status, $message = null, $code = null)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->denyWithStatus($status, $message, $code);
- }
- /**
- * Deny with a 404 HTTP status code.
- *
- * @param string|null $message
- * @param int|null $code
- * @return \Illuminate\Auth\Access\Response
- * @static
- */
- public static function denyAsNotFound($message = null, $code = null)
- {
- /** @var \Illuminate\Auth\Access\Gate $instance */
- return $instance->denyAsNotFound($message, $code);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Hashing\HashManager
- * @see \Illuminate\Hashing\AbstractHasher
- */
- class Hash {
- /**
- * Create an instance of the Bcrypt hash Driver.
- *
- * @return \Illuminate\Hashing\BcryptHasher
- * @static
- */
- public static function createBcryptDriver()
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->createBcryptDriver();
- }
- /**
- * Create an instance of the Argon2i hash Driver.
- *
- * @return \Illuminate\Hashing\ArgonHasher
- * @static
- */
- public static function createArgonDriver()
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->createArgonDriver();
- }
- /**
- * Create an instance of the Argon2id hash Driver.
- *
- * @return \Illuminate\Hashing\Argon2IdHasher
- * @static
- */
- public static function createArgon2idDriver()
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->createArgon2idDriver();
- }
- /**
- * Get information about the given hashed value.
- *
- * @param string $hashedValue
- * @return array
- * @static
- */
- public static function info($hashedValue)
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->info($hashedValue);
- }
- /**
- * Hash the given value.
- *
- * @param string $value
- * @param array $options
- * @return string
- * @static
- */
- public static function make($value, $options = [])
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->make($value, $options);
- }
- /**
- * Check the given plain value against a hash.
- *
- * @param string $value
- * @param string $hashedValue
- * @param array $options
- * @return bool
- * @static
- */
- public static function check($value, $hashedValue, $options = [])
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->check($value, $hashedValue, $options);
- }
- /**
- * Check if the given hash has been hashed using the given options.
- *
- * @param string $hashedValue
- * @param array $options
- * @return bool
- * @static
- */
- public static function needsRehash($hashedValue, $options = [])
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->needsRehash($hashedValue, $options);
- }
- /**
- * Determine if a given string is already hashed.
- *
- * @param string $value
- * @return bool
- * @static
- */
- public static function isHashed($value)
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->isHashed($value);
- }
- /**
- * Get the default driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Get a driver instance.
- *
- * @param string|null $driver
- * @return mixed
- * @throws \InvalidArgumentException
- * @static
- */
- public static function driver($driver = null)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->driver($driver);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Hashing\HashManager
- * @static
- */
- public static function extend($driver, $callback)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Get all of the created "drivers".
- *
- * @return array
- * @static
- */
- public static function getDrivers()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->getDrivers();
- }
- /**
- * Get the container instance used by the manager.
- *
- * @return \Illuminate\Contracts\Container\Container
- * @static
- */
- public static function getContainer()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->getContainer();
- }
- /**
- * Set the container instance used by the manager.
- *
- * @param \Illuminate\Contracts\Container\Container $container
- * @return \Illuminate\Hashing\HashManager
- * @static
- */
- public static function setContainer($container)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->setContainer($container);
- }
- /**
- * Forget all of the resolved driver instances.
- *
- * @return \Illuminate\Hashing\HashManager
- * @static
- */
- public static function forgetDrivers()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Hashing\HashManager $instance */
- return $instance->forgetDrivers();
- }
-
- }
- /**
- *
- *
- * @method static \Illuminate\Http\Client\PendingRequest baseUrl(string $url)
- * @method static \Illuminate\Http\Client\PendingRequest withBody(string $content, string $contentType = 'application/json')
- * @method static \Illuminate\Http\Client\PendingRequest asJson()
- * @method static \Illuminate\Http\Client\PendingRequest asForm()
- * @method static \Illuminate\Http\Client\PendingRequest attach(string|array $name, string|resource $contents = '', string|null $filename = null, array $headers = [])
- * @method static \Illuminate\Http\Client\PendingRequest asMultipart()
- * @method static \Illuminate\Http\Client\PendingRequest bodyFormat(string $format)
- * @method static \Illuminate\Http\Client\PendingRequest withQueryParameters(array $parameters)
- * @method static \Illuminate\Http\Client\PendingRequest contentType(string $contentType)
- * @method static \Illuminate\Http\Client\PendingRequest acceptJson()
- * @method static \Illuminate\Http\Client\PendingRequest accept(string $contentType)
- * @method static \Illuminate\Http\Client\PendingRequest withHeaders(array $headers)
- * @method static \Illuminate\Http\Client\PendingRequest withHeader(string $name, mixed $value)
- * @method static \Illuminate\Http\Client\PendingRequest replaceHeaders(array $headers)
- * @method static \Illuminate\Http\Client\PendingRequest withBasicAuth(string $username, string $password)
- * @method static \Illuminate\Http\Client\PendingRequest withDigestAuth(string $username, string $password)
- * @method static \Illuminate\Http\Client\PendingRequest withToken(string $token, string $type = 'Bearer')
- * @method static \Illuminate\Http\Client\PendingRequest withUserAgent(string|bool $userAgent)
- * @method static \Illuminate\Http\Client\PendingRequest withUrlParameters(array $parameters = [])
- * @method static \Illuminate\Http\Client\PendingRequest withCookies(array $cookies, string $domain)
- * @method static \Illuminate\Http\Client\PendingRequest maxRedirects(int $max)
- * @method static \Illuminate\Http\Client\PendingRequest withoutRedirecting()
- * @method static \Illuminate\Http\Client\PendingRequest withoutVerifying()
- * @method static \Illuminate\Http\Client\PendingRequest sink(string|resource $to)
- * @method static \Illuminate\Http\Client\PendingRequest timeout(int $seconds)
- * @method static \Illuminate\Http\Client\PendingRequest connectTimeout(int $seconds)
- * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, \Closure|int $sleepMilliseconds = 0, callable|null $when = null, bool $throw = true)
- * @method static \Illuminate\Http\Client\PendingRequest withOptions(array $options)
- * @method static \Illuminate\Http\Client\PendingRequest withMiddleware(callable $middleware)
- * @method static \Illuminate\Http\Client\PendingRequest withRequestMiddleware(callable $middleware)
- * @method static \Illuminate\Http\Client\PendingRequest withResponseMiddleware(callable $middleware)
- * @method static \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback)
- * @method static \Illuminate\Http\Client\PendingRequest throw(callable|null $callback = null)
- * @method static \Illuminate\Http\Client\PendingRequest throwIf(callable|bool $condition, callable|null $throwCallback = null)
- * @method static \Illuminate\Http\Client\PendingRequest throwUnless(bool $condition)
- * @method static \Illuminate\Http\Client\PendingRequest dump()
- * @method static \Illuminate\Http\Client\PendingRequest dd()
- * @method static \Illuminate\Http\Client\Response get(string $url, array|string|null $query = null)
- * @method static \Illuminate\Http\Client\Response head(string $url, array|string|null $query = null)
- * @method static \Illuminate\Http\Client\Response post(string $url, array $data = [])
- * @method static \Illuminate\Http\Client\Response patch(string $url, array $data = [])
- * @method static \Illuminate\Http\Client\Response put(string $url, array $data = [])
- * @method static \Illuminate\Http\Client\Response delete(string $url, array $data = [])
- * @method static array pool(callable $callback)
- * @method static \Illuminate\Http\Client\Response send(string $method, string $url, array $options = [])
- * @method static \GuzzleHttp\Client buildClient()
- * @method static \GuzzleHttp\Client createClient(\GuzzleHttp\HandlerStack $handlerStack)
- * @method static \GuzzleHttp\HandlerStack buildHandlerStack()
- * @method static \GuzzleHttp\HandlerStack pushHandlers(\GuzzleHttp\HandlerStack $handlerStack)
- * @method static \Closure buildBeforeSendingHandler()
- * @method static \Closure buildRecorderHandler()
- * @method static \Closure buildStubHandler()
- * @method static \GuzzleHttp\Psr7\RequestInterface runBeforeSendingCallbacks(\GuzzleHttp\Psr7\RequestInterface $request, array $options)
- * @method static array mergeOptions(array ...$options)
- * @method static \Illuminate\Http\Client\PendingRequest stub(callable $callback)
- * @method static \Illuminate\Http\Client\PendingRequest async(bool $async = true)
- * @method static \GuzzleHttp\Promise\PromiseInterface|null getPromise()
- * @method static \Illuminate\Http\Client\PendingRequest setClient(\GuzzleHttp\Client $client)
- * @method static \Illuminate\Http\Client\PendingRequest setHandler(callable $handler)
- * @method static array getOptions()
- * @method static \Illuminate\Http\Client\PendingRequest|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
- * @method static \Illuminate\Http\Client\PendingRequest|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
- * @see \Illuminate\Http\Client\Factory
- */
- class Http {
- /**
- * Add middleware to apply to every request.
- *
- * @param callable $middleware
- * @return \Illuminate\Http\Client\Factory
- * @static
- */
- public static function globalMiddleware($middleware)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->globalMiddleware($middleware);
- }
- /**
- * Add request middleware to apply to every request.
- *
- * @param callable $middleware
- * @return \Illuminate\Http\Client\Factory
- * @static
- */
- public static function globalRequestMiddleware($middleware)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->globalRequestMiddleware($middleware);
- }
- /**
- * Add response middleware to apply to every request.
- *
- * @param callable $middleware
- * @return \Illuminate\Http\Client\Factory
- * @static
- */
- public static function globalResponseMiddleware($middleware)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->globalResponseMiddleware($middleware);
- }
- /**
- * Create a new response instance for use during stubbing.
- *
- * @param array|string|null $body
- * @param int $status
- * @param array $headers
- * @return \GuzzleHttp\Promise\PromiseInterface
- * @static
- */
- public static function response($body = null, $status = 200, $headers = [])
- {
- return \Illuminate\Http\Client\Factory::response($body, $status, $headers);
- }
- /**
- * Get an invokable object that returns a sequence of responses in order for use during stubbing.
- *
- * @param array $responses
- * @return \Illuminate\Http\Client\ResponseSequence
- * @static
- */
- public static function sequence($responses = [])
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->sequence($responses);
- }
- /**
- * Register a stub callable that will intercept requests and be able to return stub responses.
- *
- * @param callable|array|null $callback
- * @return \Illuminate\Http\Client\Factory
- * @static
- */
- public static function fake($callback = null)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->fake($callback);
- }
- /**
- * Register a response sequence for the given URL pattern.
- *
- * @param string $url
- * @return \Illuminate\Http\Client\ResponseSequence
- * @static
- */
- public static function fakeSequence($url = '*')
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->fakeSequence($url);
- }
- /**
- * Stub the given URL using the given callback.
- *
- * @param string $url
- * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable $callback
- * @return \Illuminate\Http\Client\Factory
- * @static
- */
- public static function stubUrl($url, $callback)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->stubUrl($url, $callback);
- }
- /**
- * Indicate that an exception should be thrown if any request is not faked.
- *
- * @param bool $prevent
- * @return \Illuminate\Http\Client\Factory
- * @static
- */
- public static function preventStrayRequests($prevent = true)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->preventStrayRequests($prevent);
- }
- /**
- * Indicate that an exception should not be thrown if any request is not faked.
- *
- * @return \Illuminate\Http\Client\Factory
- * @static
- */
- public static function allowStrayRequests()
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->allowStrayRequests();
- }
- /**
- * Record a request response pair.
- *
- * @param \Illuminate\Http\Client\Request $request
- * @param \Illuminate\Http\Client\Response $response
- * @return void
- * @static
- */
- public static function recordRequestResponsePair($request, $response)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- $instance->recordRequestResponsePair($request, $response);
- }
- /**
- * Assert that a request / response pair was recorded matching a given truth test.
- *
- * @param callable $callback
- * @return void
- * @static
- */
- public static function assertSent($callback)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- $instance->assertSent($callback);
- }
- /**
- * Assert that the given request was sent in the given order.
- *
- * @param array $callbacks
- * @return void
- * @static
- */
- public static function assertSentInOrder($callbacks)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- $instance->assertSentInOrder($callbacks);
- }
- /**
- * Assert that a request / response pair was not recorded matching a given truth test.
- *
- * @param callable $callback
- * @return void
- * @static
- */
- public static function assertNotSent($callback)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- $instance->assertNotSent($callback);
- }
- /**
- * Assert that no request / response pair was recorded.
- *
- * @return void
- * @static
- */
- public static function assertNothingSent()
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- $instance->assertNothingSent();
- }
- /**
- * Assert how many requests have been recorded.
- *
- * @param int $count
- * @return void
- * @static
- */
- public static function assertSentCount($count)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- $instance->assertSentCount($count);
- }
- /**
- * Assert that every created response sequence is empty.
- *
- * @return void
- * @static
- */
- public static function assertSequencesAreEmpty()
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- $instance->assertSequencesAreEmpty();
- }
- /**
- * Get a collection of the request / response pairs matching the given truth test.
- *
- * @param callable $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function recorded($callback = null)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->recorded($callback);
- }
- /**
- * Get the current event dispatcher implementation.
- *
- * @return \Illuminate\Contracts\Events\Dispatcher|null
- * @static
- */
- public static function getDispatcher()
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->getDispatcher();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Http\Client\Factory::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Http\Client\Factory::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Http\Client\Factory::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Http\Client\Factory::flushMacros();
- }
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- * @throws \BadMethodCallException
- * @static
- */
- public static function macroCall($method, $parameters)
- {
- /** @var \Illuminate\Http\Client\Factory $instance */
- return $instance->macroCall($method, $parameters);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Translation\Translator
- */
- class Lang {
- /**
- * Determine if a translation exists for a given locale.
- *
- * @param string $key
- * @param string|null $locale
- * @return bool
- * @static
- */
- public static function hasForLocale($key, $locale = null)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->hasForLocale($key, $locale);
- }
- /**
- * Determine if a translation exists.
- *
- * @param string $key
- * @param string|null $locale
- * @param bool $fallback
- * @return bool
- * @static
- */
- public static function has($key, $locale = null, $fallback = true)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->has($key, $locale, $fallback);
- }
- /**
- * Get the translation for the given key.
- *
- * @param string $key
- * @param array $replace
- * @param string|null $locale
- * @param bool $fallback
- * @return string|array
- * @static
- */
- public static function get($key, $replace = [], $locale = null, $fallback = true)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->get($key, $replace, $locale, $fallback);
- }
- /**
- * Get a translation according to an integer value.
- *
- * @param string $key
- * @param \Countable|int|array $number
- * @param array $replace
- * @param string|null $locale
- * @return string
- * @static
- */
- public static function choice($key, $number, $replace = [], $locale = null)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->choice($key, $number, $replace, $locale);
- }
- /**
- * Add translation lines to the given locale.
- *
- * @param array $lines
- * @param string $locale
- * @param string $namespace
- * @return void
- * @static
- */
- public static function addLines($lines, $locale, $namespace = '*')
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->addLines($lines, $locale, $namespace);
- }
- /**
- * Load the specified language group.
- *
- * @param string $namespace
- * @param string $group
- * @param string $locale
- * @return void
- * @static
- */
- public static function load($namespace, $group, $locale)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->load($namespace, $group, $locale);
- }
- /**
- * Add a new namespace to the loader.
- *
- * @param string $namespace
- * @param string $hint
- * @return void
- * @static
- */
- public static function addNamespace($namespace, $hint)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->addNamespace($namespace, $hint);
- }
- /**
- * Add a new JSON path to the loader.
- *
- * @param string $path
- * @return void
- * @static
- */
- public static function addJsonPath($path)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->addJsonPath($path);
- }
- /**
- * Parse a key into namespace, group, and item.
- *
- * @param string $key
- * @return array
- * @static
- */
- public static function parseKey($key)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->parseKey($key);
- }
- /**
- * Specify a callback that should be invoked to determined the applicable locale array.
- *
- * @param callable $callback
- * @return void
- * @static
- */
- public static function determineLocalesUsing($callback)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->determineLocalesUsing($callback);
- }
- /**
- * Get the message selector instance.
- *
- * @return \Illuminate\Translation\MessageSelector
- * @static
- */
- public static function getSelector()
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->getSelector();
- }
- /**
- * Set the message selector instance.
- *
- * @param \Illuminate\Translation\MessageSelector $selector
- * @return void
- * @static
- */
- public static function setSelector($selector)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->setSelector($selector);
- }
- /**
- * Get the language line loader implementation.
- *
- * @return \Illuminate\Contracts\Translation\Loader
- * @static
- */
- public static function getLoader()
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->getLoader();
- }
- /**
- * Get the default locale being used.
- *
- * @return string
- * @static
- */
- public static function locale()
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->locale();
- }
- /**
- * Get the default locale being used.
- *
- * @return string
- * @static
- */
- public static function getLocale()
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->getLocale();
- }
- /**
- * Set the default locale.
- *
- * @param string $locale
- * @return void
- * @throws \InvalidArgumentException
- * @static
- */
- public static function setLocale($locale)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->setLocale($locale);
- }
- /**
- * Get the fallback locale being used.
- *
- * @return string
- * @static
- */
- public static function getFallback()
- {
- /** @var \Illuminate\Translation\Translator $instance */
- return $instance->getFallback();
- }
- /**
- * Set the fallback locale being used.
- *
- * @param string $fallback
- * @return void
- * @static
- */
- public static function setFallback($fallback)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->setFallback($fallback);
- }
- /**
- * Set the loaded translation groups.
- *
- * @param array $loaded
- * @return void
- * @static
- */
- public static function setLoaded($loaded)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->setLoaded($loaded);
- }
- /**
- * Add a handler to be executed in order to format a given class to a string during translation replacements.
- *
- * @param callable|string $class
- * @param callable|null $handler
- * @return void
- * @static
- */
- public static function stringable($class, $handler = null)
- {
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->stringable($class, $handler);
- }
- /**
- * Set the parsed value of a key.
- *
- * @param string $key
- * @param array $parsed
- * @return void
- * @static
- */
- public static function setParsedKey($key, $parsed)
- { //Method inherited from \Illuminate\Support\NamespacedItemResolver
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->setParsedKey($key, $parsed);
- }
- /**
- * Flush the cache of parsed keys.
- *
- * @return void
- * @static
- */
- public static function flushParsedKeys()
- { //Method inherited from \Illuminate\Support\NamespacedItemResolver
- /** @var \Illuminate\Translation\Translator $instance */
- $instance->flushParsedKeys();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Translation\Translator::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Translation\Translator::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Translation\Translator::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Translation\Translator::flushMacros();
- }
-
- }
- /**
- *
- *
- * @method static void write(string $level, \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message, array $context = [])
- * @method static \Illuminate\Log\Logger withContext(array $context = [])
- * @method static \Illuminate\Log\Logger withoutContext()
- * @method static void listen(\Closure $callback)
- * @method static \Psr\Log\LoggerInterface getLogger()
- * @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher()
- * @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $dispatcher)
- * @method static \Illuminate\Log\Logger|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
- * @method static \Illuminate\Log\Logger|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
- * @see \Illuminate\Log\LogManager
- */
- class Log {
- /**
- * Build an on-demand log channel.
- *
- * @param array $config
- * @return \Psr\Log\LoggerInterface
- * @static
- */
- public static function build($config)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->build($config);
- }
- /**
- * Create a new, on-demand aggregate logger instance.
- *
- * @param array $channels
- * @param string|null $channel
- * @return \Psr\Log\LoggerInterface
- * @static
- */
- public static function stack($channels, $channel = null)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->stack($channels, $channel);
- }
- /**
- * Get a log channel instance.
- *
- * @param string|null $channel
- * @return \Psr\Log\LoggerInterface
- * @static
- */
- public static function channel($channel = null)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->channel($channel);
- }
- /**
- * Get a log driver instance.
- *
- * @param string|null $driver
- * @return \Psr\Log\LoggerInterface
- * @static
- */
- public static function driver($driver = null)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->driver($driver);
- }
- /**
- * Share context across channels and stacks.
- *
- * @param array $context
- * @return \Illuminate\Log\LogManager
- * @static
- */
- public static function shareContext($context)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->shareContext($context);
- }
- /**
- * The context shared across channels and stacks.
- *
- * @return array
- * @static
- */
- public static function sharedContext()
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->sharedContext();
- }
- /**
- * Flush the shared context.
- *
- * @return \Illuminate\Log\LogManager
- * @static
- */
- public static function flushSharedContext()
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->flushSharedContext();
- }
- /**
- * Get the default log driver name.
- *
- * @return string|null
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the default log driver name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->setDefaultDriver($name);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Log\LogManager
- * @static
- */
- public static function extend($driver, $callback)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Unset the given channel instance.
- *
- * @param string|null $driver
- * @return void
- * @static
- */
- public static function forgetChannel($driver = null)
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->forgetChannel($driver);
- }
- /**
- * Get all of the resolved log channels.
- *
- * @return array
- * @static
- */
- public static function getChannels()
- {
- /** @var \Illuminate\Log\LogManager $instance */
- return $instance->getChannels();
- }
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function emergency($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->emergency($message, $context);
- }
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function alert($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->alert($message, $context);
- }
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function critical($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->critical($message, $context);
- }
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function error($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->error($message, $context);
- }
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function warning($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->warning($message, $context);
- }
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function notice($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->notice($message, $context);
- }
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function info($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->info($message, $context);
- }
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function debug($message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->debug($message, $context);
- }
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- * @return void
- * @static
- */
- public static function log($level, $message, $context = [])
- {
- /** @var \Illuminate\Log\LogManager $instance */
- $instance->log($level, $message, $context);
- }
-
- }
- /**
- *
- *
- * @method static void alwaysFrom(string $address, string|null $name = null)
- * @method static void alwaysReplyTo(string $address, string|null $name = null)
- * @method static void alwaysReturnPath(string $address)
- * @method static void alwaysTo(string $address, string|null $name = null)
- * @method static \Illuminate\Mail\SentMessage|null html(string $html, mixed $callback)
- * @method static \Illuminate\Mail\SentMessage|null plain(string $view, array $data, mixed $callback)
- * @method static string render(string|array $view, array $data = [])
- * @method static mixed onQueue(string $queue, \Illuminate\Contracts\Mail\Mailable $view)
- * @method static mixed queueOn(string $queue, \Illuminate\Contracts\Mail\Mailable $view)
- * @method static mixed laterOn(string $queue, \DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable $view)
- * @method static \Symfony\Component\Mailer\Transport\TransportInterface getSymfonyTransport()
- * @method static \Illuminate\Contracts\View\Factory getViewFactory()
- * @method static void setSymfonyTransport(\Symfony\Component\Mailer\Transport\TransportInterface $transport)
- * @method static \Illuminate\Mail\Mailer setQueue(\Illuminate\Contracts\Queue\Factory $queue)
- * @method static void macro(string $name, object|callable $macro)
- * @method static void mixin(object $mixin, bool $replace = true)
- * @method static bool hasMacro(string $name)
- * @method static void flushMacros()
- * @see \Illuminate\Mail\MailManager
- * @see \Illuminate\Support\Testing\Fakes\MailFake
- */
- class Mail {
- /**
- * Get a mailer instance by name.
- *
- * @param string|null $name
- * @return \Illuminate\Contracts\Mail\Mailer
- * @static
- */
- public static function mailer($name = null)
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->mailer($name);
- }
- /**
- * Get a mailer driver instance.
- *
- * @param string|null $driver
- * @return \Illuminate\Mail\Mailer
- * @static
- */
- public static function driver($driver = null)
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->driver($driver);
- }
- /**
- * Create a new transport instance.
- *
- * @param array $config
- * @return \Symfony\Component\Mailer\Transport\TransportInterface
- * @throws \InvalidArgumentException
- * @static
- */
- public static function createSymfonyTransport($config)
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->createSymfonyTransport($config);
- }
- /**
- * Get the default mail driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the default mail driver name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- $instance->setDefaultDriver($name);
- }
- /**
- * Disconnect the given mailer and remove from local cache.
- *
- * @param string|null $name
- * @return void
- * @static
- */
- public static function purge($name = null)
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- $instance->purge($name);
- }
- /**
- * Register a custom transport creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Mail\MailManager
- * @static
- */
- public static function extend($driver, $callback)
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Get the application instance used by the manager.
- *
- * @return \Illuminate\Contracts\Foundation\Application
- * @static
- */
- public static function getApplication()
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->getApplication();
- }
- /**
- * Set the application instance used by the manager.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return \Illuminate\Mail\MailManager
- * @static
- */
- public static function setApplication($app)
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->setApplication($app);
- }
- /**
- * Forget all of the resolved mailer instances.
- *
- * @return \Illuminate\Mail\MailManager
- * @static
- */
- public static function forgetMailers()
- {
- /** @var \Illuminate\Mail\MailManager $instance */
- return $instance->forgetMailers();
- }
- /**
- * Assert if a mailable was sent based on a truth-test callback.
- *
- * @param string|\Closure $mailable
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertSent($mailable, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertSent($mailable, $callback);
- }
- /**
- * Determine if a mailable was not sent or queued to be sent based on a truth-test callback.
- *
- * @param string|\Closure $mailable
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotOutgoing($mailable, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertNotOutgoing($mailable, $callback);
- }
- /**
- * Determine if a mailable was not sent based on a truth-test callback.
- *
- * @param string|\Closure $mailable
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotSent($mailable, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertNotSent($mailable, $callback);
- }
- /**
- * Assert that no mailables were sent or queued to be sent.
- *
- * @return void
- * @static
- */
- public static function assertNothingOutgoing()
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertNothingOutgoing();
- }
- /**
- * Assert that no mailables were sent.
- *
- * @return void
- * @static
- */
- public static function assertNothingSent()
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertNothingSent();
- }
- /**
- * Assert if a mailable was queued based on a truth-test callback.
- *
- * @param string|\Closure $mailable
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertQueued($mailable, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertQueued($mailable, $callback);
- }
- /**
- * Determine if a mailable was not queued based on a truth-test callback.
- *
- * @param string|\Closure $mailable
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotQueued($mailable, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertNotQueued($mailable, $callback);
- }
- /**
- * Assert that no mailables were queued.
- *
- * @return void
- * @static
- */
- public static function assertNothingQueued()
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertNothingQueued();
- }
- /**
- * Assert the total number of mailables that were sent.
- *
- * @param int $count
- * @return void
- * @static
- */
- public static function assertSentCount($count)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertSentCount($count);
- }
- /**
- * Assert the total number of mailables that were queued.
- *
- * @param int $count
- * @return void
- * @static
- */
- public static function assertQueuedCount($count)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertQueuedCount($count);
- }
- /**
- * Assert the total number of mailables that were sent or queued.
- *
- * @param int $count
- * @return void
- * @static
- */
- public static function assertOutgoingCount($count)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->assertOutgoingCount($count);
- }
- /**
- * Get all of the mailables matching a truth-test callback.
- *
- * @param string|\Closure $mailable
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function sent($mailable, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->sent($mailable, $callback);
- }
- /**
- * Determine if the given mailable has been sent.
- *
- * @param string $mailable
- * @return bool
- * @static
- */
- public static function hasSent($mailable)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->hasSent($mailable);
- }
- /**
- * Get all of the queued mailables matching a truth-test callback.
- *
- * @param string|\Closure $mailable
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function queued($mailable, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->queued($mailable, $callback);
- }
- /**
- * Determine if the given mailable has been queued.
- *
- * @param string $mailable
- * @return bool
- * @static
- */
- public static function hasQueued($mailable)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->hasQueued($mailable);
- }
- /**
- * Begin the process of mailing a mailable class instance.
- *
- * @param mixed $users
- * @return \Illuminate\Mail\PendingMail
- * @static
- */
- public static function to($users)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->to($users);
- }
- /**
- * Begin the process of mailing a mailable class instance.
- *
- * @param mixed $users
- * @return \Illuminate\Mail\PendingMail
- * @static
- */
- public static function cc($users)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->cc($users);
- }
- /**
- * Begin the process of mailing a mailable class instance.
- *
- * @param mixed $users
- * @return \Illuminate\Mail\PendingMail
- * @static
- */
- public static function bcc($users)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->bcc($users);
- }
- /**
- * Send a new message with only a raw text part.
- *
- * @param string $text
- * @param \Closure|string $callback
- * @return void
- * @static
- */
- public static function raw($text, $callback)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->raw($text, $callback);
- }
- /**
- * Send a new message using a view.
- *
- * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
- * @param array $data
- * @param \Closure|string|null $callback
- * @return void
- * @static
- */
- public static function send($view, $data = [], $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- $instance->send($view, $data, $callback);
- }
- /**
- * Queue a new e-mail message for sending.
- *
- * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
- * @param string|null $queue
- * @return mixed
- * @static
- */
- public static function queue($view, $queue = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->queue($view, $queue);
- }
- /**
- * Queue a new e-mail message for sending after (n) seconds.
- *
- * @param \DateTimeInterface|\DateInterval|int $delay
- * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
- * @param string|null $queue
- * @return mixed
- * @static
- */
- public static function later($delay, $view, $queue = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
- return $instance->later($delay, $view, $queue);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Notifications\ChannelManager
- * @see \Illuminate\Support\Testing\Fakes\NotificationFake
- */
- class Notification {
- /**
- * Send the given notification to the given notifiable entities.
- *
- * @param \Illuminate\Support\Collection|array|mixed $notifiables
- * @param mixed $notification
- * @return void
- * @static
- */
- public static function send($notifiables, $notification)
- {
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- $instance->send($notifiables, $notification);
- }
- /**
- * Send the given notification immediately.
- *
- * @param \Illuminate\Support\Collection|array|mixed $notifiables
- * @param mixed $notification
- * @param array|null $channels
- * @return void
- * @static
- */
- public static function sendNow($notifiables, $notification, $channels = null)
- {
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- $instance->sendNow($notifiables, $notification, $channels);
- }
- /**
- * Get a channel instance.
- *
- * @param string|null $name
- * @return mixed
- * @static
- */
- public static function channel($name = null)
- {
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->channel($name);
- }
- /**
- * Get the default channel driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Get the default channel driver name.
- *
- * @return string
- * @static
- */
- public static function deliversVia()
- {
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->deliversVia();
- }
- /**
- * Set the default channel driver name.
- *
- * @param string $channel
- * @return void
- * @static
- */
- public static function deliverVia($channel)
- {
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- $instance->deliverVia($channel);
- }
- /**
- * Set the locale of notifications.
- *
- * @param string $locale
- * @return \Illuminate\Notifications\ChannelManager
- * @static
- */
- public static function locale($locale)
- {
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->locale($locale);
- }
- /**
- * Get a driver instance.
- *
- * @param string|null $driver
- * @return mixed
- * @throws \InvalidArgumentException
- * @static
- */
- public static function driver($driver = null)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->driver($driver);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Notifications\ChannelManager
- * @static
- */
- public static function extend($driver, $callback)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Get all of the created "drivers".
- *
- * @return array
- * @static
- */
- public static function getDrivers()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->getDrivers();
- }
- /**
- * Get the container instance used by the manager.
- *
- * @return \Illuminate\Contracts\Container\Container
- * @static
- */
- public static function getContainer()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->getContainer();
- }
- /**
- * Set the container instance used by the manager.
- *
- * @param \Illuminate\Contracts\Container\Container $container
- * @return \Illuminate\Notifications\ChannelManager
- * @static
- */
- public static function setContainer($container)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->setContainer($container);
- }
- /**
- * Forget all of the resolved driver instances.
- *
- * @return \Illuminate\Notifications\ChannelManager
- * @static
- */
- public static function forgetDrivers()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Notifications\ChannelManager $instance */
- return $instance->forgetDrivers();
- }
- /**
- * Assert if a notification was sent on-demand based on a truth-test callback.
- *
- * @param string|\Closure $notification
- * @param callable|null $callback
- * @return void
- * @throws \Exception
- * @static
- */
- public static function assertSentOnDemand($notification, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertSentOnDemand($notification, $callback);
- }
- /**
- * Assert if a notification was sent based on a truth-test callback.
- *
- * @param mixed $notifiable
- * @param string|\Closure $notification
- * @param callable|null $callback
- * @return void
- * @throws \Exception
- * @static
- */
- public static function assertSentTo($notifiable, $notification, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertSentTo($notifiable, $notification, $callback);
- }
- /**
- * Assert if a notification was sent on-demand a number of times.
- *
- * @param string $notification
- * @param int $times
- * @return void
- * @static
- */
- public static function assertSentOnDemandTimes($notification, $times = 1)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertSentOnDemandTimes($notification, $times);
- }
- /**
- * Assert if a notification was sent a number of times.
- *
- * @param mixed $notifiable
- * @param string $notification
- * @param int $times
- * @return void
- * @static
- */
- public static function assertSentToTimes($notifiable, $notification, $times = 1)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertSentToTimes($notifiable, $notification, $times);
- }
- /**
- * Determine if a notification was sent based on a truth-test callback.
- *
- * @param mixed $notifiable
- * @param string|\Closure $notification
- * @param callable|null $callback
- * @return void
- * @throws \Exception
- * @static
- */
- public static function assertNotSentTo($notifiable, $notification, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertNotSentTo($notifiable, $notification, $callback);
- }
- /**
- * Assert that no notifications were sent.
- *
- * @return void
- * @static
- */
- public static function assertNothingSent()
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertNothingSent();
- }
- /**
- * Assert that no notifications were sent to the given notifiable.
- *
- * @param mixed $notifiable
- * @return void
- * @throws \Exception
- * @static
- */
- public static function assertNothingSentTo($notifiable)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertNothingSentTo($notifiable);
- }
- /**
- * Assert the total amount of times a notification was sent.
- *
- * @param string $notification
- * @param int $expectedCount
- * @return void
- * @static
- */
- public static function assertSentTimes($notification, $expectedCount)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertSentTimes($notification, $expectedCount);
- }
- /**
- * Assert the total count of notification that were sent.
- *
- * @param int $expectedCount
- * @return void
- * @static
- */
- public static function assertCount($expectedCount)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- $instance->assertCount($expectedCount);
- }
- /**
- * Get all of the notifications matching a truth-test callback.
- *
- * @param mixed $notifiable
- * @param string $notification
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function sent($notifiable, $notification, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- return $instance->sent($notifiable, $notification, $callback);
- }
- /**
- * Determine if there are more notifications left to inspect.
- *
- * @param mixed $notifiable
- * @param string $notification
- * @return bool
- * @static
- */
- public static function hasSent($notifiable, $notification)
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- return $instance->hasSent($notifiable, $notification);
- }
- /**
- * Get the notifications that have been sent.
- *
- * @return array
- * @static
- */
- public static function sentNotifications()
- {
- /** @var \Illuminate\Support\Testing\Fakes\NotificationFake $instance */
- return $instance->sentNotifications();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Support\Testing\Fakes\NotificationFake::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Support\Testing\Fakes\NotificationFake::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Support\Testing\Fakes\NotificationFake::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Support\Testing\Fakes\NotificationFake::flushMacros();
- }
-
- }
- /**
- *
- *
- * @method static string sendResetLink(array $credentials, \Closure|null $callback = null)
- * @method static mixed reset(array $credentials, \Closure $callback)
- * @method static \Illuminate\Contracts\Auth\CanResetPassword|null getUser(array $credentials)
- * @method static string createToken(\Illuminate\Contracts\Auth\CanResetPassword $user)
- * @method static void deleteToken(\Illuminate\Contracts\Auth\CanResetPassword $user)
- * @method static bool tokenExists(\Illuminate\Contracts\Auth\CanResetPassword $user, string $token)
- * @method static \Illuminate\Auth\Passwords\TokenRepositoryInterface getRepository()
- * @see \Illuminate\Auth\Passwords\PasswordBrokerManager
- * @see \Illuminate\Auth\Passwords\PasswordBroker
- */
- class Password {
- /**
- * Attempt to get the broker from the local cache.
- *
- * @param string|null $name
- * @return \Illuminate\Contracts\Auth\PasswordBroker
- * @static
- */
- public static function broker($name = null)
- {
- /** @var \Illuminate\Auth\Passwords\PasswordBrokerManager $instance */
- return $instance->broker($name);
- }
- /**
- * Get the default password broker name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Auth\Passwords\PasswordBrokerManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the default password broker name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Auth\Passwords\PasswordBrokerManager $instance */
- $instance->setDefaultDriver($name);
- }
-
- }
- /**
- *
- *
- * @method static \Illuminate\Process\PendingProcess command(array|string $command)
- * @method static \Illuminate\Process\PendingProcess path(string $path)
- * @method static \Illuminate\Process\PendingProcess timeout(int $timeout)
- * @method static \Illuminate\Process\PendingProcess idleTimeout(int $timeout)
- * @method static \Illuminate\Process\PendingProcess forever()
- * @method static \Illuminate\Process\PendingProcess env(array $environment)
- * @method static \Illuminate\Process\PendingProcess input(\Traversable|resource|string|int|float|bool|null $input)
- * @method static \Illuminate\Process\PendingProcess quietly()
- * @method static \Illuminate\Process\PendingProcess tty(bool $tty = true)
- * @method static \Illuminate\Process\PendingProcess options(array $options)
- * @method static \Illuminate\Contracts\Process\ProcessResult run(array|string|null $command = null, callable|null $output = null)
- * @method static \Illuminate\Process\InvokedProcess start(array|string|null $command = null, callable $output = null)
- * @method static \Illuminate\Process\PendingProcess withFakeHandlers(array $fakeHandlers)
- * @method static \Illuminate\Process\PendingProcess|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
- * @method static \Illuminate\Process\PendingProcess|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
- * @see \Illuminate\Process\PendingProcess
- * @see \Illuminate\Process\Factory
- */
- class Process {
- /**
- * Create a new fake process response for testing purposes.
- *
- * @param array|string $output
- * @param array|string $errorOutput
- * @param int $exitCode
- * @return \Illuminate\Process\FakeProcessResult
- * @static
- */
- public static function result($output = '', $errorOutput = '', $exitCode = 0)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->result($output, $errorOutput, $exitCode);
- }
- /**
- * Begin describing a fake process lifecycle.
- *
- * @return \Illuminate\Process\FakeProcessDescription
- * @static
- */
- public static function describe()
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->describe();
- }
- /**
- * Begin describing a fake process sequence.
- *
- * @param array $processes
- * @return \Illuminate\Process\FakeProcessSequence
- * @static
- */
- public static function sequence($processes = [])
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->sequence($processes);
- }
- /**
- * Indicate that the process factory should fake processes.
- *
- * @param \Closure|array|null $callback
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function fake($callback = null)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->fake($callback);
- }
- /**
- * Determine if the process factory has fake process handlers and is recording processes.
- *
- * @return bool
- * @static
- */
- public static function isRecording()
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->isRecording();
- }
- /**
- * Record the given process if processes should be recorded.
- *
- * @param \Illuminate\Process\PendingProcess $process
- * @param \Illuminate\Contracts\Process\ProcessResult $result
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function recordIfRecording($process, $result)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->recordIfRecording($process, $result);
- }
- /**
- * Record the given process.
- *
- * @param \Illuminate\Process\PendingProcess $process
- * @param \Illuminate\Contracts\Process\ProcessResult $result
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function record($process, $result)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->record($process, $result);
- }
- /**
- * Indicate that an exception should be thrown if any process is not faked.
- *
- * @param bool $prevent
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function preventStrayProcesses($prevent = true)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->preventStrayProcesses($prevent);
- }
- /**
- * Determine if stray processes are being prevented.
- *
- * @return bool
- * @static
- */
- public static function preventingStrayProcesses()
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->preventingStrayProcesses();
- }
- /**
- * Assert that a process was recorded matching a given truth test.
- *
- * @param \Closure|string $callback
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function assertRan($callback)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->assertRan($callback);
- }
- /**
- * Assert that a process was recorded a given number of times matching a given truth test.
- *
- * @param \Closure|string $callback
- * @param int $times
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function assertRanTimes($callback, $times = 1)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->assertRanTimes($callback, $times);
- }
- /**
- * Assert that a process was not recorded matching a given truth test.
- *
- * @param \Closure|string $callback
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function assertNotRan($callback)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->assertNotRan($callback);
- }
- /**
- * Assert that a process was not recorded matching a given truth test.
- *
- * @param \Closure|string $callback
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function assertDidntRun($callback)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->assertDidntRun($callback);
- }
- /**
- * Assert that no processes were recorded.
- *
- * @return \Illuminate\Process\Factory
- * @static
- */
- public static function assertNothingRan()
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->assertNothingRan();
- }
- /**
- * Start defining a pool of processes.
- *
- * @param callable $callback
- * @return \Illuminate\Process\Pool
- * @static
- */
- public static function pool($callback)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->pool($callback);
- }
- /**
- * Start defining a series of piped processes.
- *
- * @param callable|array $callback
- * @return \Illuminate\Contracts\Process\ProcessResult
- * @static
- */
- public static function pipe($callback, $output = null)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->pipe($callback, $output);
- }
- /**
- * Run a pool of processes and wait for them to finish executing.
- *
- * @param callable $callback
- * @param callable|null $output
- * @return \Illuminate\Process\ProcessPoolResults
- * @static
- */
- public static function concurrently($callback, $output = null)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->concurrently($callback, $output);
- }
- /**
- * Create a new pending process associated with this factory.
- *
- * @return \Illuminate\Process\PendingProcess
- * @static
- */
- public static function newPendingProcess()
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->newPendingProcess();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Process\Factory::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Process\Factory::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Process\Factory::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Process\Factory::flushMacros();
- }
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- * @throws \BadMethodCallException
- * @static
- */
- public static function macroCall($method, $parameters)
- {
- /** @var \Illuminate\Process\Factory $instance */
- return $instance->macroCall($method, $parameters);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Queue\QueueManager
- * @see \Illuminate\Queue\Queue
- * @see \Illuminate\Support\Testing\Fakes\QueueFake
- */
- class Queue {
- /**
- * Register an event listener for the before job event.
- *
- * @param mixed $callback
- * @return void
- * @static
- */
- public static function before($callback)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->before($callback);
- }
- /**
- * Register an event listener for the after job event.
- *
- * @param mixed $callback
- * @return void
- * @static
- */
- public static function after($callback)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->after($callback);
- }
- /**
- * Register an event listener for the exception occurred job event.
- *
- * @param mixed $callback
- * @return void
- * @static
- */
- public static function exceptionOccurred($callback)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->exceptionOccurred($callback);
- }
- /**
- * Register an event listener for the daemon queue loop.
- *
- * @param mixed $callback
- * @return void
- * @static
- */
- public static function looping($callback)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->looping($callback);
- }
- /**
- * Register an event listener for the failed job event.
- *
- * @param mixed $callback
- * @return void
- * @static
- */
- public static function failing($callback)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->failing($callback);
- }
- /**
- * Register an event listener for the daemon queue stopping.
- *
- * @param mixed $callback
- * @return void
- * @static
- */
- public static function stopping($callback)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->stopping($callback);
- }
- /**
- * Determine if the driver is connected.
- *
- * @param string|null $name
- * @return bool
- * @static
- */
- public static function connected($name = null)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- return $instance->connected($name);
- }
- /**
- * Resolve a queue connection instance.
- *
- * @param string|null $name
- * @return \Illuminate\Contracts\Queue\Queue
- * @static
- */
- public static function connection($name = null)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- return $instance->connection($name);
- }
- /**
- * Add a queue connection resolver.
- *
- * @param string $driver
- * @param \Closure $resolver
- * @return void
- * @static
- */
- public static function extend($driver, $resolver)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->extend($driver, $resolver);
- }
- /**
- * Add a queue connection resolver.
- *
- * @param string $driver
- * @param \Closure $resolver
- * @return void
- * @static
- */
- public static function addConnector($driver, $resolver)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->addConnector($driver, $resolver);
- }
- /**
- * Get the name of the default queue connection.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the name of the default queue connection.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- $instance->setDefaultDriver($name);
- }
- /**
- * Get the full name for the given connection.
- *
- * @param string|null $connection
- * @return string
- * @static
- */
- public static function getName($connection = null)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- return $instance->getName($connection);
- }
- /**
- * Get the application instance used by the manager.
- *
- * @return \Illuminate\Contracts\Foundation\Application
- * @static
- */
- public static function getApplication()
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- return $instance->getApplication();
- }
- /**
- * Set the application instance used by the manager.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return \Illuminate\Queue\QueueManager
- * @static
- */
- public static function setApplication($app)
- {
- /** @var \Illuminate\Queue\QueueManager $instance */
- return $instance->setApplication($app);
- }
- /**
- * Specify the jobs that should be queued instead of faked.
- *
- * @param array|string $jobsToBeQueued
- * @return \Illuminate\Support\Testing\Fakes\QueueFake
- * @static
- */
- public static function except($jobsToBeQueued)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->except($jobsToBeQueued);
- }
- /**
- * Assert if a job was pushed based on a truth-test callback.
- *
- * @param string|\Closure $job
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertPushed($job, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertPushed($job, $callback);
- }
- /**
- * Assert if a job was pushed based on a truth-test callback.
- *
- * @param string $queue
- * @param string|\Closure $job
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertPushedOn($queue, $job, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertPushedOn($queue, $job, $callback);
- }
- /**
- * Assert if a job was pushed with chained jobs based on a truth-test callback.
- *
- * @param string $job
- * @param array $expectedChain
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertPushedWithChain($job, $expectedChain = [], $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertPushedWithChain($job, $expectedChain, $callback);
- }
- /**
- * Assert if a job was pushed with an empty chain based on a truth-test callback.
- *
- * @param string $job
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertPushedWithoutChain($job, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertPushedWithoutChain($job, $callback);
- }
- /**
- * Assert if a closure was pushed based on a truth-test callback.
- *
- * @param callable|int|null $callback
- * @return void
- * @static
- */
- public static function assertClosurePushed($callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertClosurePushed($callback);
- }
- /**
- * Assert that a closure was not pushed based on a truth-test callback.
- *
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertClosureNotPushed($callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertClosureNotPushed($callback);
- }
- /**
- * Determine if a job was pushed based on a truth-test callback.
- *
- * @param string|\Closure $job
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function assertNotPushed($job, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertNotPushed($job, $callback);
- }
- /**
- * Assert that no jobs were pushed.
- *
- * @return void
- * @static
- */
- public static function assertNothingPushed()
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- $instance->assertNothingPushed();
- }
- /**
- * Get all of the jobs matching a truth-test callback.
- *
- * @param string $job
- * @param callable|null $callback
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function pushed($job, $callback = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->pushed($job, $callback);
- }
- /**
- * Determine if there are any stored jobs for a given class.
- *
- * @param string $job
- * @return bool
- * @static
- */
- public static function hasPushed($job)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->hasPushed($job);
- }
- /**
- * Get the size of the queue.
- *
- * @param string|null $queue
- * @return int
- * @static
- */
- public static function size($queue = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->size($queue);
- }
- /**
- * Push a new job onto the queue.
- *
- * @param string|object $job
- * @param mixed $data
- * @param string|null $queue
- * @return mixed
- * @static
- */
- public static function push($job, $data = '', $queue = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->push($job, $data, $queue);
- }
- /**
- * Determine if a job should be faked or actually dispatched.
- *
- * @param object $job
- * @return bool
- * @static
- */
- public static function shouldFakeJob($job)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->shouldFakeJob($job);
- }
- /**
- * Push a raw payload onto the queue.
- *
- * @param string $payload
- * @param string|null $queue
- * @param array $options
- * @return mixed
- * @static
- */
- public static function pushRaw($payload, $queue = null, $options = [])
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->pushRaw($payload, $queue, $options);
- }
- /**
- * Push a new job onto the queue after (n) seconds.
- *
- * @param \DateTimeInterface|\DateInterval|int $delay
- * @param string|object $job
- * @param mixed $data
- * @param string|null $queue
- * @return mixed
- * @static
- */
- public static function later($delay, $job, $data = '', $queue = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->later($delay, $job, $data, $queue);
- }
- /**
- * Push a new job onto the queue.
- *
- * @param string $queue
- * @param string|object $job
- * @param mixed $data
- * @return mixed
- * @static
- */
- public static function pushOn($queue, $job, $data = '')
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->pushOn($queue, $job, $data);
- }
- /**
- * Push a new job onto a specific queue after (n) seconds.
- *
- * @param string $queue
- * @param \DateTimeInterface|\DateInterval|int $delay
- * @param string|object $job
- * @param mixed $data
- * @return mixed
- * @static
- */
- public static function laterOn($queue, $delay, $job, $data = '')
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->laterOn($queue, $delay, $job, $data);
- }
- /**
- * Pop the next job off of the queue.
- *
- * @param string|null $queue
- * @return \Illuminate\Contracts\Queue\Job|null
- * @static
- */
- public static function pop($queue = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->pop($queue);
- }
- /**
- * Push an array of jobs onto the queue.
- *
- * @param array $jobs
- * @param mixed $data
- * @param string|null $queue
- * @return mixed
- * @static
- */
- public static function bulk($jobs, $data = '', $queue = null)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->bulk($jobs, $data, $queue);
- }
- /**
- * Get the jobs that have been pushed.
- *
- * @return array
- * @static
- */
- public static function pushedJobs()
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->pushedJobs();
- }
- /**
- * Specify if jobs should be serialized and restored when being "pushed" to the queue.
- *
- * @param bool $serializeAndRestore
- * @return \Illuminate\Support\Testing\Fakes\QueueFake
- * @static
- */
- public static function serializeAndRestore($serializeAndRestore = true)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->serializeAndRestore($serializeAndRestore);
- }
- /**
- * Get the connection name for the queue.
- *
- * @return string
- * @static
- */
- public static function getConnectionName()
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->getConnectionName();
- }
- /**
- * Set the connection name for the queue.
- *
- * @param string $name
- * @return \Illuminate\Support\Testing\Fakes\QueueFake
- * @static
- */
- public static function setConnectionName($name)
- {
- /** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
- return $instance->setConnectionName($name);
- }
- /**
- * Release a reserved job back onto the queue after (n) seconds.
- *
- * @param string $queue
- * @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job
- * @param int $delay
- * @return mixed
- * @static
- */
- public static function release($queue, $job, $delay)
- {
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- return $instance->release($queue, $job, $delay);
- }
- /**
- * Delete a reserved job from the queue.
- *
- * @param string $queue
- * @param string $id
- * @return void
- * @throws \Throwable
- * @static
- */
- public static function deleteReserved($queue, $id)
- {
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- $instance->deleteReserved($queue, $id);
- }
- /**
- * Delete a reserved job from the reserved queue and release it.
- *
- * @param string $queue
- * @param \Illuminate\Queue\Jobs\DatabaseJob $job
- * @param int $delay
- * @return void
- * @static
- */
- public static function deleteAndRelease($queue, $job, $delay)
- {
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- $instance->deleteAndRelease($queue, $job, $delay);
- }
- /**
- * Delete all of the jobs from the queue.
- *
- * @param string $queue
- * @return int
- * @static
- */
- public static function clear($queue)
- {
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- return $instance->clear($queue);
- }
- /**
- * Get the queue or return the default.
- *
- * @param string|null $queue
- * @return string
- * @static
- */
- public static function getQueue($queue)
- {
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- return $instance->getQueue($queue);
- }
- /**
- * Get the underlying database instance.
- *
- * @return \Illuminate\Database\Connection
- * @static
- */
- public static function getDatabase()
- {
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- return $instance->getDatabase();
- }
- /**
- * Get the backoff for an object-based queue handler.
- *
- * @param mixed $job
- * @return mixed
- * @static
- */
- public static function getJobBackoff($job)
- { //Method inherited from \Illuminate\Queue\Queue
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- return $instance->getJobBackoff($job);
- }
- /**
- * Get the expiration timestamp for an object-based queue handler.
- *
- * @param mixed $job
- * @return mixed
- * @static
- */
- public static function getJobExpiration($job)
- { //Method inherited from \Illuminate\Queue\Queue
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- return $instance->getJobExpiration($job);
- }
- /**
- * Register a callback to be executed when creating job payloads.
- *
- * @param callable|null $callback
- * @return void
- * @static
- */
- public static function createPayloadUsing($callback)
- { //Method inherited from \Illuminate\Queue\Queue
- \Illuminate\Queue\DatabaseQueue::createPayloadUsing($callback);
- }
- /**
- * Get the container instance being used by the connection.
- *
- * @return \Illuminate\Container\Container
- * @static
- */
- public static function getContainer()
- { //Method inherited from \Illuminate\Queue\Queue
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- return $instance->getContainer();
- }
- /**
- * Set the IoC container instance.
- *
- * @param \Illuminate\Container\Container $container
- * @return void
- * @static
- */
- public static function setContainer($container)
- { //Method inherited from \Illuminate\Queue\Queue
- /** @var \Illuminate\Queue\DatabaseQueue $instance */
- $instance->setContainer($container);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Cache\RateLimiter
- */
- class RateLimiter {
- /**
- * Register a named limiter configuration.
- *
- * @param string $name
- * @param \Closure $callback
- * @return \Illuminate\Cache\RateLimiter
- * @static
- */
- public static function for($name, $callback)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->for($name, $callback);
- }
- /**
- * Get the given named rate limiter.
- *
- * @param string $name
- * @return \Closure|null
- * @static
- */
- public static function limiter($name)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->limiter($name);
- }
- /**
- * Attempts to execute a callback if it's not limited.
- *
- * @param string $key
- * @param int $maxAttempts
- * @param \Closure $callback
- * @param int $decaySeconds
- * @return mixed
- * @static
- */
- public static function attempt($key, $maxAttempts, $callback, $decaySeconds = 60)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->attempt($key, $maxAttempts, $callback, $decaySeconds);
- }
- /**
- * Determine if the given key has been "accessed" too many times.
- *
- * @param string $key
- * @param int $maxAttempts
- * @return bool
- * @static
- */
- public static function tooManyAttempts($key, $maxAttempts)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->tooManyAttempts($key, $maxAttempts);
- }
- /**
- * Increment the counter for a given key for a given decay time.
- *
- * @param string $key
- * @param int $decaySeconds
- * @return int
- * @static
- */
- public static function hit($key, $decaySeconds = 60)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->hit($key, $decaySeconds);
- }
- /**
- * Get the number of attempts for the given key.
- *
- * @param string $key
- * @return mixed
- * @static
- */
- public static function attempts($key)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->attempts($key);
- }
- /**
- * Reset the number of attempts for the given key.
- *
- * @param string $key
- * @return mixed
- * @static
- */
- public static function resetAttempts($key)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->resetAttempts($key);
- }
- /**
- * Get the number of retries left for the given key.
- *
- * @param string $key
- * @param int $maxAttempts
- * @return int
- * @static
- */
- public static function remaining($key, $maxAttempts)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->remaining($key, $maxAttempts);
- }
- /**
- * Get the number of retries left for the given key.
- *
- * @param string $key
- * @param int $maxAttempts
- * @return int
- * @static
- */
- public static function retriesLeft($key, $maxAttempts)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->retriesLeft($key, $maxAttempts);
- }
- /**
- * Clear the hits and lockout timer for the given key.
- *
- * @param string $key
- * @return void
- * @static
- */
- public static function clear($key)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- $instance->clear($key);
- }
- /**
- * Get the number of seconds until the "key" is accessible again.
- *
- * @param string $key
- * @return int
- * @static
- */
- public static function availableIn($key)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->availableIn($key);
- }
- /**
- * Clean the rate limiter key from unicode characters.
- *
- * @param string $key
- * @return string
- * @static
- */
- public static function cleanRateLimiterKey($key)
- {
- /** @var \Illuminate\Cache\RateLimiter $instance */
- return $instance->cleanRateLimiterKey($key);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Routing\Redirector
- */
- class Redirect {
- /**
- * Create a new redirect response to the previous location.
- *
- * @param int $status
- * @param array $headers
- * @param mixed $fallback
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function back($status = 302, $headers = [], $fallback = false)
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->back($status, $headers, $fallback);
- }
- /**
- * Create a new redirect response to the current URI.
- *
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function refresh($status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->refresh($status, $headers);
- }
- /**
- * Create a new redirect response, while putting the current URL in the session.
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function guest($path, $status = 302, $headers = [], $secure = null)
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->guest($path, $status, $headers, $secure);
- }
- /**
- * Create a new redirect response to the previously intended location.
- *
- * @param mixed $default
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function intended($default = '/', $status = 302, $headers = [], $secure = null)
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->intended($default, $status, $headers, $secure);
- }
- /**
- * Create a new redirect response to the given path.
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function to($path, $status = 302, $headers = [], $secure = null)
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->to($path, $status, $headers, $secure);
- }
- /**
- * Create a new redirect response to an external URL (no validation).
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function away($path, $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->away($path, $status, $headers);
- }
- /**
- * Create a new redirect response to the given HTTPS path.
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function secure($path, $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->secure($path, $status, $headers);
- }
- /**
- * Create a new redirect response to a named route.
- *
- * @param string $route
- * @param mixed $parameters
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function route($route, $parameters = [], $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->route($route, $parameters, $status, $headers);
- }
- /**
- * Create a new redirect response to a signed named route.
- *
- * @param string $route
- * @param mixed $parameters
- * @param \DateTimeInterface|\DateInterval|int|null $expiration
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function signedRoute($route, $parameters = [], $expiration = null, $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->signedRoute($route, $parameters, $expiration, $status, $headers);
- }
- /**
- * Create a new redirect response to a signed named route.
- *
- * @param string $route
- * @param \DateTimeInterface|\DateInterval|int|null $expiration
- * @param mixed $parameters
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function temporarySignedRoute($route, $expiration, $parameters = [], $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->temporarySignedRoute($route, $expiration, $parameters, $status, $headers);
- }
- /**
- * Create a new redirect response to a controller action.
- *
- * @param string|array $action
- * @param mixed $parameters
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function action($action, $parameters = [], $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->action($action, $parameters, $status, $headers);
- }
- /**
- * Get the URL generator instance.
- *
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function getUrlGenerator()
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->getUrlGenerator();
- }
- /**
- * Set the active session store.
- *
- * @param \Illuminate\Session\Store $session
- * @return void
- * @static
- */
- public static function setSession($session)
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- $instance->setSession($session);
- }
- /**
- * Get the "intended" URL from the session.
- *
- * @return string|null
- * @static
- */
- public static function getIntendedUrl()
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->getIntendedUrl();
- }
- /**
- * Set the "intended" URL in the session.
- *
- * @param string $url
- * @return \Illuminate\Routing\Redirector
- * @static
- */
- public static function setIntendedUrl($url)
- {
- /** @var \Illuminate\Routing\Redirector $instance */
- return $instance->setIntendedUrl($url);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Routing\Redirector::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Routing\Redirector::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Routing\Redirector::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Routing\Redirector::flushMacros();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Http\Request
- */
- class Request {
- /**
- * Create a new Illuminate HTTP request from server variables.
- *
- * @return static
- * @static
- */
- public static function capture()
- {
- return \Illuminate\Http\Request::capture();
- }
- /**
- * Return the Request instance.
- *
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function instance()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->instance();
- }
- /**
- * Get the request method.
- *
- * @return string
- * @static
- */
- public static function method()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->method();
- }
- /**
- * Get the root URL for the application.
- *
- * @return string
- * @static
- */
- public static function root()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->root();
- }
- /**
- * Get the URL (no query string) for the request.
- *
- * @return string
- * @static
- */
- public static function url()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->url();
- }
- /**
- * Get the full URL for the request.
- *
- * @return string
- * @static
- */
- public static function fullUrl()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->fullUrl();
- }
- /**
- * Get the full URL for the request with the added query string parameters.
- *
- * @param array $query
- * @return string
- * @static
- */
- public static function fullUrlWithQuery($query)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->fullUrlWithQuery($query);
- }
- /**
- * Get the full URL for the request without the given query string parameters.
- *
- * @param array|string $keys
- * @return string
- * @static
- */
- public static function fullUrlWithoutQuery($keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->fullUrlWithoutQuery($keys);
- }
- /**
- * Get the current path info for the request.
- *
- * @return string
- * @static
- */
- public static function path()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->path();
- }
- /**
- * Get the current decoded path info for the request.
- *
- * @return string
- * @static
- */
- public static function decodedPath()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->decodedPath();
- }
- /**
- * Get a segment from the URI (1 based index).
- *
- * @param int $index
- * @param string|null $default
- * @return string|null
- * @static
- */
- public static function segment($index, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->segment($index, $default);
- }
- /**
- * Get all of the segments for the request path.
- *
- * @return array
- * @static
- */
- public static function segments()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->segments();
- }
- /**
- * Determine if the current request URI matches a pattern.
- *
- * @param mixed $patterns
- * @return bool
- * @static
- */
- public static function is(...$patterns)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->is(...$patterns);
- }
- /**
- * Determine if the route name matches a given pattern.
- *
- * @param mixed $patterns
- * @return bool
- * @static
- */
- public static function routeIs(...$patterns)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->routeIs(...$patterns);
- }
- /**
- * Determine if the current request URL and query string match a pattern.
- *
- * @param mixed $patterns
- * @return bool
- * @static
- */
- public static function fullUrlIs(...$patterns)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->fullUrlIs(...$patterns);
- }
- /**
- * Get the host name.
- *
- * @return string
- * @static
- */
- public static function host()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->host();
- }
- /**
- * Get the HTTP host being requested.
- *
- * @return string
- * @static
- */
- public static function httpHost()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->httpHost();
- }
- /**
- * Get the scheme and HTTP host.
- *
- * @return string
- * @static
- */
- public static function schemeAndHttpHost()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->schemeAndHttpHost();
- }
- /**
- * Determine if the request is the result of an AJAX call.
- *
- * @return bool
- * @static
- */
- public static function ajax()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->ajax();
- }
- /**
- * Determine if the request is the result of a PJAX call.
- *
- * @return bool
- * @static
- */
- public static function pjax()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->pjax();
- }
- /**
- * Determine if the request is the result of a prefetch call.
- *
- * @return bool
- * @static
- */
- public static function prefetch()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->prefetch();
- }
- /**
- * Determine if the request is over HTTPS.
- *
- * @return bool
- * @static
- */
- public static function secure()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->secure();
- }
- /**
- * Get the client IP address.
- *
- * @return string|null
- * @static
- */
- public static function ip()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->ip();
- }
- /**
- * Get the client IP addresses.
- *
- * @return array
- * @static
- */
- public static function ips()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->ips();
- }
- /**
- * Get the client user agent.
- *
- * @return string|null
- * @static
- */
- public static function userAgent()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->userAgent();
- }
- /**
- * Merge new input into the current request's input array.
- *
- * @param array $input
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function merge($input)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->merge($input);
- }
- /**
- * Merge new input into the request's input, but only when that key is missing from the request.
- *
- * @param array $input
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function mergeIfMissing($input)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->mergeIfMissing($input);
- }
- /**
- * Replace the input for the current request.
- *
- * @param array $input
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function replace($input)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->replace($input);
- }
- /**
- * This method belongs to Symfony HttpFoundation and is not usually needed when using Laravel.
- *
- * Instead, you may use the "input" method.
- *
- * @param string $key
- * @param mixed $default
- * @return mixed
- * @static
- */
- public static function get($key, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->get($key, $default);
- }
- /**
- * Get the JSON payload for the request.
- *
- * @param string|null $key
- * @param mixed $default
- * @return \Symfony\Component\HttpFoundation\InputBag|mixed
- * @static
- */
- public static function json($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->json($key, $default);
- }
- /**
- * Create a new request instance from the given Laravel request.
- *
- * @param \Illuminate\Http\Request $from
- * @param \Illuminate\Http\Request|null $to
- * @return static
- * @static
- */
- public static function createFrom($from, $to = null)
- {
- return \Illuminate\Http\Request::createFrom($from, $to);
- }
- /**
- * Create an Illuminate request from a Symfony instance.
- *
- * @param \Symfony\Component\HttpFoundation\Request $request
- * @return static
- * @static
- */
- public static function createFromBase($request)
- {
- return \Illuminate\Http\Request::createFromBase($request);
- }
- /**
- * Clones a request and overrides some of its parameters.
- *
- * @return static
- * @param array|null $query The GET parameters
- * @param array|null $request The POST parameters
- * @param array|null $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
- * @param array|null $cookies The COOKIE parameters
- * @param array|null $files The FILES parameters
- * @param array|null $server The SERVER parameters
- * @static
- */
- public static function duplicate($query = null, $request = null, $attributes = null, $cookies = null, $files = null, $server = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->duplicate($query, $request, $attributes, $cookies, $files, $server);
- }
- /**
- * Whether the request contains a Session object.
- *
- * This method does not give any information about the state of the session object,
- * like whether the session is started or not. It is just a way to check if this Request
- * is associated with a Session instance.
- *
- * @param bool $skipIfUninitialized When true, ignores factories injected by `setSessionFactory`
- * @static
- */
- public static function hasSession($skipIfUninitialized = false)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->hasSession($skipIfUninitialized);
- }
- /**
- * Gets the Session.
- *
- * @throws SessionNotFoundException When session is not set properly
- * @static
- */
- public static function getSession()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getSession();
- }
- /**
- * Get the session associated with the request.
- *
- * @return \Illuminate\Contracts\Session\Session
- * @throws \RuntimeException
- * @static
- */
- public static function session()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->session();
- }
- /**
- * Set the session instance on the request.
- *
- * @param \Illuminate\Contracts\Session\Session $session
- * @return void
- * @static
- */
- public static function setLaravelSession($session)
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->setLaravelSession($session);
- }
- /**
- * Set the locale for the request instance.
- *
- * @param string $locale
- * @return void
- * @static
- */
- public static function setRequestLocale($locale)
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->setRequestLocale($locale);
- }
- /**
- * Set the default locale for the request instance.
- *
- * @param string $locale
- * @return void
- * @static
- */
- public static function setDefaultRequestLocale($locale)
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->setDefaultRequestLocale($locale);
- }
- /**
- * Get the user making the request.
- *
- * @param string|null $guard
- * @return mixed
- * @static
- */
- public static function user($guard = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->user($guard);
- }
- /**
- * Get the route handling the request.
- *
- * @param string|null $param
- * @param mixed $default
- * @return \Illuminate\Routing\Route|object|string|null
- * @static
- */
- public static function route($param = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->route($param, $default);
- }
- /**
- * Get a unique fingerprint for the request / route / IP address.
- *
- * @return string
- * @throws \RuntimeException
- * @static
- */
- public static function fingerprint()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->fingerprint();
- }
- /**
- * Set the JSON payload for the request.
- *
- * @param \Symfony\Component\HttpFoundation\InputBag $json
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function setJson($json)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->setJson($json);
- }
- /**
- * Get the user resolver callback.
- *
- * @return \Closure
- * @static
- */
- public static function getUserResolver()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getUserResolver();
- }
- /**
- * Set the user resolver callback.
- *
- * @param \Closure $callback
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function setUserResolver($callback)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->setUserResolver($callback);
- }
- /**
- * Get the route resolver callback.
- *
- * @return \Closure
- * @static
- */
- public static function getRouteResolver()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getRouteResolver();
- }
- /**
- * Set the route resolver callback.
- *
- * @param \Closure $callback
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function setRouteResolver($callback)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->setRouteResolver($callback);
- }
- /**
- * Get all of the input and files for the request.
- *
- * @return array
- * @static
- */
- public static function toArray()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->toArray();
- }
- /**
- * Determine if the given offset exists.
- *
- * @param string $offset
- * @return bool
- * @static
- */
- public static function offsetExists($offset)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->offsetExists($offset);
- }
- /**
- * Get the value at the given offset.
- *
- * @param string $offset
- * @return mixed
- * @static
- */
- public static function offsetGet($offset)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->offsetGet($offset);
- }
- /**
- * Set the value at the given offset.
- *
- * @param string $offset
- * @param mixed $value
- * @return void
- * @static
- */
- public static function offsetSet($offset, $value)
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->offsetSet($offset, $value);
- }
- /**
- * Remove the value at the given offset.
- *
- * @param string $offset
- * @return void
- * @static
- */
- public static function offsetUnset($offset)
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->offsetUnset($offset);
- }
- /**
- * Sets the parameters for this request.
- *
- * This method also re-initializes all properties.
- *
- * @param array $query The GET parameters
- * @param array $request The POST parameters
- * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
- * @param array $cookies The COOKIE parameters
- * @param array $files The FILES parameters
- * @param array $server The SERVER parameters
- * @param string|resource|null $content The raw body data
- * @return void
- * @static
- */
- public static function initialize($query = [], $request = [], $attributes = [], $cookies = [], $files = [], $server = [], $content = null)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->initialize($query, $request, $attributes, $cookies, $files, $server, $content);
- }
- /**
- * Creates a new request with values from PHP's super globals.
- *
- * @static
- */
- public static function createFromGlobals()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::createFromGlobals();
- }
- /**
- * Creates a Request based on a given URI and configuration.
- *
- * The information contained in the URI always take precedence
- * over the other information (server and parameters).
- *
- * @param string $uri The URI
- * @param string $method The HTTP method
- * @param array $parameters The query (GET) or request (POST) parameters
- * @param array $cookies The request cookies ($_COOKIE)
- * @param array $files The request files ($_FILES)
- * @param array $server The server parameters ($_SERVER)
- * @param string|resource|null $content The raw body data
- * @static
- */
- public static function create($uri, $method = 'GET', $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::create($uri, $method, $parameters, $cookies, $files, $server, $content);
- }
- /**
- * Sets a callable able to create a Request instance.
- *
- * This is mainly useful when you need to override the Request class
- * to keep BC with an existing system. It should not be used for any
- * other purpose.
- *
- * @return void
- * @static
- */
- public static function setFactory($callable)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- \Illuminate\Http\Request::setFactory($callable);
- }
- /**
- * Overrides the PHP global variables according to this request instance.
- *
- * It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE.
- * $_FILES is never overridden, see rfc1867
- *
- * @return void
- * @static
- */
- public static function overrideGlobals()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->overrideGlobals();
- }
- /**
- * Sets a list of trusted proxies.
- *
- * You should only list the reverse proxies that you manage directly.
- *
- * @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR']
- * @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies
- * @return void
- * @static
- */
- public static function setTrustedProxies($proxies, $trustedHeaderSet)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- \Illuminate\Http\Request::setTrustedProxies($proxies, $trustedHeaderSet);
- }
- /**
- * Gets the list of trusted proxies.
- *
- * @return string[]
- * @static
- */
- public static function getTrustedProxies()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::getTrustedProxies();
- }
- /**
- * Gets the set of trusted headers from trusted proxies.
- *
- * @return int A bit field of Request::HEADER_* that defines which headers are trusted from your proxies
- * @static
- */
- public static function getTrustedHeaderSet()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::getTrustedHeaderSet();
- }
- /**
- * Sets a list of trusted host patterns.
- *
- * You should only list the hosts you manage using regexs.
- *
- * @param array $hostPatterns A list of trusted host patterns
- * @return void
- * @static
- */
- public static function setTrustedHosts($hostPatterns)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- \Illuminate\Http\Request::setTrustedHosts($hostPatterns);
- }
- /**
- * Gets the list of trusted host patterns.
- *
- * @return string[]
- * @static
- */
- public static function getTrustedHosts()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::getTrustedHosts();
- }
- /**
- * Normalizes a query string.
- *
- * It builds a normalized query string, where keys/value pairs are alphabetized,
- * have consistent escaping and unneeded delimiters are removed.
- *
- * @static
- */
- public static function normalizeQueryString($qs)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::normalizeQueryString($qs);
- }
- /**
- * Enables support for the _method request parameter to determine the intended HTTP method.
- *
- * Be warned that enabling this feature might lead to CSRF issues in your code.
- * Check that you are using CSRF tokens when required.
- * If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered
- * and used to send a "PUT" or "DELETE" request via the _method request parameter.
- * If these methods are not protected against CSRF, this presents a possible vulnerability.
- *
- * The HTTP method can only be overridden when the real HTTP method is POST.
- *
- * @return void
- * @static
- */
- public static function enableHttpMethodParameterOverride()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- \Illuminate\Http\Request::enableHttpMethodParameterOverride();
- }
- /**
- * Checks whether support for the _method request parameter is enabled.
- *
- * @static
- */
- public static function getHttpMethodParameterOverride()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::getHttpMethodParameterOverride();
- }
- /**
- * Whether the request contains a Session which was started in one of the
- * previous requests.
- *
- * @static
- */
- public static function hasPreviousSession()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->hasPreviousSession();
- }
- /**
- *
- *
- * @return void
- * @static
- */
- public static function setSession($session)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->setSession($session);
- }
- /**
- *
- *
- * @internal
- * @param \Symfony\Component\HttpFoundation\callable(): SessionInterface $factory
- * @static
- */
- public static function setSessionFactory($factory)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->setSessionFactory($factory);
- }
- /**
- * Returns the client IP addresses.
- *
- * In the returned array the most trusted IP address is first, and the
- * least trusted one last. The "real" client IP address is the last one,
- * but this is also the least trusted one. Trusted proxies are stripped.
- *
- * Use this method carefully; you should use getClientIp() instead.
- *
- * @see getClientIp()
- * @static
- */
- public static function getClientIps()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getClientIps();
- }
- /**
- * Returns the client IP address.
- *
- * This method can read the client IP address from the "X-Forwarded-For" header
- * when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For"
- * header value is a comma+space separated list of IP addresses, the left-most
- * being the original client, and each successive proxy that passed the request
- * adding the IP address where it received the request from.
- *
- * If your reverse proxy uses a different header name than "X-Forwarded-For",
- * ("Client-Ip" for instance), configure it via the $trustedHeaderSet
- * argument of the Request::setTrustedProxies() method instead.
- *
- * @see getClientIps()
- * @see https://wikipedia.org/wiki/X-Forwarded-For
- * @static
- */
- public static function getClientIp()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getClientIp();
- }
- /**
- * Returns current script name.
- *
- * @static
- */
- public static function getScriptName()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getScriptName();
- }
- /**
- * Returns the path being requested relative to the executed script.
- *
- * The path info always starts with a /.
- *
- * Suppose this request is instantiated from /mysite on localhost:
- *
- * * http://localhost/mysite returns an empty string
- * * http://localhost/mysite/about returns '/about'
- * * http://localhost/mysite/enco%20ded returns '/enco%20ded'
- * * http://localhost/mysite/about?var=1 returns '/about'
- *
- * @return string The raw path (i.e. not urldecoded)
- * @static
- */
- public static function getPathInfo()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getPathInfo();
- }
- /**
- * Returns the root path from which this request is executed.
- *
- * Suppose that an index.php file instantiates this request object:
- *
- * * http://localhost/index.php returns an empty string
- * * http://localhost/index.php/page returns an empty string
- * * http://localhost/web/index.php returns '/web'
- * * http://localhost/we%20b/index.php returns '/we%20b'
- *
- * @return string The raw path (i.e. not urldecoded)
- * @static
- */
- public static function getBasePath()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getBasePath();
- }
- /**
- * Returns the root URL from which this request is executed.
- *
- * The base URL never ends with a /.
- *
- * This is similar to getBasePath(), except that it also includes the
- * script filename (e.g. index.php) if one exists.
- *
- * @return string The raw URL (i.e. not urldecoded)
- * @static
- */
- public static function getBaseUrl()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getBaseUrl();
- }
- /**
- * Gets the request's scheme.
- *
- * @static
- */
- public static function getScheme()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getScheme();
- }
- /**
- * Returns the port on which the request is made.
- *
- * This method can read the client port from the "X-Forwarded-Port" header
- * when trusted proxies were set via "setTrustedProxies()".
- *
- * The "X-Forwarded-Port" header must contain the client port.
- *
- * @return int|string|null Can be a string if fetched from the server bag
- * @static
- */
- public static function getPort()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getPort();
- }
- /**
- * Returns the user.
- *
- * @static
- */
- public static function getUser()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getUser();
- }
- /**
- * Returns the password.
- *
- * @static
- */
- public static function getPassword()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getPassword();
- }
- /**
- * Gets the user info.
- *
- * @return string|null A user name if any and, optionally, scheme-specific information about how to gain authorization to access the server
- * @static
- */
- public static function getUserInfo()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getUserInfo();
- }
- /**
- * Returns the HTTP host being requested.
- *
- * The port name will be appended to the host if it's non-standard.
- *
- * @static
- */
- public static function getHttpHost()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getHttpHost();
- }
- /**
- * Returns the requested URI (path and query string).
- *
- * @return string The raw URI (i.e. not URI decoded)
- * @static
- */
- public static function getRequestUri()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getRequestUri();
- }
- /**
- * Gets the scheme and HTTP host.
- *
- * If the URL was called with basic authentication, the user
- * and the password are not added to the generated string.
- *
- * @static
- */
- public static function getSchemeAndHttpHost()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getSchemeAndHttpHost();
- }
- /**
- * Generates a normalized URI (URL) for the Request.
- *
- * @see getQueryString()
- * @static
- */
- public static function getUri()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getUri();
- }
- /**
- * Generates a normalized URI for the given path.
- *
- * @param string $path A path to use instead of the current one
- * @static
- */
- public static function getUriForPath($path)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getUriForPath($path);
- }
- /**
- * Returns the path as relative reference from the current Request path.
- *
- * Only the URIs path component (no schema, host etc.) is relevant and must be given.
- * Both paths must be absolute and not contain relative parts.
- * Relative URLs from one resource to another are useful when generating self-contained downloadable document archives.
- * Furthermore, they can be used to reduce the link size in documents.
- *
- * Example target paths, given a base path of "/a/b/c/d":
- * - "/a/b/c/d" -> ""
- * - "/a/b/c/" -> "./"
- * - "/a/b/" -> "../"
- * - "/a/b/c/other" -> "other"
- * - "/a/x/y" -> "../../x/y"
- *
- * @static
- */
- public static function getRelativeUriForPath($path)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getRelativeUriForPath($path);
- }
- /**
- * Generates the normalized query string for the Request.
- *
- * It builds a normalized query string, where keys/value pairs are alphabetized
- * and have consistent escaping.
- *
- * @static
- */
- public static function getQueryString()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getQueryString();
- }
- /**
- * Checks whether the request is secure or not.
- *
- * This method can read the client protocol from the "X-Forwarded-Proto" header
- * when trusted proxies were set via "setTrustedProxies()".
- *
- * The "X-Forwarded-Proto" header must contain the protocol: "https" or "http".
- *
- * @static
- */
- public static function isSecure()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isSecure();
- }
- /**
- * Returns the host name.
- *
- * This method can read the client host name from the "X-Forwarded-Host" header
- * when trusted proxies were set via "setTrustedProxies()".
- *
- * The "X-Forwarded-Host" header must contain the client host name.
- *
- * @throws SuspiciousOperationException when the host name is invalid or not trusted
- * @static
- */
- public static function getHost()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getHost();
- }
- /**
- * Sets the request method.
- *
- * @return void
- * @static
- */
- public static function setMethod($method)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->setMethod($method);
- }
- /**
- * Gets the request "intended" method.
- *
- * If the X-HTTP-Method-Override header is set, and if the method is a POST,
- * then it is used to determine the "real" intended HTTP method.
- *
- * The _method request parameter can also be used to determine the HTTP method,
- * but only if enableHttpMethodParameterOverride() has been called.
- *
- * The method is always an uppercased string.
- *
- * @see getRealMethod()
- * @static
- */
- public static function getMethod()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getMethod();
- }
- /**
- * Gets the "real" request method.
- *
- * @see getMethod()
- * @static
- */
- public static function getRealMethod()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getRealMethod();
- }
- /**
- * Gets the mime type associated with the format.
- *
- * @static
- */
- public static function getMimeType($format)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getMimeType($format);
- }
- /**
- * Gets the mime types associated with the format.
- *
- * @return string[]
- * @static
- */
- public static function getMimeTypes($format)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- return \Illuminate\Http\Request::getMimeTypes($format);
- }
- /**
- * Gets the format associated with the mime type.
- *
- * @static
- */
- public static function getFormat($mimeType)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getFormat($mimeType);
- }
- /**
- * Associates a format with mime types.
- *
- * @param string|string[] $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type)
- * @return void
- * @static
- */
- public static function setFormat($format, $mimeTypes)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->setFormat($format, $mimeTypes);
- }
- /**
- * Gets the request format.
- *
- * Here is the process to determine the format:
- *
- * * format defined by the user (with setRequestFormat())
- * * _format request attribute
- * * $default
- *
- * @see getPreferredFormat
- * @static
- */
- public static function getRequestFormat($default = 'html')
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getRequestFormat($default);
- }
- /**
- * Sets the request format.
- *
- * @return void
- * @static
- */
- public static function setRequestFormat($format)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->setRequestFormat($format);
- }
- /**
- * Gets the usual name of the format associated with the request's media type (provided in the Content-Type header).
- *
- * @deprecated since Symfony 6.2, use getContentTypeFormat() instead
- * @static
- */
- public static function getContentType()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getContentType();
- }
- /**
- * Gets the usual name of the format associated with the request's media type (provided in the Content-Type header).
- *
- * @see Request::$formats
- * @static
- */
- public static function getContentTypeFormat()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getContentTypeFormat();
- }
- /**
- * Sets the default locale.
- *
- * @return void
- * @static
- */
- public static function setDefaultLocale($locale)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->setDefaultLocale($locale);
- }
- /**
- * Get the default locale.
- *
- * @static
- */
- public static function getDefaultLocale()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getDefaultLocale();
- }
- /**
- * Sets the locale.
- *
- * @return void
- * @static
- */
- public static function setLocale($locale)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- $instance->setLocale($locale);
- }
- /**
- * Get the locale.
- *
- * @static
- */
- public static function getLocale()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getLocale();
- }
- /**
- * Checks if the request method is of specified type.
- *
- * @param string $method Uppercase request method (GET, POST etc)
- * @static
- */
- public static function isMethod($method)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isMethod($method);
- }
- /**
- * Checks whether or not the method is safe.
- *
- * @see https://tools.ietf.org/html/rfc7231#section-4.2.1
- * @static
- */
- public static function isMethodSafe()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isMethodSafe();
- }
- /**
- * Checks whether or not the method is idempotent.
- *
- * @static
- */
- public static function isMethodIdempotent()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isMethodIdempotent();
- }
- /**
- * Checks whether the method is cacheable or not.
- *
- * @see https://tools.ietf.org/html/rfc7231#section-4.2.3
- * @static
- */
- public static function isMethodCacheable()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isMethodCacheable();
- }
- /**
- * Returns the protocol version.
- *
- * If the application is behind a proxy, the protocol version used in the
- * requests between the client and the proxy and between the proxy and the
- * server might be different. This returns the former (from the "Via" header)
- * if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns
- * the latter (from the "SERVER_PROTOCOL" server parameter).
- *
- * @static
- */
- public static function getProtocolVersion()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getProtocolVersion();
- }
- /**
- * Returns the request body content.
- *
- * @param bool $asResource If true, a resource will be returned
- * @return string|resource
- * @psalm-return ($asResource is true ? resource : string)
- * @static
- */
- public static function getContent($asResource = false)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getContent($asResource);
- }
- /**
- * Gets the decoded form or json request body.
- *
- * @throws JsonException When the body cannot be decoded to an array
- * @static
- */
- public static function getPayload()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getPayload();
- }
- /**
- * Gets the Etags.
- *
- * @static
- */
- public static function getETags()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getETags();
- }
- /**
- *
- *
- * @static
- */
- public static function isNoCache()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isNoCache();
- }
- /**
- * Gets the preferred format for the response by inspecting, in the following order:
- * * the request format set using setRequestFormat;
- * * the values of the Accept HTTP header.
- *
- * Note that if you use this method, you should send the "Vary: Accept" header
- * in the response to prevent any issues with intermediary HTTP caches.
- *
- * @static
- */
- public static function getPreferredFormat($default = 'html')
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getPreferredFormat($default);
- }
- /**
- * Returns the preferred language.
- *
- * @param string[] $locales An array of ordered available locales
- * @static
- */
- public static function getPreferredLanguage($locales = null)
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getPreferredLanguage($locales);
- }
- /**
- * Gets a list of languages acceptable by the client browser ordered in the user browser preferences.
- *
- * @return string[]
- * @static
- */
- public static function getLanguages()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getLanguages();
- }
- /**
- * Gets a list of charsets acceptable by the client browser in preferable order.
- *
- * @return string[]
- * @static
- */
- public static function getCharsets()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getCharsets();
- }
- /**
- * Gets a list of encodings acceptable by the client browser in preferable order.
- *
- * @return string[]
- * @static
- */
- public static function getEncodings()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getEncodings();
- }
- /**
- * Gets a list of content types acceptable by the client browser in preferable order.
- *
- * @return string[]
- * @static
- */
- public static function getAcceptableContentTypes()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->getAcceptableContentTypes();
- }
- /**
- * Returns true if the request is an XMLHttpRequest.
- *
- * It works if your JavaScript library sets an X-Requested-With HTTP header.
- * It is known to work with common JavaScript frameworks:
- *
- * @see https://wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript
- * @static
- */
- public static function isXmlHttpRequest()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isXmlHttpRequest();
- }
- /**
- * Checks whether the client browser prefers safe content or not according to RFC8674.
- *
- * @see https://tools.ietf.org/html/rfc8674
- * @static
- */
- public static function preferSafeContent()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->preferSafeContent();
- }
- /**
- * Indicates whether this request originated from a trusted proxy.
- *
- * This can be useful to determine whether or not to trust the
- * contents of a proxy-specific header.
- *
- * @static
- */
- public static function isFromTrustedProxy()
- { //Method inherited from \Symfony\Component\HttpFoundation\Request
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isFromTrustedProxy();
- }
- /**
- * Filter the given array of rules into an array of rules that are included in precognitive headers.
- *
- * @param array $rules
- * @return array
- * @static
- */
- public static function filterPrecognitiveRules($rules)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->filterPrecognitiveRules($rules);
- }
- /**
- * Determine if the request is attempting to be precognitive.
- *
- * @return bool
- * @static
- */
- public static function isAttemptingPrecognition()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isAttemptingPrecognition();
- }
- /**
- * Determine if the request is precognitive.
- *
- * @return bool
- * @static
- */
- public static function isPrecognitive()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isPrecognitive();
- }
- /**
- * Determine if the request is sending JSON.
- *
- * @return bool
- * @static
- */
- public static function isJson()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isJson();
- }
- /**
- * Determine if the current request probably expects a JSON response.
- *
- * @return bool
- * @static
- */
- public static function expectsJson()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->expectsJson();
- }
- /**
- * Determine if the current request is asking for JSON.
- *
- * @return bool
- * @static
- */
- public static function wantsJson()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->wantsJson();
- }
- /**
- * Determines whether the current requests accepts a given content type.
- *
- * @param string|array $contentTypes
- * @return bool
- * @static
- */
- public static function accepts($contentTypes)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->accepts($contentTypes);
- }
- /**
- * Return the most suitable content type from the given array based on content negotiation.
- *
- * @param string|array $contentTypes
- * @return string|null
- * @static
- */
- public static function prefers($contentTypes)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->prefers($contentTypes);
- }
- /**
- * Determine if the current request accepts any content type.
- *
- * @return bool
- * @static
- */
- public static function acceptsAnyContentType()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->acceptsAnyContentType();
- }
- /**
- * Determines whether a request accepts JSON.
- *
- * @return bool
- * @static
- */
- public static function acceptsJson()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->acceptsJson();
- }
- /**
- * Determines whether a request accepts HTML.
- *
- * @return bool
- * @static
- */
- public static function acceptsHtml()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->acceptsHtml();
- }
- /**
- * Determine if the given content types match.
- *
- * @param string $actual
- * @param string $type
- * @return bool
- * @static
- */
- public static function matchesType($actual, $type)
- {
- return \Illuminate\Http\Request::matchesType($actual, $type);
- }
- /**
- * Get the data format expected in the response.
- *
- * @param string $default
- * @return string
- * @static
- */
- public static function format($default = 'html')
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->format($default);
- }
- /**
- * Retrieve an old input item.
- *
- * @param string|null $key
- * @param \Illuminate\Database\Eloquent\Model|string|array|null $default
- * @return string|array|null
- * @static
- */
- public static function old($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->old($key, $default);
- }
- /**
- * Flash the input for the current request to the session.
- *
- * @return void
- * @static
- */
- public static function flash()
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->flash();
- }
- /**
- * Flash only some of the input to the session.
- *
- * @param array|mixed $keys
- * @return void
- * @static
- */
- public static function flashOnly($keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->flashOnly($keys);
- }
- /**
- * Flash only some of the input to the session.
- *
- * @param array|mixed $keys
- * @return void
- * @static
- */
- public static function flashExcept($keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->flashExcept($keys);
- }
- /**
- * Flush all of the old input from the session.
- *
- * @return void
- * @static
- */
- public static function flush()
- {
- /** @var \Illuminate\Http\Request $instance */
- $instance->flush();
- }
- /**
- * Retrieve a server variable from the request.
- *
- * @param string|null $key
- * @param string|array|null $default
- * @return string|array|null
- * @static
- */
- public static function server($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->server($key, $default);
- }
- /**
- * Determine if a header is set on the request.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function hasHeader($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->hasHeader($key);
- }
- /**
- * Retrieve a header from the request.
- *
- * @param string|null $key
- * @param string|array|null $default
- * @return string|array|null
- * @static
- */
- public static function header($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->header($key, $default);
- }
- /**
- * Get the bearer token from the request headers.
- *
- * @return string|null
- * @static
- */
- public static function bearerToken()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->bearerToken();
- }
- /**
- * Determine if the request contains a given input item key.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function exists($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->exists($key);
- }
- /**
- * Determine if the request contains a given input item key.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function has($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->has($key);
- }
- /**
- * Determine if the request contains any of the given inputs.
- *
- * @param string|array $keys
- * @return bool
- * @static
- */
- public static function hasAny($keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->hasAny($keys);
- }
- /**
- * Apply the callback if the request contains the given input item key.
- *
- * @param string $key
- * @param callable $callback
- * @param callable|null $default
- * @return $this|mixed
- * @static
- */
- public static function whenHas($key, $callback, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->whenHas($key, $callback, $default);
- }
- /**
- * Determine if the request contains a non-empty value for an input item.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function filled($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->filled($key);
- }
- /**
- * Determine if the request contains an empty value for an input item.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function isNotFilled($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->isNotFilled($key);
- }
- /**
- * Determine if the request contains a non-empty value for any of the given inputs.
- *
- * @param string|array $keys
- * @return bool
- * @static
- */
- public static function anyFilled($keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->anyFilled($keys);
- }
- /**
- * Apply the callback if the request contains a non-empty value for the given input item key.
- *
- * @param string $key
- * @param callable $callback
- * @param callable|null $default
- * @return $this|mixed
- * @static
- */
- public static function whenFilled($key, $callback, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->whenFilled($key, $callback, $default);
- }
- /**
- * Determine if the request is missing a given input item key.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function missing($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->missing($key);
- }
- /**
- * Apply the callback if the request is missing the given input item key.
- *
- * @param string $key
- * @param callable $callback
- * @param callable|null $default
- * @return $this|mixed
- * @static
- */
- public static function whenMissing($key, $callback, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->whenMissing($key, $callback, $default);
- }
- /**
- * Get the keys for all of the input and files.
- *
- * @return array
- * @static
- */
- public static function keys()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->keys();
- }
- /**
- * Get all of the input and files for the request.
- *
- * @param array|mixed|null $keys
- * @return array
- * @static
- */
- public static function all($keys = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->all($keys);
- }
- /**
- * Retrieve an input item from the request.
- *
- * @param string|null $key
- * @param mixed $default
- * @return mixed
- * @static
- */
- public static function input($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->input($key, $default);
- }
- /**
- * Retrieve input from the request as a Stringable instance.
- *
- * @param string $key
- * @param mixed $default
- * @return \Illuminate\Support\Stringable
- * @static
- */
- public static function str($key, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->str($key, $default);
- }
- /**
- * Retrieve input from the request as a Stringable instance.
- *
- * @param string $key
- * @param mixed $default
- * @return \Illuminate\Support\Stringable
- * @static
- */
- public static function string($key, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->string($key, $default);
- }
- /**
- * Retrieve input as a boolean value.
- *
- * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false.
- *
- * @param string|null $key
- * @param bool $default
- * @return bool
- * @static
- */
- public static function boolean($key = null, $default = false)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->boolean($key, $default);
- }
- /**
- * Retrieve input as an integer value.
- *
- * @param string $key
- * @param int $default
- * @return int
- * @static
- */
- public static function integer($key, $default = 0)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->integer($key, $default);
- }
- /**
- * Retrieve input as a float value.
- *
- * @param string $key
- * @param float $default
- * @return float
- * @static
- */
- public static function float($key, $default = 0.0)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->float($key, $default);
- }
- /**
- * Retrieve input from the request as a Carbon instance.
- *
- * @param string $key
- * @param string|null $format
- * @param string|null $tz
- * @return \Illuminate\Support\Carbon|null
- * @throws \Carbon\Exceptions\InvalidFormatException
- * @static
- */
- public static function date($key, $format = null, $tz = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->date($key, $format, $tz);
- }
- /**
- * Retrieve input from the request as an enum.
- *
- * @template TEnum
- * @param string $key
- * @param \Illuminate\Http\class-string $enumClass
- * @return \Illuminate\Http\TEnum|null
- * @static
- */
- public static function enum($key, $enumClass)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->enum($key, $enumClass);
- }
- /**
- * Retrieve input from the request as a collection.
- *
- * @param array|string|null $key
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function collect($key = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->collect($key);
- }
- /**
- * Get a subset containing the provided keys with values from the input data.
- *
- * @param array|mixed $keys
- * @return array
- * @static
- */
- public static function only($keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->only($keys);
- }
- /**
- * Get all of the input except for a specified array of items.
- *
- * @param array|mixed $keys
- * @return array
- * @static
- */
- public static function except($keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->except($keys);
- }
- /**
- * Retrieve a query string item from the request.
- *
- * @param string|null $key
- * @param string|array|null $default
- * @return string|array|null
- * @static
- */
- public static function query($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->query($key, $default);
- }
- /**
- * Retrieve a request payload item from the request.
- *
- * @param string|null $key
- * @param string|array|null $default
- * @return string|array|null
- * @static
- */
- public static function post($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->post($key, $default);
- }
- /**
- * Determine if a cookie is set on the request.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function hasCookie($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->hasCookie($key);
- }
- /**
- * Retrieve a cookie from the request.
- *
- * @param string|null $key
- * @param string|array|null $default
- * @return string|array|null
- * @static
- */
- public static function cookie($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->cookie($key, $default);
- }
- /**
- * Get an array of all of the files on the request.
- *
- * @return array
- * @static
- */
- public static function allFiles()
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->allFiles();
- }
- /**
- * Determine if the uploaded data contains a file.
- *
- * @param string $key
- * @return bool
- * @static
- */
- public static function hasFile($key)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->hasFile($key);
- }
- /**
- * Retrieve a file from the request.
- *
- * @param string|null $key
- * @param mixed $default
- * @return \Illuminate\Http\UploadedFile|\Illuminate\Http\UploadedFile[]|array|null
- * @static
- */
- public static function file($key = null, $default = null)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->file($key, $default);
- }
- /**
- * Dump the request items and end the script.
- *
- * @param mixed $keys
- * @return \Illuminate\Http\never
- * @static
- */
- public static function dd(...$keys)
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->dd(...$keys);
- }
- /**
- * Dump the items.
- *
- * @param mixed $keys
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function dump($keys = [])
- {
- /** @var \Illuminate\Http\Request $instance */
- return $instance->dump($keys);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Http\Request::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Http\Request::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Http\Request::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Http\Request::flushMacros();
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation()
- * @param array $rules
- * @param mixed $params
- * @static
- */
- public static function validate($rules, ...$params)
- {
- return \Illuminate\Http\Request::validate($rules, ...$params);
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation()
- * @param string $errorBag
- * @param array $rules
- * @param mixed $params
- * @static
- */
- public static function validateWithBag($errorBag, $rules, ...$params)
- {
- return \Illuminate\Http\Request::validateWithBag($errorBag, $rules, ...$params);
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation()
- * @param mixed $absolute
- * @static
- */
- public static function hasValidSignature($absolute = true)
- {
- return \Illuminate\Http\Request::hasValidSignature($absolute);
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation()
- * @static
- */
- public static function hasValidRelativeSignature()
- {
- return \Illuminate\Http\Request::hasValidRelativeSignature();
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation()
- * @param mixed $ignoreQuery
- * @param mixed $absolute
- * @static
- */
- public static function hasValidSignatureWhileIgnoring($ignoreQuery = [], $absolute = true)
- {
- return \Illuminate\Http\Request::hasValidSignatureWhileIgnoring($ignoreQuery, $absolute);
- }
- /**
- *
- *
- * @see \App\Providers\AppServiceProvider::boot()
- * @param mixed $param
- * @param mixed $newParam
- * @static
- */
- public static function rename($param, $newParam = null)
- {
- return \Illuminate\Http\Request::rename($param, $newParam);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Routing\ResponseFactory
- */
- class Response {
- /**
- * Create a new response instance.
- *
- * @param mixed $content
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\Response
- * @static
- */
- public static function make($content = '', $status = 200, $headers = [])
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->make($content, $status, $headers);
- }
- /**
- * Create a new "no content" response.
- *
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\Response
- * @static
- */
- public static function noContent($status = 204, $headers = [])
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->noContent($status, $headers);
- }
- /**
- * Create a new response for a given view.
- *
- * @param string|array $view
- * @param array $data
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\Response
- * @static
- */
- public static function view($view, $data = [], $status = 200, $headers = [])
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->view($view, $data, $status, $headers);
- }
- /**
- * Create a new JSON response instance.
- *
- * @param mixed $data
- * @param int $status
- * @param array $headers
- * @param int $options
- * @return \Illuminate\Http\JsonResponse
- * @static
- */
- public static function json($data = [], $status = 200, $headers = [], $options = 0)
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->json($data, $status, $headers, $options);
- }
- /**
- * Create a new JSONP response instance.
- *
- * @param string $callback
- * @param mixed $data
- * @param int $status
- * @param array $headers
- * @param int $options
- * @return \Illuminate\Http\JsonResponse
- * @static
- */
- public static function jsonp($callback, $data = [], $status = 200, $headers = [], $options = 0)
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->jsonp($callback, $data, $status, $headers, $options);
- }
- /**
- * Create a new streamed response instance.
- *
- * @param callable $callback
- * @param int $status
- * @param array $headers
- * @return \Symfony\Component\HttpFoundation\StreamedResponse
- * @static
- */
- public static function stream($callback, $status = 200, $headers = [])
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->stream($callback, $status, $headers);
- }
- /**
- * Create a new streamed response instance as a file download.
- *
- * @param callable $callback
- * @param string|null $name
- * @param array $headers
- * @param string|null $disposition
- * @return \Symfony\Component\HttpFoundation\StreamedResponse
- * @static
- */
- public static function streamDownload($callback, $name = null, $headers = [], $disposition = 'attachment')
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->streamDownload($callback, $name, $headers, $disposition);
- }
- /**
- * Create a new file download response.
- *
- * @param \SplFileInfo|string $file
- * @param string|null $name
- * @param array $headers
- * @param string|null $disposition
- * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
- * @static
- */
- public static function download($file, $name = null, $headers = [], $disposition = 'attachment')
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->download($file, $name, $headers, $disposition);
- }
- /**
- * Return the raw contents of a binary file.
- *
- * @param \SplFileInfo|string $file
- * @param array $headers
- * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
- * @static
- */
- public static function file($file, $headers = [])
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->file($file, $headers);
- }
- /**
- * Create a new redirect response to the given path.
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function redirectTo($path, $status = 302, $headers = [], $secure = null)
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->redirectTo($path, $status, $headers, $secure);
- }
- /**
- * Create a new redirect response to a named route.
- *
- * @param string $route
- * @param mixed $parameters
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function redirectToRoute($route, $parameters = [], $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->redirectToRoute($route, $parameters, $status, $headers);
- }
- /**
- * Create a new redirect response to a controller action.
- *
- * @param array|string $action
- * @param mixed $parameters
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function redirectToAction($action, $parameters = [], $status = 302, $headers = [])
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->redirectToAction($action, $parameters, $status, $headers);
- }
- /**
- * Create a new redirect response, while putting the current URL in the session.
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function redirectGuest($path, $status = 302, $headers = [], $secure = null)
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->redirectGuest($path, $status, $headers, $secure);
- }
- /**
- * Create a new redirect response to the previously intended location.
- *
- * @param string $default
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- * @static
- */
- public static function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null)
- {
- /** @var \Illuminate\Routing\ResponseFactory $instance */
- return $instance->redirectToIntended($default, $status, $headers, $secure);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Routing\ResponseFactory::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Routing\ResponseFactory::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Routing\ResponseFactory::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Routing\ResponseFactory::flushMacros();
- }
-
- }
- /**
- *
- *
- * @method static \Illuminate\Routing\RouteRegistrar attribute(string $key, mixed $value)
- * @method static \Illuminate\Routing\RouteRegistrar whereAlpha(array|string $parameters)
- * @method static \Illuminate\Routing\RouteRegistrar whereAlphaNumeric(array|string $parameters)
- * @method static \Illuminate\Routing\RouteRegistrar whereNumber(array|string $parameters)
- * @method static \Illuminate\Routing\RouteRegistrar whereUlid(array|string $parameters)
- * @method static \Illuminate\Routing\RouteRegistrar whereUuid(array|string $parameters)
- * @method static \Illuminate\Routing\RouteRegistrar whereIn(array|string $parameters, array $values)
- * @method static \Illuminate\Routing\RouteRegistrar as(string $value)
- * @method static \Illuminate\Routing\RouteRegistrar controller(string $controller)
- * @method static \Illuminate\Routing\RouteRegistrar domain(string $value)
- * @method static \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware)
- * @method static \Illuminate\Routing\RouteRegistrar name(string $value)
- * @method static \Illuminate\Routing\RouteRegistrar namespace(string|null $value)
- * @method static \Illuminate\Routing\RouteRegistrar prefix(string $prefix)
- * @method static \Illuminate\Routing\RouteRegistrar scopeBindings()
- * @method static \Illuminate\Routing\RouteRegistrar where(array $where)
- * @method static \Illuminate\Routing\RouteRegistrar withoutMiddleware(array|string $middleware)
- * @method static \Illuminate\Routing\RouteRegistrar withoutScopedBindings()
- * @see \Illuminate\Routing\Router
- */
- class Route {
- /**
- * Register a new GET route with the router.
- *
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function get($uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->get($uri, $action);
- }
- /**
- * Register a new POST route with the router.
- *
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function post($uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->post($uri, $action);
- }
- /**
- * Register a new PUT route with the router.
- *
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function put($uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->put($uri, $action);
- }
- /**
- * Register a new PATCH route with the router.
- *
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function patch($uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->patch($uri, $action);
- }
- /**
- * Register a new DELETE route with the router.
- *
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function delete($uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->delete($uri, $action);
- }
- /**
- * Register a new OPTIONS route with the router.
- *
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function options($uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->options($uri, $action);
- }
- /**
- * Register a new route responding to all verbs.
- *
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function any($uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->any($uri, $action);
- }
- /**
- * Register a new fallback route with the router.
- *
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function fallback($action)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->fallback($action);
- }
- /**
- * Create a redirect from one URI to another.
- *
- * @param string $uri
- * @param string $destination
- * @param int $status
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function redirect($uri, $destination, $status = 302)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->redirect($uri, $destination, $status);
- }
- /**
- * Create a permanent redirect from one URI to another.
- *
- * @param string $uri
- * @param string $destination
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function permanentRedirect($uri, $destination)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->permanentRedirect($uri, $destination);
- }
- /**
- * Register a new route that returns a view.
- *
- * @param string $uri
- * @param string $view
- * @param array $data
- * @param int|array $status
- * @param array $headers
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function view($uri, $view, $data = [], $status = 200, $headers = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->view($uri, $view, $data, $status, $headers);
- }
- /**
- * Register a new route with the given verbs.
- *
- * @param array|string $methods
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function match($methods, $uri, $action = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->match($methods, $uri, $action);
- }
- /**
- * Register an array of resource controllers.
- *
- * @param array $resources
- * @param array $options
- * @return void
- * @static
- */
- public static function resources($resources, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->resources($resources, $options);
- }
- /**
- * Route a resource to a controller.
- *
- * @param string $name
- * @param string $controller
- * @param array $options
- * @return \Illuminate\Routing\PendingResourceRegistration
- * @static
- */
- public static function resource($name, $controller, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->resource($name, $controller, $options);
- }
- /**
- * Register an array of API resource controllers.
- *
- * @param array $resources
- * @param array $options
- * @return void
- * @static
- */
- public static function apiResources($resources, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->apiResources($resources, $options);
- }
- /**
- * Route an API resource to a controller.
- *
- * @param string $name
- * @param string $controller
- * @param array $options
- * @return \Illuminate\Routing\PendingResourceRegistration
- * @static
- */
- public static function apiResource($name, $controller, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->apiResource($name, $controller, $options);
- }
- /**
- * Register an array of singleton resource controllers.
- *
- * @param array $singletons
- * @param array $options
- * @return void
- * @static
- */
- public static function singletons($singletons, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->singletons($singletons, $options);
- }
- /**
- * Route a singleton resource to a controller.
- *
- * @param string $name
- * @param string $controller
- * @param array $options
- * @return \Illuminate\Routing\PendingSingletonResourceRegistration
- * @static
- */
- public static function singleton($name, $controller, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->singleton($name, $controller, $options);
- }
- /**
- * Register an array of API singleton resource controllers.
- *
- * @param array $singletons
- * @param array $options
- * @return void
- * @static
- */
- public static function apiSingletons($singletons, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->apiSingletons($singletons, $options);
- }
- /**
- * Route an API singleton resource to a controller.
- *
- * @param string $name
- * @param string $controller
- * @param array $options
- * @return \Illuminate\Routing\PendingSingletonResourceRegistration
- * @static
- */
- public static function apiSingleton($name, $controller, $options = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->apiSingleton($name, $controller, $options);
- }
- /**
- * Create a route group with shared attributes.
- *
- * @param array $attributes
- * @param \Closure|array|string $routes
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function group($attributes, $routes)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->group($attributes, $routes);
- }
- /**
- * Merge the given array with the last group stack.
- *
- * @param array $new
- * @param bool $prependExistingPrefix
- * @return array
- * @static
- */
- public static function mergeWithLastGroup($new, $prependExistingPrefix = true)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->mergeWithLastGroup($new, $prependExistingPrefix);
- }
- /**
- * Get the prefix from the last group on the stack.
- *
- * @return string
- * @static
- */
- public static function getLastGroupPrefix()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getLastGroupPrefix();
- }
- /**
- * Add a route to the underlying route collection.
- *
- * @param array|string $methods
- * @param string $uri
- * @param array|string|callable|null $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function addRoute($methods, $uri, $action)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->addRoute($methods, $uri, $action);
- }
- /**
- * Create a new Route object.
- *
- * @param array|string $methods
- * @param string $uri
- * @param mixed $action
- * @return \Illuminate\Routing\Route
- * @static
- */
- public static function newRoute($methods, $uri, $action)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->newRoute($methods, $uri, $action);
- }
- /**
- * Return the response returned by the given route.
- *
- * @param string $name
- * @return \Symfony\Component\HttpFoundation\Response
- * @static
- */
- public static function respondWithRoute($name)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->respondWithRoute($name);
- }
- /**
- * Dispatch the request to the application.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Symfony\Component\HttpFoundation\Response
- * @static
- */
- public static function dispatch($request)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->dispatch($request);
- }
- /**
- * Dispatch the request to a route and return the response.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Symfony\Component\HttpFoundation\Response
- * @static
- */
- public static function dispatchToRoute($request)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->dispatchToRoute($request);
- }
- /**
- * Gather the middleware for the given route with resolved class names.
- *
- * @param \Illuminate\Routing\Route $route
- * @return array
- * @static
- */
- public static function gatherRouteMiddleware($route)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->gatherRouteMiddleware($route);
- }
- /**
- * Resolve a flat array of middleware classes from the provided array.
- *
- * @param array $middleware
- * @param array $excluded
- * @return array
- * @static
- */
- public static function resolveMiddleware($middleware, $excluded = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->resolveMiddleware($middleware, $excluded);
- }
- /**
- * Create a response instance from the given value.
- *
- * @param \Symfony\Component\HttpFoundation\Request $request
- * @param mixed $response
- * @return \Symfony\Component\HttpFoundation\Response
- * @static
- */
- public static function prepareResponse($request, $response)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->prepareResponse($request, $response);
- }
- /**
- * Static version of prepareResponse.
- *
- * @param \Symfony\Component\HttpFoundation\Request $request
- * @param mixed $response
- * @return \Symfony\Component\HttpFoundation\Response
- * @static
- */
- public static function toResponse($request, $response)
- {
- return \Illuminate\Routing\Router::toResponse($request, $response);
- }
- /**
- * Substitute the route bindings onto the route.
- *
- * @param \Illuminate\Routing\Route $route
- * @return \Illuminate\Routing\Route
- * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
- * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException
- * @static
- */
- public static function substituteBindings($route)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->substituteBindings($route);
- }
- /**
- * Substitute the implicit route bindings for the given route.
- *
- * @param \Illuminate\Routing\Route $route
- * @return void
- * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
- * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException
- * @static
- */
- public static function substituteImplicitBindings($route)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->substituteImplicitBindings($route);
- }
- /**
- * Register a route matched event listener.
- *
- * @param string|callable $callback
- * @return void
- * @static
- */
- public static function matched($callback)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->matched($callback);
- }
- /**
- * Get all of the defined middleware short-hand names.
- *
- * @return array
- * @static
- */
- public static function getMiddleware()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getMiddleware();
- }
- /**
- * Register a short-hand name for a middleware.
- *
- * @param string $name
- * @param string $class
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function aliasMiddleware($name, $class)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->aliasMiddleware($name, $class);
- }
- /**
- * Check if a middlewareGroup with the given name exists.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMiddlewareGroup($name)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->hasMiddlewareGroup($name);
- }
- /**
- * Get all of the defined middleware groups.
- *
- * @return array
- * @static
- */
- public static function getMiddlewareGroups()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getMiddlewareGroups();
- }
- /**
- * Register a group of middleware.
- *
- * @param string $name
- * @param array $middleware
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function middlewareGroup($name, $middleware)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->middlewareGroup($name, $middleware);
- }
- /**
- * Add a middleware to the beginning of a middleware group.
- *
- * If the middleware is already in the group, it will not be added again.
- *
- * @param string $group
- * @param string $middleware
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function prependMiddlewareToGroup($group, $middleware)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->prependMiddlewareToGroup($group, $middleware);
- }
- /**
- * Add a middleware to the end of a middleware group.
- *
- * If the middleware is already in the group, it will not be added again.
- *
- * @param string $group
- * @param string $middleware
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function pushMiddlewareToGroup($group, $middleware)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->pushMiddlewareToGroup($group, $middleware);
- }
- /**
- * Remove the given middleware from the specified group.
- *
- * @param string $group
- * @param string $middleware
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function removeMiddlewareFromGroup($group, $middleware)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->removeMiddlewareFromGroup($group, $middleware);
- }
- /**
- * Flush the router's middleware groups.
- *
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function flushMiddlewareGroups()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->flushMiddlewareGroups();
- }
- /**
- * Add a new route parameter binder.
- *
- * @param string $key
- * @param string|callable $binder
- * @return void
- * @static
- */
- public static function bind($key, $binder)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->bind($key, $binder);
- }
- /**
- * Register a model binder for a wildcard.
- *
- * @param string $key
- * @param string $class
- * @param \Closure|null $callback
- * @return void
- * @static
- */
- public static function model($key, $class, $callback = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->model($key, $class, $callback);
- }
- /**
- * Get the binding callback for a given binding.
- *
- * @param string $key
- * @return \Closure|null
- * @static
- */
- public static function getBindingCallback($key)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getBindingCallback($key);
- }
- /**
- * Get the global "where" patterns.
- *
- * @return array
- * @static
- */
- public static function getPatterns()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getPatterns();
- }
- /**
- * Set a global where pattern on all routes.
- *
- * @param string $key
- * @param string $pattern
- * @return void
- * @static
- */
- public static function pattern($key, $pattern)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->pattern($key, $pattern);
- }
- /**
- * Set a group of global where patterns on all routes.
- *
- * @param array $patterns
- * @return void
- * @static
- */
- public static function patterns($patterns)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->patterns($patterns);
- }
- /**
- * Determine if the router currently has a group stack.
- *
- * @return bool
- * @static
- */
- public static function hasGroupStack()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->hasGroupStack();
- }
- /**
- * Get the current group stack for the router.
- *
- * @return array
- * @static
- */
- public static function getGroupStack()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getGroupStack();
- }
- /**
- * Get a route parameter for the current route.
- *
- * @param string $key
- * @param string|null $default
- * @return mixed
- * @static
- */
- public static function input($key, $default = null)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->input($key, $default);
- }
- /**
- * Get the request currently being dispatched.
- *
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function getCurrentRequest()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getCurrentRequest();
- }
- /**
- * Get the currently dispatched route instance.
- *
- * @return \Illuminate\Routing\Route|null
- * @static
- */
- public static function getCurrentRoute()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getCurrentRoute();
- }
- /**
- * Get the currently dispatched route instance.
- *
- * @return \Illuminate\Routing\Route|null
- * @static
- */
- public static function current()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->current();
- }
- /**
- * Check if a route with the given name exists.
- *
- * @param string|array $name
- * @return bool
- * @static
- */
- public static function has($name)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->has($name);
- }
- /**
- * Get the current route name.
- *
- * @return string|null
- * @static
- */
- public static function currentRouteName()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->currentRouteName();
- }
- /**
- * Alias for the "currentRouteNamed" method.
- *
- * @param mixed $patterns
- * @return bool
- * @static
- */
- public static function is(...$patterns)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->is(...$patterns);
- }
- /**
- * Determine if the current route matches a pattern.
- *
- * @param mixed $patterns
- * @return bool
- * @static
- */
- public static function currentRouteNamed(...$patterns)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->currentRouteNamed(...$patterns);
- }
- /**
- * Get the current route action.
- *
- * @return string|null
- * @static
- */
- public static function currentRouteAction()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->currentRouteAction();
- }
- /**
- * Alias for the "currentRouteUses" method.
- *
- * @param array $patterns
- * @return bool
- * @static
- */
- public static function uses(...$patterns)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->uses(...$patterns);
- }
- /**
- * Determine if the current route action matches a given action.
- *
- * @param string $action
- * @return bool
- * @static
- */
- public static function currentRouteUses($action)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->currentRouteUses($action);
- }
- /**
- * Set the unmapped global resource parameters to singular.
- *
- * @param bool $singular
- * @return void
- * @static
- */
- public static function singularResourceParameters($singular = true)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->singularResourceParameters($singular);
- }
- /**
- * Set the global resource parameter mapping.
- *
- * @param array $parameters
- * @return void
- * @static
- */
- public static function resourceParameters($parameters = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->resourceParameters($parameters);
- }
- /**
- * Get or set the verbs used in the resource URIs.
- *
- * @param array $verbs
- * @return array|null
- * @static
- */
- public static function resourceVerbs($verbs = [])
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->resourceVerbs($verbs);
- }
- /**
- * Get the underlying route collection.
- *
- * @return \Illuminate\Routing\RouteCollectionInterface
- * @static
- */
- public static function getRoutes()
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->getRoutes();
- }
- /**
- * Set the route collection instance.
- *
- * @param \Illuminate\Routing\RouteCollection $routes
- * @return void
- * @static
- */
- public static function setRoutes($routes)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->setRoutes($routes);
- }
- /**
- * Set the compiled route collection instance.
- *
- * @param array $routes
- * @return void
- * @static
- */
- public static function setCompiledRoutes($routes)
- {
- /** @var \Illuminate\Routing\Router $instance */
- $instance->setCompiledRoutes($routes);
- }
- /**
- * Remove any duplicate middleware from the given array.
- *
- * @param array $middleware
- * @return array
- * @static
- */
- public static function uniqueMiddleware($middleware)
- {
- return \Illuminate\Routing\Router::uniqueMiddleware($middleware);
- }
- /**
- * Set the container instance used by the router.
- *
- * @param \Illuminate\Container\Container $container
- * @return \Illuminate\Routing\Router
- * @static
- */
- public static function setContainer($container)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->setContainer($container);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Routing\Router::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Routing\Router::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Routing\Router::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Routing\Router::flushMacros();
- }
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- * @throws \BadMethodCallException
- * @static
- */
- public static function macroCall($method, $parameters)
- {
- /** @var \Illuminate\Routing\Router $instance */
- return $instance->macroCall($method, $parameters);
- }
- /**
- *
- *
- * @see \App\Providers\RouteServiceProvider::boot()
- * @param mixed $addendum
- * @param mixed $uri
- * @param mixed $controller
- * @static
- */
- public static function apiAddendumResource($addendum, $uri, $controller)
- {
- return \Illuminate\Routing\Router::apiAddendumResource($addendum, $uri, $controller);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Database\Schema\Builder
- */
- class Schema {
- /**
- * Create a database in the schema.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function createDatabase($name)
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->createDatabase($name);
- }
- /**
- * Drop a database from the schema if the database exists.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function dropDatabaseIfExists($name)
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->dropDatabaseIfExists($name);
- }
- /**
- * Determine if the given table exists.
- *
- * @param string $table
- * @return bool
- * @static
- */
- public static function hasTable($table)
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->hasTable($table);
- }
- /**
- * Get the column listing for a given table.
- *
- * @param string $table
- * @return array
- * @static
- */
- public static function getColumnListing($table)
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->getColumnListing($table);
- }
- /**
- * Drop all tables from the database.
- *
- * @return void
- * @static
- */
- public static function dropAllTables()
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->dropAllTables();
- }
- /**
- * Drop all views from the database.
- *
- * @return void
- * @static
- */
- public static function dropAllViews()
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->dropAllViews();
- }
- /**
- * Get all of the table names for the database.
- *
- * @return array
- * @static
- */
- public static function getAllTables()
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->getAllTables();
- }
- /**
- * Get all of the view names for the database.
- *
- * @return array
- * @static
- */
- public static function getAllViews()
- {
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->getAllViews();
- }
- /**
- * Set the default string length for migrations.
- *
- * @param int $length
- * @return void
- * @static
- */
- public static function defaultStringLength($length)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- \Illuminate\Database\Schema\MySqlBuilder::defaultStringLength($length);
- }
- /**
- * Set the default morph key type for migrations.
- *
- * @param string $type
- * @return void
- * @throws \InvalidArgumentException
- * @static
- */
- public static function defaultMorphKeyType($type)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- \Illuminate\Database\Schema\MySqlBuilder::defaultMorphKeyType($type);
- }
- /**
- * Set the default morph key type for migrations to UUIDs.
- *
- * @return void
- * @static
- */
- public static function morphUsingUuids()
- { //Method inherited from \Illuminate\Database\Schema\Builder
- \Illuminate\Database\Schema\MySqlBuilder::morphUsingUuids();
- }
- /**
- * Set the default morph key type for migrations to ULIDs.
- *
- * @return void
- * @static
- */
- public static function morphUsingUlids()
- { //Method inherited from \Illuminate\Database\Schema\Builder
- \Illuminate\Database\Schema\MySqlBuilder::morphUsingUlids();
- }
- /**
- * Attempt to use native schema operations for dropping, renaming, and modifying columns, even if Doctrine DBAL is installed.
- *
- * @param bool $value
- * @return void
- * @static
- */
- public static function useNativeSchemaOperationsIfPossible($value = true)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- \Illuminate\Database\Schema\MySqlBuilder::useNativeSchemaOperationsIfPossible($value);
- }
- /**
- * Determine if the given table has a given column.
- *
- * @param string $table
- * @param string $column
- * @return bool
- * @static
- */
- public static function hasColumn($table, $column)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->hasColumn($table, $column);
- }
- /**
- * Determine if the given table has given columns.
- *
- * @param string $table
- * @param array $columns
- * @return bool
- * @static
- */
- public static function hasColumns($table, $columns)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->hasColumns($table, $columns);
- }
- /**
- * Execute a table builder callback if the given table has a given column.
- *
- * @param string $table
- * @param string $column
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function whenTableHasColumn($table, $column, $callback)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->whenTableHasColumn($table, $column, $callback);
- }
- /**
- * Execute a table builder callback if the given table doesn't have a given column.
- *
- * @param string $table
- * @param string $column
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function whenTableDoesntHaveColumn($table, $column, $callback)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->whenTableDoesntHaveColumn($table, $column, $callback);
- }
- /**
- * Get the data type for the given column name.
- *
- * @param string $table
- * @param string $column
- * @return string
- * @static
- */
- public static function getColumnType($table, $column)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->getColumnType($table, $column);
- }
- /**
- * Modify a table on the schema.
- *
- * @param string $table
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function table($table, $callback)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->table($table, $callback);
- }
- /**
- * Create a new table on the schema.
- *
- * @param string $table
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function create($table, $callback)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->create($table, $callback);
- }
- /**
- * Drop a table from the schema.
- *
- * @param string $table
- * @return void
- * @static
- */
- public static function drop($table)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->drop($table);
- }
- /**
- * Drop a table from the schema if it exists.
- *
- * @param string $table
- * @return void
- * @static
- */
- public static function dropIfExists($table)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->dropIfExists($table);
- }
- /**
- * Drop columns from a table schema.
- *
- * @param string $table
- * @param string|array $columns
- * @return void
- * @static
- */
- public static function dropColumns($table, $columns)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->dropColumns($table, $columns);
- }
- /**
- * Drop all types from the database.
- *
- * @return void
- * @throws \LogicException
- * @static
- */
- public static function dropAllTypes()
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->dropAllTypes();
- }
- /**
- * Rename a table on the schema.
- *
- * @param string $from
- * @param string $to
- * @return void
- * @static
- */
- public static function rename($from, $to)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->rename($from, $to);
- }
- /**
- * Enable foreign key constraints.
- *
- * @return bool
- * @static
- */
- public static function enableForeignKeyConstraints()
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->enableForeignKeyConstraints();
- }
- /**
- * Disable foreign key constraints.
- *
- * @return bool
- * @static
- */
- public static function disableForeignKeyConstraints()
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->disableForeignKeyConstraints();
- }
- /**
- * Disable foreign key constraints during the execution of a callback.
- *
- * @param \Closure $callback
- * @return mixed
- * @static
- */
- public static function withoutForeignKeyConstraints($callback)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->withoutForeignKeyConstraints($callback);
- }
- /**
- * Get the database connection instance.
- *
- * @return \Illuminate\Database\Connection
- * @static
- */
- public static function getConnection()
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->getConnection();
- }
- /**
- * Set the database connection instance.
- *
- * @param \Illuminate\Database\Connection $connection
- * @return \Illuminate\Database\Schema\MySqlBuilder
- * @static
- */
- public static function setConnection($connection)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- return $instance->setConnection($connection);
- }
- /**
- * Set the Schema Blueprint resolver callback.
- *
- * @param \Closure $resolver
- * @return void
- * @static
- */
- public static function blueprintResolver($resolver)
- { //Method inherited from \Illuminate\Database\Schema\Builder
- /** @var \Illuminate\Database\Schema\MySqlBuilder $instance */
- $instance->blueprintResolver($resolver);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Session\SessionManager
- */
- class Session {
- /**
- * Determine if requests for the same session should wait for each to finish before executing.
- *
- * @return bool
- * @static
- */
- public static function shouldBlock()
- {
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->shouldBlock();
- }
- /**
- * Get the name of the cache store / driver that should be used to acquire session locks.
- *
- * @return string|null
- * @static
- */
- public static function blockDriver()
- {
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->blockDriver();
- }
- /**
- * Get the session configuration.
- *
- * @return array
- * @static
- */
- public static function getSessionConfig()
- {
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->getSessionConfig();
- }
- /**
- * Get the default session driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Set the default session driver name.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setDefaultDriver($name)
- {
- /** @var \Illuminate\Session\SessionManager $instance */
- $instance->setDefaultDriver($name);
- }
- /**
- * Get a driver instance.
- *
- * @param string|null $driver
- * @return mixed
- * @throws \InvalidArgumentException
- * @static
- */
- public static function driver($driver = null)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->driver($driver);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Session\SessionManager
- * @static
- */
- public static function extend($driver, $callback)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Get all of the created "drivers".
- *
- * @return array
- * @static
- */
- public static function getDrivers()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->getDrivers();
- }
- /**
- * Get the container instance used by the manager.
- *
- * @return \Illuminate\Contracts\Container\Container
- * @static
- */
- public static function getContainer()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->getContainer();
- }
- /**
- * Set the container instance used by the manager.
- *
- * @param \Illuminate\Contracts\Container\Container $container
- * @return \Illuminate\Session\SessionManager
- * @static
- */
- public static function setContainer($container)
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->setContainer($container);
- }
- /**
- * Forget all of the resolved driver instances.
- *
- * @return \Illuminate\Session\SessionManager
- * @static
- */
- public static function forgetDrivers()
- { //Method inherited from \Illuminate\Support\Manager
- /** @var \Illuminate\Session\SessionManager $instance */
- return $instance->forgetDrivers();
- }
- /**
- * Start the session, reading the data from a handler.
- *
- * @return bool
- * @static
- */
- public static function start()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->start();
- }
- /**
- * Save the session data to storage.
- *
- * @return void
- * @static
- */
- public static function save()
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->save();
- }
- /**
- * Age the flash data for the session.
- *
- * @return void
- * @static
- */
- public static function ageFlashData()
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->ageFlashData();
- }
- /**
- * Get all of the session data.
- *
- * @return array
- * @static
- */
- public static function all()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->all();
- }
- /**
- * Get a subset of the session data.
- *
- * @param array $keys
- * @return array
- * @static
- */
- public static function only($keys)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->only($keys);
- }
- /**
- * Checks if a key exists.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function exists($key)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->exists($key);
- }
- /**
- * Determine if the given key is missing from the session data.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function missing($key)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->missing($key);
- }
- /**
- * Checks if a key is present and not null.
- *
- * @param string|array $key
- * @return bool
- * @static
- */
- public static function has($key)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->has($key);
- }
- /**
- * Get an item from the session.
- *
- * @param string $key
- * @param mixed $default
- * @return mixed
- * @static
- */
- public static function get($key, $default = null)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->get($key, $default);
- }
- /**
- * Get the value of a given key and then forget it.
- *
- * @param string $key
- * @param mixed $default
- * @return mixed
- * @static
- */
- public static function pull($key, $default = null)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->pull($key, $default);
- }
- /**
- * Determine if the session contains old input.
- *
- * @param string|null $key
- * @return bool
- * @static
- */
- public static function hasOldInput($key = null)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->hasOldInput($key);
- }
- /**
- * Get the requested item from the flashed input array.
- *
- * @param string|null $key
- * @param mixed $default
- * @return mixed
- * @static
- */
- public static function getOldInput($key = null, $default = null)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->getOldInput($key, $default);
- }
- /**
- * Replace the given session attributes entirely.
- *
- * @param array $attributes
- * @return void
- * @static
- */
- public static function replace($attributes)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->replace($attributes);
- }
- /**
- * Put a key / value pair or array of key / value pairs in the session.
- *
- * @param string|array $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function put($key, $value = null)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->put($key, $value);
- }
- /**
- * Get an item from the session, or store the default value.
- *
- * @param string $key
- * @param \Closure $callback
- * @return mixed
- * @static
- */
- public static function remember($key, $callback)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->remember($key, $callback);
- }
- /**
- * Push a value onto a session array.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function push($key, $value)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->push($key, $value);
- }
- /**
- * Increment the value of an item in the session.
- *
- * @param string $key
- * @param int $amount
- * @return mixed
- * @static
- */
- public static function increment($key, $amount = 1)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->increment($key, $amount);
- }
- /**
- * Decrement the value of an item in the session.
- *
- * @param string $key
- * @param int $amount
- * @return int
- * @static
- */
- public static function decrement($key, $amount = 1)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->decrement($key, $amount);
- }
- /**
- * Flash a key / value pair to the session.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function flash($key, $value = true)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->flash($key, $value);
- }
- /**
- * Flash a key / value pair to the session for immediate use.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- * @static
- */
- public static function now($key, $value)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->now($key, $value);
- }
- /**
- * Reflash all of the session flash data.
- *
- * @return void
- * @static
- */
- public static function reflash()
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->reflash();
- }
- /**
- * Reflash a subset of the current flash data.
- *
- * @param array|mixed $keys
- * @return void
- * @static
- */
- public static function keep($keys = null)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->keep($keys);
- }
- /**
- * Flash an input array to the session.
- *
- * @param array $value
- * @return void
- * @static
- */
- public static function flashInput($value)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->flashInput($value);
- }
- /**
- * Remove an item from the session, returning its value.
- *
- * @param string $key
- * @return mixed
- * @static
- */
- public static function remove($key)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->remove($key);
- }
- /**
- * Remove one or many items from the session.
- *
- * @param string|array $keys
- * @return void
- * @static
- */
- public static function forget($keys)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->forget($keys);
- }
- /**
- * Remove all of the items from the session.
- *
- * @return void
- * @static
- */
- public static function flush()
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->flush();
- }
- /**
- * Flush the session data and regenerate the ID.
- *
- * @return bool
- * @static
- */
- public static function invalidate()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->invalidate();
- }
- /**
- * Generate a new session identifier.
- *
- * @param bool $destroy
- * @return bool
- * @static
- */
- public static function regenerate($destroy = false)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->regenerate($destroy);
- }
- /**
- * Generate a new session ID for the session.
- *
- * @param bool $destroy
- * @return bool
- * @static
- */
- public static function migrate($destroy = false)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->migrate($destroy);
- }
- /**
- * Determine if the session has been started.
- *
- * @return bool
- * @static
- */
- public static function isStarted()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->isStarted();
- }
- /**
- * Get the name of the session.
- *
- * @return string
- * @static
- */
- public static function getName()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->getName();
- }
- /**
- * Set the name of the session.
- *
- * @param string $name
- * @return void
- * @static
- */
- public static function setName($name)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->setName($name);
- }
- /**
- * Get the current session ID.
- *
- * @return string
- * @static
- */
- public static function getId()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->getId();
- }
- /**
- * Set the session ID.
- *
- * @param string|null $id
- * @return void
- * @static
- */
- public static function setId($id)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->setId($id);
- }
- /**
- * Determine if this is a valid session ID.
- *
- * @param string|null $id
- * @return bool
- * @static
- */
- public static function isValidId($id)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->isValidId($id);
- }
- /**
- * Set the existence of the session on the handler if applicable.
- *
- * @param bool $value
- * @return void
- * @static
- */
- public static function setExists($value)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->setExists($value);
- }
- /**
- * Get the CSRF token value.
- *
- * @return string
- * @static
- */
- public static function token()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->token();
- }
- /**
- * Regenerate the CSRF token value.
- *
- * @return void
- * @static
- */
- public static function regenerateToken()
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->regenerateToken();
- }
- /**
- * Get the previous URL from the session.
- *
- * @return string|null
- * @static
- */
- public static function previousUrl()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->previousUrl();
- }
- /**
- * Set the "previous" URL in the session.
- *
- * @param string $url
- * @return void
- * @static
- */
- public static function setPreviousUrl($url)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->setPreviousUrl($url);
- }
- /**
- * Specify that the user has confirmed their password.
- *
- * @return void
- * @static
- */
- public static function passwordConfirmed()
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->passwordConfirmed();
- }
- /**
- * Get the underlying session handler implementation.
- *
- * @return \SessionHandlerInterface
- * @static
- */
- public static function getHandler()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->getHandler();
- }
- /**
- * Set the underlying session handler implementation.
- *
- * @param \SessionHandlerInterface $handler
- * @return \SessionHandlerInterface
- * @static
- */
- public static function setHandler($handler)
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->setHandler($handler);
- }
- /**
- * Determine if the session handler needs a request.
- *
- * @return bool
- * @static
- */
- public static function handlerNeedsRequest()
- {
- /** @var \Illuminate\Session\Store $instance */
- return $instance->handlerNeedsRequest();
- }
- /**
- * Set the request on the handler instance.
- *
- * @param \Illuminate\Http\Request $request
- * @return void
- * @static
- */
- public static function setRequestOnHandler($request)
- {
- /** @var \Illuminate\Session\Store $instance */
- $instance->setRequestOnHandler($request);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Session\Store::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Session\Store::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Session\Store::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Session\Store::flushMacros();
- }
-
- }
- /**
- *
- *
- * @method static bool has(string $location)
- * @method static string read(string $location)
- * @method static \League\Flysystem\DirectoryListing listContents(string $location, bool $deep = false)
- * @method static int fileSize(string $path)
- * @method static string visibility(string $path)
- * @method static void write(string $location, string $contents, array $config = [])
- * @method static void createDirectory(string $location, array $config = [])
- * @see \Illuminate\Filesystem\FilesystemManager
- */
- class Storage {
- /**
- * Get a filesystem instance.
- *
- * @param string|null $name
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function drive($name = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->drive($name);
- }
- /**
- * Get a filesystem instance.
- *
- * @param string|null $name
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function disk($name = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->disk($name);
- }
- /**
- * Get a default cloud filesystem instance.
- *
- * @return \Illuminate\Contracts\Filesystem\Cloud
- * @static
- */
- public static function cloud()
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->cloud();
- }
- /**
- * Build an on-demand disk.
- *
- * @param string|array $config
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function build($config)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->build($config);
- }
- /**
- * Create an instance of the local driver.
- *
- * @param array $config
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function createLocalDriver($config)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->createLocalDriver($config);
- }
- /**
- * Create an instance of the ftp driver.
- *
- * @param array $config
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function createFtpDriver($config)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->createFtpDriver($config);
- }
- /**
- * Create an instance of the sftp driver.
- *
- * @param array $config
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function createSftpDriver($config)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->createSftpDriver($config);
- }
- /**
- * Create an instance of the Amazon S3 driver.
- *
- * @param array $config
- * @return \Illuminate\Contracts\Filesystem\Cloud
- * @static
- */
- public static function createS3Driver($config)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->createS3Driver($config);
- }
- /**
- * Create a scoped driver.
- *
- * @param array $config
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function createScopedDriver($config)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->createScopedDriver($config);
- }
- /**
- * Set the given disk instance.
- *
- * @param string $name
- * @param mixed $disk
- * @return \Illuminate\Filesystem\FilesystemManager
- * @static
- */
- public static function set($name, $disk)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->set($name, $disk);
- }
- /**
- * Get the default driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultDriver()
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->getDefaultDriver();
- }
- /**
- * Get the default cloud driver name.
- *
- * @return string
- * @static
- */
- public static function getDefaultCloudDriver()
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->getDefaultCloudDriver();
- }
- /**
- * Unset the given disk instances.
- *
- * @param array|string $disk
- * @return \Illuminate\Filesystem\FilesystemManager
- * @static
- */
- public static function forgetDisk($disk)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->forgetDisk($disk);
- }
- /**
- * Disconnect the given disk and remove from local cache.
- *
- * @param string|null $name
- * @return void
- * @static
- */
- public static function purge($name = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- $instance->purge($name);
- }
- /**
- * Register a custom driver creator Closure.
- *
- * @param string $driver
- * @param \Closure $callback
- * @return \Illuminate\Filesystem\FilesystemManager
- * @static
- */
- public static function extend($driver, $callback)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->extend($driver, $callback);
- }
- /**
- * Set the application instance used by the manager.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return \Illuminate\Filesystem\FilesystemManager
- * @static
- */
- public static function setApplication($app)
- {
- /** @var \Illuminate\Filesystem\FilesystemManager $instance */
- return $instance->setApplication($app);
- }
- /**
- * Assert that the given file or directory exists.
- *
- * @param string|array $path
- * @param string|null $content
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function assertExists($path, $content = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->assertExists($path, $content);
- }
- /**
- * Assert that the given file or directory does not exist.
- *
- * @param string|array $path
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function assertMissing($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->assertMissing($path);
- }
- /**
- * Assert that the given directory is empty.
- *
- * @param string $path
- * @return \Illuminate\Filesystem\FilesystemAdapter
- * @static
- */
- public static function assertDirectoryEmpty($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->assertDirectoryEmpty($path);
- }
- /**
- * Determine if a file or directory exists.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function exists($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->exists($path);
- }
- /**
- * Determine if a file or directory is missing.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function missing($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->missing($path);
- }
- /**
- * Determine if a file exists.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function fileExists($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->fileExists($path);
- }
- /**
- * Determine if a file is missing.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function fileMissing($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->fileMissing($path);
- }
- /**
- * Determine if a directory exists.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function directoryExists($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->directoryExists($path);
- }
- /**
- * Determine if a directory is missing.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function directoryMissing($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->directoryMissing($path);
- }
- /**
- * Get the full path for the file at the given "short" path.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function path($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->path($path);
- }
- /**
- * Get the contents of a file.
- *
- * @param string $path
- * @return string|null
- * @static
- */
- public static function get($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->get($path);
- }
- /**
- * Get the contents of a file as decoded JSON.
- *
- * @param string $path
- * @param int $flags
- * @return array|null
- * @static
- */
- public static function json($path, $flags = 0)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->json($path, $flags);
- }
- /**
- * Create a streamed response for a given file.
- *
- * @param string $path
- * @param string|null $name
- * @param array $headers
- * @param string|null $disposition
- * @return \Symfony\Component\HttpFoundation\StreamedResponse
- * @static
- */
- public static function response($path, $name = null, $headers = [], $disposition = 'inline')
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->response($path, $name, $headers, $disposition);
- }
- /**
- * Create a streamed download response for a given file.
- *
- * @param string $path
- * @param string|null $name
- * @return \Symfony\Component\HttpFoundation\StreamedResponse
- * @static
- */
- public static function download($path, $name = null, $headers = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->download($path, $name, $headers);
- }
- /**
- * Write the contents of a file.
- *
- * @param string $path
- * @param \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents
- * @param mixed $options
- * @return string|bool
- * @static
- */
- public static function put($path, $contents, $options = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->put($path, $contents, $options);
- }
- /**
- * Store the uploaded file on the disk.
- *
- * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $path
- * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|array|null $file
- * @param mixed $options
- * @return string|false
- * @static
- */
- public static function putFile($path, $file = null, $options = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->putFile($path, $file, $options);
- }
- /**
- * Store the uploaded file on the disk with a given name.
- *
- * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $path
- * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|array|null $file
- * @param string|array|null $name
- * @param mixed $options
- * @return string|false
- * @static
- */
- public static function putFileAs($path, $file, $name = null, $options = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->putFileAs($path, $file, $name, $options);
- }
- /**
- * Get the visibility for the given path.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function getVisibility($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->getVisibility($path);
- }
- /**
- * Set the visibility for the given path.
- *
- * @param string $path
- * @param string $visibility
- * @return bool
- * @static
- */
- public static function setVisibility($path, $visibility)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->setVisibility($path, $visibility);
- }
- /**
- * Prepend to a file.
- *
- * @param string $path
- * @param string $data
- * @param string $separator
- * @return bool
- * @static
- */
- public static function prepend($path, $data, $separator = '
-')
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->prepend($path, $data, $separator);
- }
- /**
- * Append to a file.
- *
- * @param string $path
- * @param string $data
- * @param string $separator
- * @return bool
- * @static
- */
- public static function append($path, $data, $separator = '
-')
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->append($path, $data, $separator);
- }
- /**
- * Delete the file at a given path.
- *
- * @param string|array $paths
- * @return bool
- * @static
- */
- public static function delete($paths)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->delete($paths);
- }
- /**
- * Copy a file to a new location.
- *
- * @param string $from
- * @param string $to
- * @return bool
- * @static
- */
- public static function copy($from, $to)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->copy($from, $to);
- }
- /**
- * Move a file to a new location.
- *
- * @param string $from
- * @param string $to
- * @return bool
- * @static
- */
- public static function move($from, $to)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->move($from, $to);
- }
- /**
- * Get the file size of a given file.
- *
- * @param string $path
- * @return int
- * @static
- */
- public static function size($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->size($path);
- }
- /**
- * Get the checksum for a file.
- *
- * @return string|false
- * @throws UnableToProvideChecksum
- * @static
- */
- public static function checksum($path, $options = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->checksum($path, $options);
- }
- /**
- * Get the mime-type of a given file.
- *
- * @param string $path
- * @return string|false
- * @static
- */
- public static function mimeType($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->mimeType($path);
- }
- /**
- * Get the file's last modification time.
- *
- * @param string $path
- * @return int
- * @static
- */
- public static function lastModified($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->lastModified($path);
- }
- /**
- * Get a resource to read the file.
- *
- * @param string $path
- * @return resource|null The path resource or null on failure.
- * @static
- */
- public static function readStream($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->readStream($path);
- }
- /**
- * Write a new file using a stream.
- *
- * @param string $path
- * @param resource $resource
- * @param array $options
- * @return bool
- * @static
- */
- public static function writeStream($path, $resource, $options = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->writeStream($path, $resource, $options);
- }
- /**
- * Get the URL for the file at the given path.
- *
- * @param string $path
- * @return string
- * @throws \RuntimeException
- * @static
- */
- public static function url($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->url($path);
- }
- /**
- * Determine if temporary URLs can be generated.
- *
- * @return bool
- * @static
- */
- public static function providesTemporaryUrls()
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->providesTemporaryUrls();
- }
- /**
- * Get a temporary URL for the file at the given path.
- *
- * @param string $path
- * @param \DateTimeInterface $expiration
- * @param array $options
- * @return string
- * @throws \RuntimeException
- * @static
- */
- public static function temporaryUrl($path, $expiration, $options = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->temporaryUrl($path, $expiration, $options);
- }
- /**
- * Get a temporary upload URL for the file at the given path.
- *
- * @param string $path
- * @param \DateTimeInterface $expiration
- * @param array $options
- * @return array
- * @throws \RuntimeException
- * @static
- */
- public static function temporaryUploadUrl($path, $expiration, $options = [])
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->temporaryUploadUrl($path, $expiration, $options);
- }
- /**
- * Get an array of all files in a directory.
- *
- * @param string|null $directory
- * @param bool $recursive
- * @return array
- * @static
- */
- public static function files($directory = null, $recursive = false)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->files($directory, $recursive);
- }
- /**
- * Get all of the files from the given directory (recursive).
- *
- * @param string|null $directory
- * @return array
- * @static
- */
- public static function allFiles($directory = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->allFiles($directory);
- }
- /**
- * Get all of the directories within a given directory.
- *
- * @param string|null $directory
- * @param bool $recursive
- * @return array
- * @static
- */
- public static function directories($directory = null, $recursive = false)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->directories($directory, $recursive);
- }
- /**
- * Get all the directories within a given directory (recursive).
- *
- * @param string|null $directory
- * @return array
- * @static
- */
- public static function allDirectories($directory = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->allDirectories($directory);
- }
- /**
- * Create a directory.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function makeDirectory($path)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->makeDirectory($path);
- }
- /**
- * Recursively delete a directory.
- *
- * @param string $directory
- * @return bool
- * @static
- */
- public static function deleteDirectory($directory)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->deleteDirectory($directory);
- }
- /**
- * Get the Flysystem driver.
- *
- * @return \League\Flysystem\FilesystemOperator
- * @static
- */
- public static function getDriver()
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->getDriver();
- }
- /**
- * Get the Flysystem adapter.
- *
- * @return \League\Flysystem\FilesystemAdapter
- * @static
- */
- public static function getAdapter()
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->getAdapter();
- }
- /**
- * Get the configuration values.
- *
- * @return array
- * @static
- */
- public static function getConfig()
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->getConfig();
- }
- /**
- * Define a custom temporary URL builder callback.
- *
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function buildTemporaryUrlsUsing($callback)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- $instance->buildTemporaryUrlsUsing($callback);
- }
- /**
- * Apply the callback if the given "value" is (or resolves to) truthy.
- *
- * @template TWhenParameter
- * @template TWhenReturnType
- * @param \Illuminate\Filesystem\(\Closure($this): TWhenParameter)|TWhenParameter|null $value
- * @param \Illuminate\Filesystem\(callable($this, TWhenParameter): TWhenReturnType)|null $callback
- * @param \Illuminate\Filesystem\(callable($this, TWhenParameter): TWhenReturnType)|null $default
- * @return $this|\Illuminate\Filesystem\TWhenReturnType
- * @static
- */
- public static function when($value = null, $callback = null, $default = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->when($value, $callback, $default);
- }
- /**
- * Apply the callback if the given "value" is (or resolves to) falsy.
- *
- * @template TUnlessParameter
- * @template TUnlessReturnType
- * @param \Illuminate\Filesystem\(\Closure($this): TUnlessParameter)|TUnlessParameter|null $value
- * @param \Illuminate\Filesystem\(callable($this, TUnlessParameter): TUnlessReturnType)|null $callback
- * @param \Illuminate\Filesystem\(callable($this, TUnlessParameter): TUnlessReturnType)|null $default
- * @return $this|\Illuminate\Filesystem\TUnlessReturnType
- * @static
- */
- public static function unless($value = null, $callback = null, $default = null)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->unless($value, $callback, $default);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Filesystem\FilesystemAdapter::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Filesystem\FilesystemAdapter::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Filesystem\FilesystemAdapter::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Filesystem\FilesystemAdapter::flushMacros();
- }
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- * @throws \BadMethodCallException
- * @static
- */
- public static function macroCall($method, $parameters)
- {
- /** @var \Illuminate\Filesystem\FilesystemAdapter $instance */
- return $instance->macroCall($method, $parameters);
- }
- /**
- *
- *
- * @see \App\Providers\AppServiceProvider::boot()
- * @param mixed $diskName
- * @static
- */
- public static function public($diskName)
- {
- return \Illuminate\Filesystem\FilesystemAdapter::public($diskName);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Routing\UrlGenerator
- */
- class URL {
- /**
- * Get the full URL for the current request.
- *
- * @return string
- * @static
- */
- public static function full()
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->full();
- }
- /**
- * Get the current URL for the request.
- *
- * @return string
- * @static
- */
- public static function current()
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->current();
- }
- /**
- * Get the URL for the previous request.
- *
- * @param mixed $fallback
- * @return string
- * @static
- */
- public static function previous($fallback = false)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->previous($fallback);
- }
- /**
- * Get the previous path info for the request.
- *
- * @param mixed $fallback
- * @return string
- * @static
- */
- public static function previousPath($fallback = false)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->previousPath($fallback);
- }
- /**
- * Generate an absolute URL to the given path.
- *
- * @param string $path
- * @param mixed $extra
- * @param bool|null $secure
- * @return string
- * @static
- */
- public static function to($path, $extra = [], $secure = null)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->to($path, $extra, $secure);
- }
- /**
- * Generate a secure, absolute URL to the given path.
- *
- * @param string $path
- * @param array $parameters
- * @return string
- * @static
- */
- public static function secure($path, $parameters = [])
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->secure($path, $parameters);
- }
- /**
- * Generate the URL to an application asset.
- *
- * @param string $path
- * @param bool|null $secure
- * @return string
- * @static
- */
- public static function asset($path, $secure = null)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->asset($path, $secure);
- }
- /**
- * Generate the URL to a secure asset.
- *
- * @param string $path
- * @return string
- * @static
- */
- public static function secureAsset($path)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->secureAsset($path);
- }
- /**
- * Generate the URL to an asset from a custom root domain such as CDN, etc.
- *
- * @param string $root
- * @param string $path
- * @param bool|null $secure
- * @return string
- * @static
- */
- public static function assetFrom($root, $path, $secure = null)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->assetFrom($root, $path, $secure);
- }
- /**
- * Get the default scheme for a raw URL.
- *
- * @param bool|null $secure
- * @return string
- * @static
- */
- public static function formatScheme($secure = null)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->formatScheme($secure);
- }
- /**
- * Create a signed route URL for a named route.
- *
- * @param string $name
- * @param mixed $parameters
- * @param \DateTimeInterface|\DateInterval|int|null $expiration
- * @param bool $absolute
- * @return string
- * @throws \InvalidArgumentException
- * @static
- */
- public static function signedRoute($name, $parameters = [], $expiration = null, $absolute = true)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->signedRoute($name, $parameters, $expiration, $absolute);
- }
- /**
- * Create a temporary signed route URL for a named route.
- *
- * @param string $name
- * @param \DateTimeInterface|\DateInterval|int $expiration
- * @param array $parameters
- * @param bool $absolute
- * @return string
- * @static
- */
- public static function temporarySignedRoute($name, $expiration, $parameters = [], $absolute = true)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->temporarySignedRoute($name, $expiration, $parameters, $absolute);
- }
- /**
- * Determine if the given request has a valid signature.
- *
- * @param \Illuminate\Http\Request $request
- * @param bool $absolute
- * @param array $ignoreQuery
- * @return bool
- * @static
- */
- public static function hasValidSignature($request, $absolute = true, $ignoreQuery = [])
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->hasValidSignature($request, $absolute, $ignoreQuery);
- }
- /**
- * Determine if the given request has a valid signature for a relative URL.
- *
- * @param \Illuminate\Http\Request $request
- * @param array $ignoreQuery
- * @return bool
- * @static
- */
- public static function hasValidRelativeSignature($request, $ignoreQuery = [])
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->hasValidRelativeSignature($request, $ignoreQuery);
- }
- /**
- * Determine if the signature from the given request matches the URL.
- *
- * @param \Illuminate\Http\Request $request
- * @param bool $absolute
- * @param array $ignoreQuery
- * @return bool
- * @static
- */
- public static function hasCorrectSignature($request, $absolute = true, $ignoreQuery = [])
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->hasCorrectSignature($request, $absolute, $ignoreQuery);
- }
- /**
- * Determine if the expires timestamp from the given request is not from the past.
- *
- * @param \Illuminate\Http\Request $request
- * @return bool
- * @static
- */
- public static function signatureHasNotExpired($request)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->signatureHasNotExpired($request);
- }
- /**
- * Get the URL to a named route.
- *
- * @param string $name
- * @param mixed $parameters
- * @param bool $absolute
- * @return string
- * @throws \Symfony\Component\Routing\Exception\RouteNotFoundException
- * @static
- */
- public static function route($name, $parameters = [], $absolute = true)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->route($name, $parameters, $absolute);
- }
- /**
- * Get the URL for a given route instance.
- *
- * @param \Illuminate\Routing\Route $route
- * @param mixed $parameters
- * @param bool $absolute
- * @return string
- * @throws \Illuminate\Routing\Exceptions\UrlGenerationException
- * @static
- */
- public static function toRoute($route, $parameters, $absolute)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->toRoute($route, $parameters, $absolute);
- }
- /**
- * Get the URL to a controller action.
- *
- * @param string|array $action
- * @param mixed $parameters
- * @param bool $absolute
- * @return string
- * @throws \InvalidArgumentException
- * @static
- */
- public static function action($action, $parameters = [], $absolute = true)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->action($action, $parameters, $absolute);
- }
- /**
- * Format the array of URL parameters.
- *
- * @param mixed|array $parameters
- * @return array
- * @static
- */
- public static function formatParameters($parameters)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->formatParameters($parameters);
- }
- /**
- * Get the base URL for the request.
- *
- * @param string $scheme
- * @param string|null $root
- * @return string
- * @static
- */
- public static function formatRoot($scheme, $root = null)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->formatRoot($scheme, $root);
- }
- /**
- * Format the given URL segments into a single URL.
- *
- * @param string $root
- * @param string $path
- * @param \Illuminate\Routing\Route|null $route
- * @return string
- * @static
- */
- public static function format($root, $path, $route = null)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->format($root, $path, $route);
- }
- /**
- * Determine if the given path is a valid URL.
- *
- * @param string $path
- * @return bool
- * @static
- */
- public static function isValidUrl($path)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->isValidUrl($path);
- }
- /**
- * Set the default named parameters used by the URL generator.
- *
- * @param array $defaults
- * @return void
- * @static
- */
- public static function defaults($defaults)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- $instance->defaults($defaults);
- }
- /**
- * Get the default named parameters used by the URL generator.
- *
- * @return array
- * @static
- */
- public static function getDefaultParameters()
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->getDefaultParameters();
- }
- /**
- * Force the scheme for URLs.
- *
- * @param string|null $scheme
- * @return void
- * @static
- */
- public static function forceScheme($scheme)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- $instance->forceScheme($scheme);
- }
- /**
- * Set the forced root URL.
- *
- * @param string|null $root
- * @return void
- * @static
- */
- public static function forceRootUrl($root)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- $instance->forceRootUrl($root);
- }
- /**
- * Set a callback to be used to format the host of generated URLs.
- *
- * @param \Closure $callback
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function formatHostUsing($callback)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->formatHostUsing($callback);
- }
- /**
- * Set a callback to be used to format the path of generated URLs.
- *
- * @param \Closure $callback
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function formatPathUsing($callback)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->formatPathUsing($callback);
- }
- /**
- * Get the path formatter being used by the URL generator.
- *
- * @return \Closure
- * @static
- */
- public static function pathFormatter()
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->pathFormatter();
- }
- /**
- * Get the request instance.
- *
- * @return \Illuminate\Http\Request
- * @static
- */
- public static function getRequest()
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->getRequest();
- }
- /**
- * Set the current request instance.
- *
- * @param \Illuminate\Http\Request $request
- * @return void
- * @static
- */
- public static function setRequest($request)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- $instance->setRequest($request);
- }
- /**
- * Set the route collection.
- *
- * @param \Illuminate\Routing\RouteCollectionInterface $routes
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function setRoutes($routes)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->setRoutes($routes);
- }
- /**
- * Set the session resolver for the generator.
- *
- * @param callable $sessionResolver
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function setSessionResolver($sessionResolver)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->setSessionResolver($sessionResolver);
- }
- /**
- * Set the encryption key resolver.
- *
- * @param callable $keyResolver
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function setKeyResolver($keyResolver)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->setKeyResolver($keyResolver);
- }
- /**
- * Clone a new instance of the URL generator with a different encryption key resolver.
- *
- * @param callable $keyResolver
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function withKeyResolver($keyResolver)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->withKeyResolver($keyResolver);
- }
- /**
- * Set the callback that should be used to attempt to resolve missing named routes.
- *
- * @param callable $missingNamedRouteResolver
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function resolveMissingNamedRoutesUsing($missingNamedRouteResolver)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->resolveMissingNamedRoutesUsing($missingNamedRouteResolver);
- }
- /**
- * Get the root controller namespace.
- *
- * @return string
- * @static
- */
- public static function getRootControllerNamespace()
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->getRootControllerNamespace();
- }
- /**
- * Set the root controller namespace.
- *
- * @param string $rootNamespace
- * @return \Illuminate\Routing\UrlGenerator
- * @static
- */
- public static function setRootControllerNamespace($rootNamespace)
- {
- /** @var \Illuminate\Routing\UrlGenerator $instance */
- return $instance->setRootControllerNamespace($rootNamespace);
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Routing\UrlGenerator::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Routing\UrlGenerator::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Routing\UrlGenerator::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Routing\UrlGenerator::flushMacros();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Validation\Factory
- */
- class Validator {
- /**
- * Create a new Validator instance.
- *
- * @param array $data
- * @param array $rules
- * @param array $messages
- * @param array $attributes
- * @return \Illuminate\Validation\Validator
- * @static
- */
- public static function make($data, $rules, $messages = [], $attributes = [])
- {
- /** @var \Illuminate\Validation\Factory $instance */
- return $instance->make($data, $rules, $messages, $attributes);
- }
- /**
- * Validate the given data against the provided rules.
- *
- * @param array $data
- * @param array $rules
- * @param array $messages
- * @param array $attributes
- * @return array
- * @throws \Illuminate\Validation\ValidationException
- * @static
- */
- public static function validate($data, $rules, $messages = [], $attributes = [])
- {
- /** @var \Illuminate\Validation\Factory $instance */
- return $instance->validate($data, $rules, $messages, $attributes);
- }
- /**
- * Register a custom validator extension.
- *
- * @param string $rule
- * @param \Closure|string $extension
- * @param string|null $message
- * @return void
- * @static
- */
- public static function extend($rule, $extension, $message = null)
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->extend($rule, $extension, $message);
- }
- /**
- * Register a custom implicit validator extension.
- *
- * @param string $rule
- * @param \Closure|string $extension
- * @param string|null $message
- * @return void
- * @static
- */
- public static function extendImplicit($rule, $extension, $message = null)
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->extendImplicit($rule, $extension, $message);
- }
- /**
- * Register a custom dependent validator extension.
- *
- * @param string $rule
- * @param \Closure|string $extension
- * @param string|null $message
- * @return void
- * @static
- */
- public static function extendDependent($rule, $extension, $message = null)
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->extendDependent($rule, $extension, $message);
- }
- /**
- * Register a custom validator message replacer.
- *
- * @param string $rule
- * @param \Closure|string $replacer
- * @return void
- * @static
- */
- public static function replacer($rule, $replacer)
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->replacer($rule, $replacer);
- }
- /**
- * Indicate that unvalidated array keys should be included in validated data when the parent array is validated.
- *
- * @return void
- * @static
- */
- public static function includeUnvalidatedArrayKeys()
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->includeUnvalidatedArrayKeys();
- }
- /**
- * Indicate that unvalidated array keys should be excluded from the validated data, even if the parent array was validated.
- *
- * @return void
- * @static
- */
- public static function excludeUnvalidatedArrayKeys()
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->excludeUnvalidatedArrayKeys();
- }
- /**
- * Set the Validator instance resolver.
- *
- * @param \Closure $resolver
- * @return void
- * @static
- */
- public static function resolver($resolver)
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->resolver($resolver);
- }
- /**
- * Get the Translator implementation.
- *
- * @return \Illuminate\Contracts\Translation\Translator
- * @static
- */
- public static function getTranslator()
- {
- /** @var \Illuminate\Validation\Factory $instance */
- return $instance->getTranslator();
- }
- /**
- * Get the Presence Verifier implementation.
- *
- * @return \Illuminate\Validation\PresenceVerifierInterface
- * @static
- */
- public static function getPresenceVerifier()
- {
- /** @var \Illuminate\Validation\Factory $instance */
- return $instance->getPresenceVerifier();
- }
- /**
- * Set the Presence Verifier implementation.
- *
- * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier
- * @return void
- * @static
- */
- public static function setPresenceVerifier($presenceVerifier)
- {
- /** @var \Illuminate\Validation\Factory $instance */
- $instance->setPresenceVerifier($presenceVerifier);
- }
- /**
- * Get the container instance used by the validation factory.
- *
- * @return \Illuminate\Contracts\Container\Container|null
- * @static
- */
- public static function getContainer()
- {
- /** @var \Illuminate\Validation\Factory $instance */
- return $instance->getContainer();
- }
- /**
- * Set the container instance used by the validation factory.
- *
- * @param \Illuminate\Contracts\Container\Container $container
- * @return \Illuminate\Validation\Factory
- * @static
- */
- public static function setContainer($container)
- {
- /** @var \Illuminate\Validation\Factory $instance */
- return $instance->setContainer($container);
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\View\Factory
- */
- class View {
- /**
- * Get the evaluated view contents for the given view.
- *
- * @param string $path
- * @param \Illuminate\Contracts\Support\Arrayable|array $data
- * @param array $mergeData
- * @return \Illuminate\Contracts\View\View
- * @static
- */
- public static function file($path, $data = [], $mergeData = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->file($path, $data, $mergeData);
- }
- /**
- * Get the evaluated view contents for the given view.
- *
- * @param string $view
- * @param \Illuminate\Contracts\Support\Arrayable|array $data
- * @param array $mergeData
- * @return \Illuminate\Contracts\View\View
- * @static
- */
- public static function make($view, $data = [], $mergeData = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->make($view, $data, $mergeData);
- }
- /**
- * Get the first view that actually exists from the given list.
- *
- * @param array $views
- * @param \Illuminate\Contracts\Support\Arrayable|array $data
- * @param array $mergeData
- * @return \Illuminate\Contracts\View\View
- * @throws \InvalidArgumentException
- * @static
- */
- public static function first($views, $data = [], $mergeData = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->first($views, $data, $mergeData);
- }
- /**
- * Get the rendered content of the view based on a given condition.
- *
- * @param bool $condition
- * @param string $view
- * @param \Illuminate\Contracts\Support\Arrayable|array $data
- * @param array $mergeData
- * @return string
- * @static
- */
- public static function renderWhen($condition, $view, $data = [], $mergeData = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->renderWhen($condition, $view, $data, $mergeData);
- }
- /**
- * Get the rendered content of the view based on the negation of a given condition.
- *
- * @param bool $condition
- * @param string $view
- * @param \Illuminate\Contracts\Support\Arrayable|array $data
- * @param array $mergeData
- * @return string
- * @static
- */
- public static function renderUnless($condition, $view, $data = [], $mergeData = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->renderUnless($condition, $view, $data, $mergeData);
- }
- /**
- * Get the rendered contents of a partial from a loop.
- *
- * @param string $view
- * @param array $data
- * @param string $iterator
- * @param string $empty
- * @return string
- * @static
- */
- public static function renderEach($view, $data, $iterator, $empty = 'raw|')
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->renderEach($view, $data, $iterator, $empty);
- }
- /**
- * Determine if a given view exists.
- *
- * @param string $view
- * @return bool
- * @static
- */
- public static function exists($view)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->exists($view);
- }
- /**
- * Get the appropriate view engine for the given path.
- *
- * @param string $path
- * @return \Illuminate\Contracts\View\Engine
- * @throws \InvalidArgumentException
- * @static
- */
- public static function getEngineFromPath($path)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getEngineFromPath($path);
- }
- /**
- * Add a piece of shared data to the environment.
- *
- * @param array|string $key
- * @param mixed|null $value
- * @return mixed
- * @static
- */
- public static function share($key, $value = null)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->share($key, $value);
- }
- /**
- * Increment the rendering counter.
- *
- * @return void
- * @static
- */
- public static function incrementRender()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->incrementRender();
- }
- /**
- * Decrement the rendering counter.
- *
- * @return void
- * @static
- */
- public static function decrementRender()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->decrementRender();
- }
- /**
- * Check if there are no active render operations.
- *
- * @return bool
- * @static
- */
- public static function doneRendering()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->doneRendering();
- }
- /**
- * Determine if the given once token has been rendered.
- *
- * @param string $id
- * @return bool
- * @static
- */
- public static function hasRenderedOnce($id)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->hasRenderedOnce($id);
- }
- /**
- * Mark the given once token as having been rendered.
- *
- * @param string $id
- * @return void
- * @static
- */
- public static function markAsRenderedOnce($id)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->markAsRenderedOnce($id);
- }
- /**
- * Add a location to the array of view locations.
- *
- * @param string $location
- * @return void
- * @static
- */
- public static function addLocation($location)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->addLocation($location);
- }
- /**
- * Add a new namespace to the loader.
- *
- * @param string $namespace
- * @param string|array $hints
- * @return \Illuminate\View\Factory
- * @static
- */
- public static function addNamespace($namespace, $hints)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->addNamespace($namespace, $hints);
- }
- /**
- * Prepend a new namespace to the loader.
- *
- * @param string $namespace
- * @param string|array $hints
- * @return \Illuminate\View\Factory
- * @static
- */
- public static function prependNamespace($namespace, $hints)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->prependNamespace($namespace, $hints);
- }
- /**
- * Replace the namespace hints for the given namespace.
- *
- * @param string $namespace
- * @param string|array $hints
- * @return \Illuminate\View\Factory
- * @static
- */
- public static function replaceNamespace($namespace, $hints)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->replaceNamespace($namespace, $hints);
- }
- /**
- * Register a valid view extension and its engine.
- *
- * @param string $extension
- * @param string $engine
- * @param \Closure|null $resolver
- * @return void
- * @static
- */
- public static function addExtension($extension, $engine, $resolver = null)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->addExtension($extension, $engine, $resolver);
- }
- /**
- * Flush all of the factory state like sections and stacks.
- *
- * @return void
- * @static
- */
- public static function flushState()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->flushState();
- }
- /**
- * Flush all of the section contents if done rendering.
- *
- * @return void
- * @static
- */
- public static function flushStateIfDoneRendering()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->flushStateIfDoneRendering();
- }
- /**
- * Get the extension to engine bindings.
- *
- * @return array
- * @static
- */
- public static function getExtensions()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getExtensions();
- }
- /**
- * Get the engine resolver instance.
- *
- * @return \Illuminate\View\Engines\EngineResolver
- * @static
- */
- public static function getEngineResolver()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getEngineResolver();
- }
- /**
- * Get the view finder instance.
- *
- * @return \Illuminate\View\ViewFinderInterface
- * @static
- */
- public static function getFinder()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getFinder();
- }
- /**
- * Set the view finder instance.
- *
- * @param \Illuminate\View\ViewFinderInterface $finder
- * @return void
- * @static
- */
- public static function setFinder($finder)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->setFinder($finder);
- }
- /**
- * Flush the cache of views located by the finder.
- *
- * @return void
- * @static
- */
- public static function flushFinderCache()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->flushFinderCache();
- }
- /**
- * Get the event dispatcher instance.
- *
- * @return \Illuminate\Contracts\Events\Dispatcher
- * @static
- */
- public static function getDispatcher()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getDispatcher();
- }
- /**
- * Set the event dispatcher instance.
- *
- * @param \Illuminate\Contracts\Events\Dispatcher $events
- * @return void
- * @static
- */
- public static function setDispatcher($events)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->setDispatcher($events);
- }
- /**
- * Get the IoC container instance.
- *
- * @return \Illuminate\Contracts\Container\Container
- * @static
- */
- public static function getContainer()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getContainer();
- }
- /**
- * Set the IoC container instance.
- *
- * @param \Illuminate\Contracts\Container\Container $container
- * @return void
- * @static
- */
- public static function setContainer($container)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->setContainer($container);
- }
- /**
- * Get an item from the shared data.
- *
- * @param string $key
- * @param mixed $default
- * @return mixed
- * @static
- */
- public static function shared($key, $default = null)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->shared($key, $default);
- }
- /**
- * Get all of the shared data for the environment.
- *
- * @return array
- * @static
- */
- public static function getShared()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getShared();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\View\Factory::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\View\Factory::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\View\Factory::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\View\Factory::flushMacros();
- }
- /**
- * Start a component rendering process.
- *
- * @param \Illuminate\Contracts\View\View|\Illuminate\Contracts\Support\Htmlable|\Closure|string $view
- * @param array $data
- * @return void
- * @static
- */
- public static function startComponent($view, $data = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->startComponent($view, $data);
- }
- /**
- * Get the first view that actually exists from the given list, and start a component.
- *
- * @param array $names
- * @param array $data
- * @return void
- * @static
- */
- public static function startComponentFirst($names, $data = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->startComponentFirst($names, $data);
- }
- /**
- * Render the current component.
- *
- * @return string
- * @static
- */
- public static function renderComponent()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->renderComponent();
- }
- /**
- * Get an item from the component data that exists above the current component.
- *
- * @param string $key
- * @param mixed $default
- * @return mixed|null
- * @static
- */
- public static function getConsumableComponentData($key, $default = null)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getConsumableComponentData($key, $default);
- }
- /**
- * Start the slot rendering process.
- *
- * @param string $name
- * @param string|null $content
- * @param array $attributes
- * @return void
- * @static
- */
- public static function slot($name, $content = null, $attributes = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->slot($name, $content, $attributes);
- }
- /**
- * Save the slot content for rendering.
- *
- * @return void
- * @static
- */
- public static function endSlot()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->endSlot();
- }
- /**
- * Register a view creator event.
- *
- * @param array|string $views
- * @param \Closure|string $callback
- * @return array
- * @static
- */
- public static function creator($views, $callback)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->creator($views, $callback);
- }
- /**
- * Register multiple view composers via an array.
- *
- * @param array $composers
- * @return array
- * @static
- */
- public static function composers($composers)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->composers($composers);
- }
- /**
- * Register a view composer event.
- *
- * @param array|string $views
- * @param \Closure|string $callback
- * @return array
- * @static
- */
- public static function composer($views, $callback)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->composer($views, $callback);
- }
- /**
- * Call the composer for a given view.
- *
- * @param \Illuminate\Contracts\View\View $view
- * @return void
- * @static
- */
- public static function callComposer($view)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->callComposer($view);
- }
- /**
- * Call the creator for a given view.
- *
- * @param \Illuminate\Contracts\View\View $view
- * @return void
- * @static
- */
- public static function callCreator($view)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->callCreator($view);
- }
- /**
- * Start injecting content into a fragment.
- *
- * @param string $fragment
- * @return void
- * @static
- */
- public static function startFragment($fragment)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->startFragment($fragment);
- }
- /**
- * Stop injecting content into a fragment.
- *
- * @return string
- * @throws \InvalidArgumentException
- * @static
- */
- public static function stopFragment()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->stopFragment();
- }
- /**
- * Get the contents of a fragment.
- *
- * @param string $name
- * @param string|null $default
- * @return mixed
- * @static
- */
- public static function getFragment($name, $default = null)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getFragment($name, $default);
- }
- /**
- * Get the entire array of rendered fragments.
- *
- * @return array
- * @static
- */
- public static function getFragments()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getFragments();
- }
- /**
- * Flush all of the fragments.
- *
- * @return void
- * @static
- */
- public static function flushFragments()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->flushFragments();
- }
- /**
- * Start injecting content into a section.
- *
- * @param string $section
- * @param string|null $content
- * @return void
- * @static
- */
- public static function startSection($section, $content = null)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->startSection($section, $content);
- }
- /**
- * Inject inline content into a section.
- *
- * @param string $section
- * @param string $content
- * @return void
- * @static
- */
- public static function inject($section, $content)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->inject($section, $content);
- }
- /**
- * Stop injecting content into a section and return its contents.
- *
- * @return string
- * @static
- */
- public static function yieldSection()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->yieldSection();
- }
- /**
- * Stop injecting content into a section.
- *
- * @param bool $overwrite
- * @return string
- * @throws \InvalidArgumentException
- * @static
- */
- public static function stopSection($overwrite = false)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->stopSection($overwrite);
- }
- /**
- * Stop injecting content into a section and append it.
- *
- * @return string
- * @throws \InvalidArgumentException
- * @static
- */
- public static function appendSection()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->appendSection();
- }
- /**
- * Get the string contents of a section.
- *
- * @param string $section
- * @param string $default
- * @return string
- * @static
- */
- public static function yieldContent($section, $default = '')
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->yieldContent($section, $default);
- }
- /**
- * Get the parent placeholder for the current request.
- *
- * @param string $section
- * @return string
- * @static
- */
- public static function parentPlaceholder($section = '')
- {
- return \Illuminate\View\Factory::parentPlaceholder($section);
- }
- /**
- * Check if section exists.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasSection($name)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->hasSection($name);
- }
- /**
- * Check if section does not exist.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function sectionMissing($name)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->sectionMissing($name);
- }
- /**
- * Get the contents of a section.
- *
- * @param string $name
- * @param string|null $default
- * @return mixed
- * @static
- */
- public static function getSection($name, $default = null)
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getSection($name, $default);
- }
- /**
- * Get the entire array of sections.
- *
- * @return array
- * @static
- */
- public static function getSections()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getSections();
- }
- /**
- * Flush all of the sections.
- *
- * @return void
- * @static
- */
- public static function flushSections()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->flushSections();
- }
- /**
- * Add new loop to the stack.
- *
- * @param \Countable|array $data
- * @return void
- * @static
- */
- public static function addLoop($data)
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->addLoop($data);
- }
- /**
- * Increment the top loop's indices.
- *
- * @return void
- * @static
- */
- public static function incrementLoopIndices()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->incrementLoopIndices();
- }
- /**
- * Pop a loop from the top of the loop stack.
- *
- * @return void
- * @static
- */
- public static function popLoop()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->popLoop();
- }
- /**
- * Get an instance of the last loop in the stack.
- *
- * @return \stdClass|null
- * @static
- */
- public static function getLastLoop()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getLastLoop();
- }
- /**
- * Get the entire loop stack.
- *
- * @return array
- * @static
- */
- public static function getLoopStack()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->getLoopStack();
- }
- /**
- * Start injecting content into a push section.
- *
- * @param string $section
- * @param string $content
- * @return void
- * @static
- */
- public static function startPush($section, $content = '')
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->startPush($section, $content);
- }
- /**
- * Stop injecting content into a push section.
- *
- * @return string
- * @throws \InvalidArgumentException
- * @static
- */
- public static function stopPush()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->stopPush();
- }
- /**
- * Start prepending content into a push section.
- *
- * @param string $section
- * @param string $content
- * @return void
- * @static
- */
- public static function startPrepend($section, $content = '')
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->startPrepend($section, $content);
- }
- /**
- * Stop prepending content into a push section.
- *
- * @return string
- * @throws \InvalidArgumentException
- * @static
- */
- public static function stopPrepend()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->stopPrepend();
- }
- /**
- * Get the string contents of a push section.
- *
- * @param string $section
- * @param string $default
- * @return string
- * @static
- */
- public static function yieldPushContent($section, $default = '')
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->yieldPushContent($section, $default);
- }
- /**
- * Flush all of the stacks.
- *
- * @return void
- * @static
- */
- public static function flushStacks()
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->flushStacks();
- }
- /**
- * Start a translation block.
- *
- * @param array $replacements
- * @return void
- * @static
- */
- public static function startTranslation($replacements = [])
- {
- /** @var \Illuminate\View\Factory $instance */
- $instance->startTranslation($replacements);
- }
- /**
- * Render the current translation.
- *
- * @return string
- * @static
- */
- public static function renderTranslation()
- {
- /** @var \Illuminate\View\Factory $instance */
- return $instance->renderTranslation();
- }
-
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Vite
- */
- class Vite {
- /**
- * Get the preloaded assets.
- *
- * @return array
- * @static
- */
- public static function preloadedAssets()
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->preloadedAssets();
- }
- /**
- * Get the Content Security Policy nonce applied to all generated tags.
- *
- * @return string|null
- * @static
- */
- public static function cspNonce()
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->cspNonce();
- }
- /**
- * Generate or set a Content Security Policy nonce to apply to all generated tags.
- *
- * @param string|null $nonce
- * @return string
- * @static
- */
- public static function useCspNonce($nonce = null)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->useCspNonce($nonce);
- }
- /**
- * Use the given key to detect integrity hashes in the manifest.
- *
- * @param string|false $key
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function useIntegrityKey($key)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->useIntegrityKey($key);
- }
- /**
- * Set the Vite entry points.
- *
- * @param array $entryPoints
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function withEntryPoints($entryPoints)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->withEntryPoints($entryPoints);
- }
- /**
- * Set the filename for the manifest file.
- *
- * @param string $filename
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function useManifestFilename($filename)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->useManifestFilename($filename);
- }
- /**
- * Get the Vite "hot" file path.
- *
- * @return string
- * @static
- */
- public static function hotFile()
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->hotFile();
- }
- /**
- * Set the Vite "hot" file path.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function useHotFile($path)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->useHotFile($path);
- }
- /**
- * Set the Vite build directory.
- *
- * @param string $path
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function useBuildDirectory($path)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->useBuildDirectory($path);
- }
- /**
- * Use the given callback to resolve attributes for script tags.
- *
- * @param \Illuminate\Foundation\(callable(string, string, ?array, ?array): array)|array $attributes
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function useScriptTagAttributes($attributes)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->useScriptTagAttributes($attributes);
- }
- /**
- * Use the given callback to resolve attributes for style tags.
- *
- * @param \Illuminate\Foundation\(callable(string, string, ?array, ?array): array)|array $attributes
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function useStyleTagAttributes($attributes)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->useStyleTagAttributes($attributes);
- }
- /**
- * Use the given callback to resolve attributes for preload tags.
- *
- * @param \Illuminate\Foundation\(callable(string, string, ?array, ?array): (array|false))|array|false $attributes
- * @return \Illuminate\Foundation\Vite
- * @static
- */
- public static function usePreloadTagAttributes($attributes)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->usePreloadTagAttributes($attributes);
- }
- /**
- * Generate React refresh runtime script.
- *
- * @return \Illuminate\Support\HtmlString|void
- * @static
- */
- public static function reactRefresh()
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->reactRefresh();
- }
- /**
- * Get the URL for an asset.
- *
- * @param string $asset
- * @param string|null $buildDirectory
- * @return string
- * @static
- */
- public static function asset($asset, $buildDirectory = null)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->asset($asset, $buildDirectory);
- }
- /**
- * Get the content of a given asset.
- *
- * @param string $asset
- * @param string|null $buildDirectory
- * @return string
- * @throws \Exception
- * @static
- */
- public static function content($asset, $buildDirectory = null)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->content($asset, $buildDirectory);
- }
- /**
- * Get a unique hash representing the current manifest, or null if there is no manifest.
- *
- * @param string|null $buildDirectory
- * @return string|null
- * @static
- */
- public static function manifestHash($buildDirectory = null)
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->manifestHash($buildDirectory);
- }
- /**
- * Determine if the HMR server is running.
- *
- * @return bool
- * @static
- */
- public static function isRunningHot()
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->isRunningHot();
- }
- /**
- * Get the Vite tag content as a string of HTML.
- *
- * @return string
- * @static
- */
- public static function toHtml()
- {
- /** @var \Illuminate\Foundation\Vite $instance */
- return $instance->toHtml();
- }
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Foundation\Vite::macro($name, $macro);
- }
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Foundation\Vite::mixin($mixin, $replace);
- }
- /**
- * Checks if macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- return \Illuminate\Foundation\Vite::hasMacro($name);
- }
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Foundation\Vite::flushMacros();
- }
-
- }
-
-}
-
- namespace Illuminate\Support {
- /**
- *
- *
- */
- class Arr {
-
- }
- /**
- *
- *
- */
- class Js {
-
- }
- /**
- *
- *
- */
- class Str {
-
- }
-
-}
-
- namespace Intervention\Image\Facades {
- /**
- *
- *
- */
- class Image {
- /**
- * Overrides configuration settings
- *
- * @param array $config
- * @return self
- * @static
- */
- public static function configure($config = [])
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->configure($config);
- }
- /**
- * Initiates an Image instance from different input types
- *
- * @param mixed $data
- * @return \Intervention\Image\Image
- * @static
- */
- public static function make($data)
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->make($data);
- }
- /**
- * Creates an empty image canvas
- *
- * @param int $width
- * @param int $height
- * @param mixed $background
- * @return \Intervention\Image\Image
- * @static
- */
- public static function canvas($width, $height, $background = null)
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->canvas($width, $height, $background);
- }
- /**
- * Create new cached image and run callback
- * (requires additional package intervention/imagecache)
- *
- * @param \Closure $callback
- * @param int $lifetime
- * @param boolean $returnObj
- * @return \Image
- * @static
- */
- public static function cache($callback, $lifetime = null, $returnObj = false)
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->cache($callback, $lifetime, $returnObj);
- }
-
- }
- /**
- *
- *
- */
- class Image {
- /**
- * Overrides configuration settings
- *
- * @param array $config
- * @return self
- * @static
- */
- public static function configure($config = [])
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->configure($config);
- }
- /**
- * Initiates an Image instance from different input types
- *
- * @param mixed $data
- * @return \Intervention\Image\Image
- * @static
- */
- public static function make($data)
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->make($data);
- }
- /**
- * Creates an empty image canvas
- *
- * @param int $width
- * @param int $height
- * @param mixed $background
- * @return \Intervention\Image\Image
- * @static
- */
- public static function canvas($width, $height, $background = null)
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->canvas($width, $height, $background);
- }
- /**
- * Create new cached image and run callback
- * (requires additional package intervention/imagecache)
- *
- * @param \Closure $callback
- * @param int $lifetime
- * @param boolean $returnObj
- * @return \Image
- * @static
- */
- public static function cache($callback, $lifetime = null, $returnObj = false)
- {
- /** @var \Intervention\Image\ImageManager $instance */
- return $instance->cache($callback, $lifetime, $returnObj);
- }
-
- }
-
-}
-
- namespace Clockwork\Support\Laravel {
- /**
- *
- *
- */
- class Facade {
- /**
- *
- *
- * @static
- */
- public static function addDataSource($dataSource)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->addDataSource($dataSource);
- }
- /**
- *
- *
- * @static
- */
- public static function resolveRequest()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->resolveRequest();
- }
- /**
- *
- *
- * @static
- */
- public static function resolveAsCommand($name, $exitCode = null, $arguments = [], $options = [], $argumentsDefaults = [], $optionsDefaults = [], $output = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->resolveAsCommand($name, $exitCode, $arguments, $options, $argumentsDefaults, $optionsDefaults, $output);
- }
- /**
- *
- *
- * @static
- */
- public static function resolveAsQueueJob($name, $description = null, $status = 'processed', $payload = [], $queue = null, $connection = null, $options = [])
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->resolveAsQueueJob($name, $description, $status, $payload, $queue, $connection, $options);
- }
- /**
- *
- *
- * @static
- */
- public static function resolveAsTest($name, $status = 'passed', $statusMessage = null, $asserts = [])
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->resolveAsTest($name, $status, $statusMessage, $asserts);
- }
- /**
- *
- *
- * @static
- */
- public static function extendRequest($request = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->extendRequest($request);
- }
- /**
- *
- *
- * @static
- */
- public static function storeRequest()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->storeRequest();
- }
- /**
- *
- *
- * @static
- */
- public static function reset()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->reset();
- }
- /**
- *
- *
- * @static
- */
- public static function request($request = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->request($request);
- }
- /**
- *
- *
- * @static
- */
- public static function log($level = null, $message = null, $context = [])
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->log($level, $message, $context);
- }
- /**
- *
- *
- * @static
- */
- public static function timeline()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->timeline();
- }
- /**
- *
- *
- * @static
- */
- public static function event($description, $data = [])
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->event($description, $data);
- }
- /**
- *
- *
- * @static
- */
- public static function shouldCollect($shouldCollect = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->shouldCollect($shouldCollect);
- }
- /**
- *
- *
- * @static
- */
- public static function shouldRecord($shouldRecord = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->shouldRecord($shouldRecord);
- }
- /**
- *
- *
- * @static
- */
- public static function dataSources($dataSources = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->dataSources($dataSources);
- }
- /**
- *
- *
- * @static
- */
- public static function storage($storage = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->storage($storage);
- }
- /**
- *
- *
- * @static
- */
- public static function authenticator($authenticator = null)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->authenticator($authenticator);
- }
- /**
- *
- *
- * @static
- */
- public static function getDataSources()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->getDataSources();
- }
- /**
- *
- *
- * @static
- */
- public static function getRequest()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->getRequest();
- }
- /**
- *
- *
- * @static
- */
- public static function setRequest($request)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->setRequest($request);
- }
- /**
- *
- *
- * @static
- */
- public static function getStorage()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->getStorage();
- }
- /**
- *
- *
- * @static
- */
- public static function setStorage($storage)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->setStorage($storage);
- }
- /**
- *
- *
- * @static
- */
- public static function getAuthenticator()
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->getAuthenticator();
- }
- /**
- *
- *
- * @static
- */
- public static function setAuthenticator($authenticator)
- {
- /** @var \Clockwork\Clockwork $instance */
- return $instance->setAuthenticator($authenticator);
- }
-
- }
-
-}
-
- namespace Spatie\LaravelIgnition\Facades {
- /**
- *
- *
- * @see \Spatie\FlareClient\Flare
- */
- class Flare {
- /**
- *
- *
- * @static
- */
- public static function make($apiKey = null, $contextDetector = null)
- {
- return \Spatie\FlareClient\Flare::make($apiKey, $contextDetector);
- }
- /**
- *
- *
- * @static
- */
- public static function setApiToken($apiToken)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->setApiToken($apiToken);
- }
- /**
- *
- *
- * @static
- */
- public static function apiTokenSet()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->apiTokenSet();
- }
- /**
- *
- *
- * @static
- */
- public static function setBaseUrl($baseUrl)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->setBaseUrl($baseUrl);
- }
- /**
- *
- *
- * @static
- */
- public static function setStage($stage)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->setStage($stage);
- }
- /**
- *
- *
- * @static
- */
- public static function sendReportsImmediately()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->sendReportsImmediately();
- }
- /**
- *
- *
- * @static
- */
- public static function determineVersionUsing($determineVersionCallable)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->determineVersionUsing($determineVersionCallable);
- }
- /**
- *
- *
- * @static
- */
- public static function reportErrorLevels($reportErrorLevels)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->reportErrorLevels($reportErrorLevels);
- }
- /**
- *
- *
- * @static
- */
- public static function filterExceptionsUsing($filterExceptionsCallable)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->filterExceptionsUsing($filterExceptionsCallable);
- }
- /**
- *
- *
- * @static
- */
- public static function filterReportsUsing($filterReportsCallable)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->filterReportsUsing($filterReportsCallable);
- }
- /**
- *
- *
- * @param array|ArgumentReducer>|\Spatie\Backtrace\Arguments\ArgumentReducers|null $argumentReducers
- * @static
- */
- public static function argumentReducers($argumentReducers)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->argumentReducers($argumentReducers);
- }
- /**
- *
- *
- * @static
- */
- public static function withStackFrameArguments($withStackFrameArguments = true)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->withStackFrameArguments($withStackFrameArguments);
- }
- /**
- *
- *
- * @static
- */
- public static function version()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->version();
- }
- /**
- *
- *
- * @return array>
- * @static
- */
- public static function getMiddleware()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->getMiddleware();
- }
- /**
- *
- *
- * @static
- */
- public static function setContextProviderDetector($contextDetector)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->setContextProviderDetector($contextDetector);
- }
- /**
- *
- *
- * @static
- */
- public static function setContainer($container)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->setContainer($container);
- }
- /**
- *
- *
- * @static
- */
- public static function registerFlareHandlers()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->registerFlareHandlers();
- }
- /**
- *
- *
- * @static
- */
- public static function registerExceptionHandler()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->registerExceptionHandler();
- }
- /**
- *
- *
- * @static
- */
- public static function registerErrorHandler()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->registerErrorHandler();
- }
- /**
- *
- *
- * @param \Spatie\FlareClient\FlareMiddleware\FlareMiddleware|array|\Spatie\FlareClient\class-string|callable $middleware
- * @return \Spatie\FlareClient\Flare
- * @static
- */
- public static function registerMiddleware($middleware)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->registerMiddleware($middleware);
- }
- /**
- *
- *
- * @return array>
- * @static
- */
- public static function getMiddlewares()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->getMiddlewares();
- }
- /**
- *
- *
- * @param string $name
- * @param string $messageLevel
- * @param array $metaData
- * @return \Spatie\FlareClient\Flare
- * @static
- */
- public static function glow($name, $messageLevel = 'info', $metaData = [])
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->glow($name, $messageLevel, $metaData);
- }
- /**
- *
- *
- * @static
- */
- public static function handleException($throwable)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->handleException($throwable);
- }
- /**
- *
- *
- * @return mixed
- * @static
- */
- public static function handleError($code, $message, $file = '', $line = 0)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->handleError($code, $message, $file, $line);
- }
- /**
- *
- *
- * @static
- */
- public static function applicationPath($applicationPath)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->applicationPath($applicationPath);
- }
- /**
- *
- *
- * @static
- */
- public static function report($throwable, $callback = null, $report = null)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->report($throwable, $callback, $report);
- }
- /**
- *
- *
- * @static
- */
- public static function reportMessage($message, $logLevel, $callback = null)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->reportMessage($message, $logLevel, $callback);
- }
- /**
- *
- *
- * @static
- */
- public static function sendTestReport($throwable)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->sendTestReport($throwable);
- }
- /**
- *
- *
- * @static
- */
- public static function reset()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->reset();
- }
- /**
- *
- *
- * @static
- */
- public static function anonymizeIp()
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->anonymizeIp();
- }
- /**
- *
- *
- * @param array $fieldNames
- * @return \Spatie\FlareClient\Flare
- * @static
- */
- public static function censorRequestBodyFields($fieldNames)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->censorRequestBodyFields($fieldNames);
- }
- /**
- *
- *
- * @static
- */
- public static function createReport($throwable)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->createReport($throwable);
- }
- /**
- *
- *
- * @static
- */
- public static function createReportFromMessage($message, $logLevel)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->createReportFromMessage($message, $logLevel);
- }
- /**
- *
- *
- * @static
- */
- public static function stage($stage)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->stage($stage);
- }
- /**
- *
- *
- * @static
- */
- public static function messageLevel($messageLevel)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->messageLevel($messageLevel);
- }
- /**
- *
- *
- * @param string $groupName
- * @param mixed $default
- * @return array
- * @static
- */
- public static function getGroup($groupName = 'context', $default = [])
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->getGroup($groupName, $default);
- }
- /**
- *
- *
- * @static
- */
- public static function context($key, $value)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->context($key, $value);
- }
- /**
- *
- *
- * @param string $groupName
- * @param array $properties
- * @return \Spatie\FlareClient\Flare
- * @static
- */
- public static function group($groupName, $properties)
- {
- /** @var \Spatie\FlareClient\Flare $instance */
- return $instance->group($groupName, $properties);
- }
-
- }
-
-}
-
- namespace Illuminate\Http {
- /**
- *
- *
- */
- class Request {
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation()
- * @param array $rules
- * @param mixed $params
- * @static
- */
- public static function validate($rules, ...$params)
- {
- return \Illuminate\Http\Request::validate($rules, ...$params);
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestValidation()
- * @param string $errorBag
- * @param array $rules
- * @param mixed $params
- * @static
- */
- public static function validateWithBag($errorBag, $rules, ...$params)
- {
- return \Illuminate\Http\Request::validateWithBag($errorBag, $rules, ...$params);
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation()
- * @param mixed $absolute
- * @static
- */
- public static function hasValidSignature($absolute = true)
- {
- return \Illuminate\Http\Request::hasValidSignature($absolute);
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation()
- * @static
- */
- public static function hasValidRelativeSignature()
- {
- return \Illuminate\Http\Request::hasValidRelativeSignature();
- }
- /**
- *
- *
- * @see \Illuminate\Foundation\Providers\FoundationServiceProvider::registerRequestSignatureValidation()
- * @param mixed $ignoreQuery
- * @param mixed $absolute
- * @static
- */
- public static function hasValidSignatureWhileIgnoring($ignoreQuery = [], $absolute = true)
- {
- return \Illuminate\Http\Request::hasValidSignatureWhileIgnoring($ignoreQuery, $absolute);
- }
- /**
- *
- *
- * @see \App\Providers\AppServiceProvider::boot()
- * @param mixed $param
- * @param mixed $newParam
- * @static
- */
- public static function rename($param, $newParam = null)
- {
- return \Illuminate\Http\Request::rename($param, $newParam);
- }
-
- }
-
-}
-
- namespace Illuminate\Routing {
- /**
- *
- *
- * @mixin \Illuminate\Routing\RouteRegistrar
- */
- class Router {
- /**
- *
- *
- * @see \App\Providers\RouteServiceProvider::boot()
- * @param mixed $addendum
- * @param mixed $uri
- * @param mixed $controller
- * @static
- */
- public static function apiAddendumResource($addendum, $uri, $controller)
- {
- return \Illuminate\Routing\Router::apiAddendumResource($addendum, $uri, $controller);
- }
-
- }
-
-}
-
- namespace Illuminate\Filesystem {
- /**
- *
- *
- * @mixin \League\Flysystem\FilesystemOperator
- */
- class FilesystemAdapter {
- /**
- *
- *
- * @see \App\Providers\AppServiceProvider::boot()
- * @param mixed $diskName
- * @static
- */
- public static function public($diskName)
- {
- return \Illuminate\Filesystem\FilesystemAdapter::public($diskName);
- }
-
- }
-
-}
-
-
-namespace {
- class App extends \Illuminate\Support\Facades\App {}
- class Arr extends \Illuminate\Support\Arr {}
- class Artisan extends \Illuminate\Support\Facades\Artisan {}
- class Auth extends \Illuminate\Support\Facades\Auth {}
- class Blade extends \Illuminate\Support\Facades\Blade {}
- class Broadcast extends \Illuminate\Support\Facades\Broadcast {}
- class Bus extends \Illuminate\Support\Facades\Bus {}
- class Cache extends \Illuminate\Support\Facades\Cache {}
- class Config extends \Illuminate\Support\Facades\Config {}
- class Cookie extends \Illuminate\Support\Facades\Cookie {}
- class Crypt extends \Illuminate\Support\Facades\Crypt {}
- class Date extends \Illuminate\Support\Facades\Date {}
- class DB extends \Illuminate\Support\Facades\DB {}
- class Eloquent extends \Illuminate\Database\Eloquent\Model {
- /**
- * Create and return an un-saved model instance.
- *
- * @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function make($attributes = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->make($attributes);
- }
-
- /**
- * Register a new global scope.
- *
- * @param string $identifier
- * @param \Illuminate\Database\Eloquent\Scope|\Closure $scope
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withGlobalScope($identifier, $scope)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withGlobalScope($identifier, $scope);
- }
-
- /**
- * Remove a registered global scope.
- *
- * @param \Illuminate\Database\Eloquent\Scope|string $scope
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withoutGlobalScope($scope)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withoutGlobalScope($scope);
- }
-
- /**
- * Remove all or passed registered global scopes.
- *
- * @param array|null $scopes
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withoutGlobalScopes($scopes = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withoutGlobalScopes($scopes);
- }
-
- /**
- * Get an array of global scopes that were removed from the query.
- *
- * @return array
- * @static
- */
- public static function removedScopes()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->removedScopes();
- }
-
- /**
- * Add a where clause on the primary key to the query.
- *
- * @param mixed $id
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereKey($id)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereKey($id);
- }
-
- /**
- * Add a where clause on the primary key to the query.
- *
- * @param mixed $id
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereKeyNot($id)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereKeyNot($id);
- }
-
- /**
- * Add a basic where clause to the query.
- *
- * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @param string $boolean
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function where($column, $operator = null, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->where($column, $operator, $value, $boolean);
- }
-
- /**
- * Add a basic where clause to the query, and return the first result.
- *
- * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @param string $boolean
- * @return \Illuminate\Database\Eloquent\Model|static|null
- * @static
- */
- public static function firstWhere($column, $operator = null, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->firstWhere($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where" clause to the query.
- *
- * @param \Closure|array|string|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhere($column, $operator = null, $value = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhere($column, $operator, $value);
- }
-
- /**
- * Add a basic "where not" clause to the query.
- *
- * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @param string $boolean
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereNot($column, $operator = null, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereNot($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where not" clause to the query.
- *
- * @param \Closure|array|string|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereNot($column, $operator = null, $value = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereNot($column, $operator, $value);
- }
-
- /**
- * Add an "order by" clause for a timestamp to the query.
- *
- * @param string|\Illuminate\Contracts\Database\Query\Expression $column
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function latest($column = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->latest($column);
- }
-
- /**
- * Add an "order by" clause for a timestamp to the query.
- *
- * @param string|\Illuminate\Contracts\Database\Query\Expression $column
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function oldest($column = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->oldest($column);
- }
-
- /**
- * Create a collection of models from plain arrays.
- *
- * @param array $items
- * @return \Illuminate\Database\Eloquent\Collection
- * @static
- */
- public static function hydrate($items)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->hydrate($items);
- }
-
- /**
- * Create a collection of models from a raw query.
- *
- * @param string $query
- * @param array $bindings
- * @return \Illuminate\Database\Eloquent\Collection
- * @static
- */
- public static function fromQuery($query, $bindings = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->fromQuery($query, $bindings);
- }
-
- /**
- * Find a model by its primary key.
- *
- * @param mixed $id
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null
- * @static
- */
- public static function find($id, $columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->find($id, $columns);
- }
-
- /**
- * Find multiple models by their primary keys.
- *
- * @param \Illuminate\Contracts\Support\Arrayable|array $ids
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Collection
- * @static
- */
- public static function findMany($ids, $columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->findMany($ids, $columns);
- }
-
- /**
- * Find a model by its primary key or throw an exception.
- *
- * @param mixed $id
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static|static[]
- * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
- * @static
- */
- public static function findOrFail($id, $columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->findOrFail($id, $columns);
- }
-
- /**
- * Find a model by its primary key or return fresh model instance.
- *
- * @param mixed $id
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function findOrNew($id, $columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->findOrNew($id, $columns);
- }
-
- /**
- * Find a model by its primary key or call a callback.
- *
- * @param mixed $id
- * @param \Closure|array|string $columns
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|mixed
- * @static
- */
- public static function findOr($id, $columns = [], $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->findOr($id, $columns, $callback);
- }
-
- /**
- * Get the first record matching the attributes or instantiate it.
- *
- * @param array $attributes
- * @param array $values
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function firstOrNew($attributes = [], $values = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->firstOrNew($attributes, $values);
- }
-
- /**
- * Get the first record matching the attributes. If the record is not found, create it.
- *
- * @param array $attributes
- * @param array $values
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function firstOrCreate($attributes = [], $values = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->firstOrCreate($attributes, $values);
- }
-
- /**
- * Attempt to create the record. If a unique constraint violation occurs, attempt to find the matching record.
- *
- * @param array $attributes
- * @param array $values
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function createOrFirst($attributes = [], $values = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->createOrFirst($attributes, $values);
- }
-
- /**
- * Create or update a record matching the attributes, and fill it with values.
- *
- * @param array $attributes
- * @param array $values
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function updateOrCreate($attributes, $values = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->updateOrCreate($attributes, $values);
- }
-
- /**
- * Execute the query and get the first result or throw an exception.
- *
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model|static
- * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
- * @static
- */
- public static function firstOrFail($columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->firstOrFail($columns);
- }
-
- /**
- * Execute the query and get the first result or call a callback.
- *
- * @param \Closure|array|string $columns
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Model|static|mixed
- * @static
- */
- public static function firstOr($columns = [], $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->firstOr($columns, $callback);
- }
-
- /**
- * Execute the query and get the first result if it's the sole matching record.
- *
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model
- * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
- * @throws \Illuminate\Database\MultipleRecordsFoundException
- * @static
- */
- public static function sole($columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->sole($columns);
- }
-
- /**
- * Get a single column's value from the first result of a query.
- *
- * @param string|\Illuminate\Contracts\Database\Query\Expression $column
- * @return mixed
- * @static
- */
- public static function value($column)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->value($column);
- }
-
- /**
- * Get a single column's value from the first result of a query if it's the sole matching record.
- *
- * @param string|\Illuminate\Contracts\Database\Query\Expression $column
- * @return mixed
- * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
- * @throws \Illuminate\Database\MultipleRecordsFoundException
- * @static
- */
- public static function soleValue($column)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->soleValue($column);
- }
-
- /**
- * Get a single column's value from the first result of the query or throw an exception.
- *
- * @param string|\Illuminate\Contracts\Database\Query\Expression $column
- * @return mixed
- * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
- * @static
- */
- public static function valueOrFail($column)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->valueOrFail($column);
- }
-
- /**
- * Execute the query as a "select" statement.
- *
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Collection|static[]
- * @static
- */
- public static function get($columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->get($columns);
- }
-
- /**
- * Get the hydrated models without eager loading.
- *
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model[]|static[]
- * @static
- */
- public static function getModels($columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->getModels($columns);
- }
-
- /**
- * Eager load the relationships for the models.
- *
- * @param array $models
- * @return array
- * @static
- */
- public static function eagerLoadRelations($models)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->eagerLoadRelations($models);
- }
-
- /**
- * Get a lazy collection for the given query.
- *
- * @return \Illuminate\Support\LazyCollection
- * @static
- */
- public static function cursor()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->cursor();
- }
-
- /**
- * Get a collection with the values of a given column.
- *
- * @param string|\Illuminate\Contracts\Database\Query\Expression $column
- * @param string|null $key
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function pluck($column, $key = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->pluck($column, $key);
- }
-
- /**
- * Paginate the given query.
- *
- * @param int|null|\Closure $perPage
- * @param array|string $columns
- * @param string $pageName
- * @param int|null $page
- * @param \Closure|int|null $total
- * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
- * @throws \InvalidArgumentException
- * @static
- */
- public static function paginate($perPage = null, $columns = [], $pageName = 'page', $page = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->paginate($perPage, $columns, $pageName, $page);
- }
-
- /**
- * Paginate the given query into a simple paginator.
- *
- * @param int|null $perPage
- * @param array|string $columns
- * @param string $pageName
- * @param int|null $page
- * @return \Illuminate\Contracts\Pagination\Paginator
- * @static
- */
- public static function simplePaginate($perPage = null, $columns = [], $pageName = 'page', $page = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->simplePaginate($perPage, $columns, $pageName, $page);
- }
-
- /**
- * Paginate the given query into a cursor paginator.
- *
- * @param int|null $perPage
- * @param array|string $columns
- * @param string $cursorName
- * @param \Illuminate\Pagination\Cursor|string|null $cursor
- * @return \Illuminate\Contracts\Pagination\CursorPaginator
- * @static
- */
- public static function cursorPaginate($perPage = null, $columns = [], $cursorName = 'cursor', $cursor = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->cursorPaginate($perPage, $columns, $cursorName, $cursor);
- }
-
- /**
- * Save a new model and return the instance.
- *
- * @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|$this
- * @static
- */
- public static function create($attributes = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->create($attributes);
- }
-
- /**
- * Save a new model and return the instance. Allow mass-assignment.
- *
- * @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|$this
- * @static
- */
- public static function forceCreate($attributes)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->forceCreate($attributes);
- }
-
- /**
- * Save a new model instance with mass assignment without raising model events.
- *
- * @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|$this
- * @static
- */
- public static function forceCreateQuietly($attributes = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->forceCreateQuietly($attributes);
- }
-
- /**
- * Insert new records or update the existing ones.
- *
- * @param array $values
- * @param array|string $uniqueBy
- * @param array|null $update
- * @return int
- * @static
- */
- public static function upsert($values, $uniqueBy, $update = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->upsert($values, $uniqueBy, $update);
- }
-
- /**
- * Register a replacement for the default delete function.
- *
- * @param \Closure $callback
- * @return void
- * @static
- */
- public static function onDelete($callback)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- $instance->onDelete($callback);
- }
-
- /**
- * Call the given local model scopes.
- *
- * @param array|string $scopes
- * @return static|mixed
- * @static
- */
- public static function scopes($scopes)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->scopes($scopes);
- }
-
- /**
- * Apply the scopes to the Eloquent builder instance and return it.
- *
- * @return static
- * @static
- */
- public static function applyScopes()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->applyScopes();
- }
-
- /**
- * Prevent the specified relations from being eager loaded.
- *
- * @param mixed $relations
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function without($relations)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->without($relations);
- }
-
- /**
- * Set the relationships that should be eager loaded while removing any previously added eager loading specifications.
- *
- * @param mixed $relations
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withOnly($relations)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withOnly($relations);
- }
-
- /**
- * Create a new instance of the model being queried.
- *
- * @param array $attributes
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function newModelInstance($attributes = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->newModelInstance($attributes);
- }
-
- /**
- * Apply query-time casts to the model instance.
- *
- * @param array $casts
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withCasts($casts)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withCasts($casts);
- }
-
- /**
- * Execute the given Closure within a transaction savepoint if needed.
- *
- * @template TModelValue
- * @param \Closure(): TModelValue $scope
- * @return \Illuminate\Database\Eloquent\TModelValue
- * @static
- */
- public static function withSavepointIfNeeded($scope)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withSavepointIfNeeded($scope);
- }
-
- /**
- * Get the underlying query builder instance.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function getQuery()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->getQuery();
- }
-
- /**
- * Set the underlying query builder instance.
- *
- * @param \Illuminate\Database\Query\Builder $query
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function setQuery($query)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->setQuery($query);
- }
-
- /**
- * Get a base query builder instance.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function toBase()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->toBase();
- }
-
- /**
- * Get the relationships being eagerly loaded.
- *
- * @return array
- * @static
- */
- public static function getEagerLoads()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->getEagerLoads();
- }
-
- /**
- * Set the relationships being eagerly loaded.
- *
- * @param array $eagerLoad
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function setEagerLoads($eagerLoad)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->setEagerLoads($eagerLoad);
- }
-
- /**
- * Indicate that the given relationships should not be eagerly loaded.
- *
- * @param array $relations
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withoutEagerLoad($relations)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withoutEagerLoad($relations);
- }
-
- /**
- * Flush the relationships being eagerly loaded.
- *
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withoutEagerLoads()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withoutEagerLoads();
- }
-
- /**
- * Get the model instance being queried.
- *
- * @return \Illuminate\Database\Eloquent\Model|static
- * @static
- */
- public static function getModel()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->getModel();
- }
-
- /**
- * Set a model instance for the model being queried.
- *
- * @param \Illuminate\Database\Eloquent\Model $model
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function setModel($model)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->setModel($model);
- }
-
- /**
- * Get the given macro by name.
- *
- * @param string $name
- * @return \Closure
- * @static
- */
- public static function getMacro($name)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->getMacro($name);
- }
-
- /**
- * Checks if a macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasMacro($name)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->hasMacro($name);
- }
-
- /**
- * Get the given global macro by name.
- *
- * @param string $name
- * @return \Closure
- * @static
- */
- public static function getGlobalMacro($name)
- {
- return \Illuminate\Database\Eloquent\Builder::getGlobalMacro($name);
- }
-
- /**
- * Checks if a global macro is registered.
- *
- * @param string $name
- * @return bool
- * @static
- */
- public static function hasGlobalMacro($name)
- {
- return \Illuminate\Database\Eloquent\Builder::hasGlobalMacro($name);
- }
-
- /**
- * Clone the Eloquent query builder.
- *
- * @return static
- * @static
- */
- public static function clone()
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->clone();
- }
-
- /**
- * Chunk the results of the query.
- *
- * @param int $count
- * @param callable $callback
- * @return bool
- * @static
- */
- public static function chunk($count, $callback)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->chunk($count, $callback);
- }
-
- /**
- * Run a map over each item while chunking.
- *
- * @param callable $callback
- * @param int $count
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function chunkMap($callback, $count = 1000)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->chunkMap($callback, $count);
- }
-
- /**
- * Execute a callback over each item while chunking.
- *
- * @param callable $callback
- * @param int $count
- * @return bool
- * @throws \RuntimeException
- * @static
- */
- public static function each($callback, $count = 1000)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->each($callback, $count);
- }
-
- /**
- * Chunk the results of a query by comparing IDs.
- *
- * @param int $count
- * @param callable $callback
- * @param string|null $column
- * @param string|null $alias
- * @return bool
- * @static
- */
- public static function chunkById($count, $callback, $column = null, $alias = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->chunkById($count, $callback, $column, $alias);
- }
-
- /**
- * Execute a callback over each item while chunking by ID.
- *
- * @param callable $callback
- * @param int $count
- * @param string|null $column
- * @param string|null $alias
- * @return bool
- * @static
- */
- public static function eachById($callback, $count = 1000, $column = null, $alias = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->eachById($callback, $count, $column, $alias);
- }
-
- /**
- * Query lazily, by chunks of the given size.
- *
- * @param int $chunkSize
- * @return \Illuminate\Support\LazyCollection
- * @throws \InvalidArgumentException
- * @static
- */
- public static function lazy($chunkSize = 1000)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->lazy($chunkSize);
- }
-
- /**
- * Query lazily, by chunking the results of a query by comparing IDs.
- *
- * @param int $chunkSize
- * @param string|null $column
- * @param string|null $alias
- * @return \Illuminate\Support\LazyCollection
- * @throws \InvalidArgumentException
- * @static
- */
- public static function lazyById($chunkSize = 1000, $column = null, $alias = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->lazyById($chunkSize, $column, $alias);
- }
-
- /**
- * Query lazily, by chunking the results of a query by comparing IDs in descending order.
- *
- * @param int $chunkSize
- * @param string|null $column
- * @param string|null $alias
- * @return \Illuminate\Support\LazyCollection
- * @throws \InvalidArgumentException
- * @static
- */
- public static function lazyByIdDesc($chunkSize = 1000, $column = null, $alias = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->lazyByIdDesc($chunkSize, $column, $alias);
- }
-
- /**
- * Execute the query and get the first result.
- *
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model|object|static|null
- * @static
- */
- public static function first($columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->first($columns);
- }
-
- /**
- * Execute the query and get the first result if it's the sole matching record.
- *
- * @param array|string $columns
- * @return \Illuminate\Database\Eloquent\Model|object|static|null
- * @throws \Illuminate\Database\RecordsNotFoundException
- * @throws \Illuminate\Database\MultipleRecordsFoundException
- * @static
- */
- public static function baseSole($columns = [])
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->baseSole($columns);
- }
-
- /**
- * Pass the query to a given callback.
- *
- * @param callable $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function tap($callback)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->tap($callback);
- }
-
- /**
- * Apply the callback if the given "value" is (or resolves to) truthy.
- *
- * @template TWhenParameter
- * @template TWhenReturnType
- * @param \Illuminate\Database\Eloquent\(\Closure($this): TWhenParameter)|TWhenParameter|null $value
- * @param \Illuminate\Database\Eloquent\(callable($this, TWhenParameter): TWhenReturnType)|null $callback
- * @param \Illuminate\Database\Eloquent\(callable($this, TWhenParameter): TWhenReturnType)|null $default
- * @return $this|\Illuminate\Database\Eloquent\TWhenReturnType
- * @static
- */
- public static function when($value = null, $callback = null, $default = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->when($value, $callback, $default);
- }
-
- /**
- * Apply the callback if the given "value" is (or resolves to) falsy.
- *
- * @template TUnlessParameter
- * @template TUnlessReturnType
- * @param \Illuminate\Database\Eloquent\(\Closure($this): TUnlessParameter)|TUnlessParameter|null $value
- * @param \Illuminate\Database\Eloquent\(callable($this, TUnlessParameter): TUnlessReturnType)|null $callback
- * @param \Illuminate\Database\Eloquent\(callable($this, TUnlessParameter): TUnlessReturnType)|null $default
- * @return $this|\Illuminate\Database\Eloquent\TUnlessReturnType
- * @static
- */
- public static function unless($value = null, $callback = null, $default = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->unless($value, $callback, $default);
- }
-
- /**
- * Add a relationship count / exists condition to the query.
- *
- * @param \Illuminate\Database\Eloquent\Relations\Relation|string $relation
- * @param string $operator
- * @param int $count
- * @param string $boolean
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @throws \RuntimeException
- * @static
- */
- public static function has($relation, $operator = '>=', $count = 1, $boolean = 'and', $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->has($relation, $operator, $count, $boolean, $callback);
- }
-
- /**
- * Add a relationship count / exists condition to the query with an "or".
- *
- * @param string $relation
- * @param string $operator
- * @param int $count
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orHas($relation, $operator = '>=', $count = 1)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orHas($relation, $operator, $count);
- }
-
- /**
- * Add a relationship count / exists condition to the query.
- *
- * @param string $relation
- * @param string $boolean
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function doesntHave($relation, $boolean = 'and', $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->doesntHave($relation, $boolean, $callback);
- }
-
- /**
- * Add a relationship count / exists condition to the query with an "or".
- *
- * @param string $relation
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orDoesntHave($relation)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orDoesntHave($relation);
- }
-
- /**
- * Add a relationship count / exists condition to the query with where clauses.
- *
- * @param string $relation
- * @param \Closure|null $callback
- * @param string $operator
- * @param int $count
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereHas($relation, $callback = null, $operator = '>=', $count = 1)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereHas($relation, $callback, $operator, $count);
- }
-
- /**
- * Add a relationship count / exists condition to the query with where clauses.
- *
- * Also load the relationship with same condition.
- *
- * @param string $relation
- * @param \Closure|null $callback
- * @param string $operator
- * @param int $count
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withWhereHas($relation, $callback = null, $operator = '>=', $count = 1)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withWhereHas($relation, $callback, $operator, $count);
- }
-
- /**
- * Add a relationship count / exists condition to the query with where clauses and an "or".
- *
- * @param string $relation
- * @param \Closure|null $callback
- * @param string $operator
- * @param int $count
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereHas($relation, $callback = null, $operator = '>=', $count = 1)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereHas($relation, $callback, $operator, $count);
- }
-
- /**
- * Add a relationship count / exists condition to the query with where clauses.
- *
- * @param string $relation
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereDoesntHave($relation, $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereDoesntHave($relation, $callback);
- }
-
- /**
- * Add a relationship count / exists condition to the query with where clauses and an "or".
- *
- * @param string $relation
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereDoesntHave($relation, $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereDoesntHave($relation, $callback);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param string $operator
- * @param int $count
- * @param string $boolean
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->hasMorph($relation, $types, $operator, $count, $boolean, $callback);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query with an "or".
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param string $operator
- * @param int $count
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orHasMorph($relation, $types, $operator = '>=', $count = 1)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orHasMorph($relation, $types, $operator, $count);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param string $boolean
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function doesntHaveMorph($relation, $types, $boolean = 'and', $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->doesntHaveMorph($relation, $types, $boolean, $callback);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query with an "or".
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orDoesntHaveMorph($relation, $types)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orDoesntHaveMorph($relation, $types);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query with where clauses.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param \Closure|null $callback
- * @param string $operator
- * @param int $count
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereHasMorph($relation, $types, $callback = null, $operator = '>=', $count = 1)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereHasMorph($relation, $types, $callback, $operator, $count);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param \Closure|null $callback
- * @param string $operator
- * @param int $count
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereHasMorph($relation, $types, $callback = null, $operator = '>=', $count = 1)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereHasMorph($relation, $types, $callback, $operator, $count);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query with where clauses.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereDoesntHaveMorph($relation, $types, $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereDoesntHaveMorph($relation, $types, $callback);
- }
-
- /**
- * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param \Closure|null $callback
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereDoesntHaveMorph($relation, $types, $callback = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereDoesntHaveMorph($relation, $types, $callback);
- }
-
- /**
- * Add a basic where clause to a relationship query.
- *
- * @param string $relation
- * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereRelation($relation, $column, $operator = null, $value = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereRelation($relation, $column, $operator, $value);
- }
-
- /**
- * Add an "or where" clause to a relationship query.
- *
- * @param string $relation
- * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereRelation($relation, $column, $operator = null, $value = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereRelation($relation, $column, $operator, $value);
- }
-
- /**
- * Add a polymorphic relationship condition to the query with a where clause.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereMorphRelation($relation, $types, $column, $operator = null, $value = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereMorphRelation($relation, $types, $column, $operator, $value);
- }
-
- /**
- * Add a polymorphic relationship condition to the query with an "or where" clause.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param string|array $types
- * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @param mixed $operator
- * @param mixed $value
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereMorphRelation($relation, $types, $column, $operator = null, $value = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereMorphRelation($relation, $types, $column, $operator, $value);
- }
-
- /**
- * Add a morph-to relationship condition to the query.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param \Illuminate\Database\Eloquent\Model|string|null $model
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereMorphedTo($relation, $model, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereMorphedTo($relation, $model, $boolean);
- }
-
- /**
- * Add a not morph-to relationship condition to the query.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param \Illuminate\Database\Eloquent\Model|string $model
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function whereNotMorphedTo($relation, $model, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereNotMorphedTo($relation, $model, $boolean);
- }
-
- /**
- * Add a morph-to relationship condition to the query with an "or where" clause.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param \Illuminate\Database\Eloquent\Model|string|null $model
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereMorphedTo($relation, $model)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereMorphedTo($relation, $model);
- }
-
- /**
- * Add a not morph-to relationship condition to the query with an "or where" clause.
- *
- * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation
- * @param \Illuminate\Database\Eloquent\Model|string $model
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function orWhereNotMorphedTo($relation, $model)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereNotMorphedTo($relation, $model);
- }
-
- /**
- * Add a "belongs to" relationship where clause to the query.
- *
- * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection<\Illuminate\Database\Eloquent\Model> $related
- * @param string|null $relationshipName
- * @param string $boolean
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @throws \Illuminate\Database\Eloquent\RelationNotFoundException
- * @static
- */
- public static function whereBelongsTo($related, $relationshipName = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->whereBelongsTo($related, $relationshipName, $boolean);
- }
-
- /**
- * Add an "BelongsTo" relationship with an "or where" clause to the query.
- *
- * @param \Illuminate\Database\Eloquent\Model $related
- * @param string|null $relationshipName
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @throws \RuntimeException
- * @static
- */
- public static function orWhereBelongsTo($related, $relationshipName = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->orWhereBelongsTo($related, $relationshipName);
- }
-
- /**
- * Add subselect queries to include an aggregate value for a relationship.
- *
- * @param mixed $relations
- * @param string $column
- * @param string $function
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withAggregate($relations, $column, $function = null)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withAggregate($relations, $column, $function);
- }
-
- /**
- * Add subselect queries to count the relations.
- *
- * @param mixed $relations
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withCount($relations)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withCount($relations);
- }
-
- /**
- * Add subselect queries to include the max of the relation's column.
- *
- * @param string|array $relation
- * @param string $column
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withMax($relation, $column)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withMax($relation, $column);
- }
-
- /**
- * Add subselect queries to include the min of the relation's column.
- *
- * @param string|array $relation
- * @param string $column
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withMin($relation, $column)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withMin($relation, $column);
- }
-
- /**
- * Add subselect queries to include the sum of the relation's column.
- *
- * @param string|array $relation
- * @param string $column
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withSum($relation, $column)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withSum($relation, $column);
- }
-
- /**
- * Add subselect queries to include the average of the relation's column.
- *
- * @param string|array $relation
- * @param string $column
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withAvg($relation, $column)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withAvg($relation, $column);
- }
-
- /**
- * Add subselect queries to include the existence of related models.
- *
- * @param string|array $relation
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function withExists($relation)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->withExists($relation);
- }
-
- /**
- * Merge the where constraints from another query to the current query.
- *
- * @param \Illuminate\Database\Eloquent\Builder $from
- * @return \Illuminate\Database\Eloquent\Builder|static
- * @static
- */
- public static function mergeConstraintsFrom($from)
- {
- /** @var \Illuminate\Database\Eloquent\Builder $instance */
- return $instance->mergeConstraintsFrom($from);
- }
-
- /**
- * Set the columns to be selected.
- *
- * @param array|mixed $columns
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function select($columns = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->select($columns);
- }
-
- /**
- * Add a subselect expression to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query
- * @param string $as
- * @return \Illuminate\Database\Query\Builder
- * @throws \InvalidArgumentException
- * @static
- */
- public static function selectSub($query, $as)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->selectSub($query, $as);
- }
-
- /**
- * Add a new "raw" select expression to the query.
- *
- * @param string $expression
- * @param array $bindings
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function selectRaw($expression, $bindings = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->selectRaw($expression, $bindings);
- }
-
- /**
- * Makes "from" fetch from a subquery.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query
- * @param string $as
- * @return \Illuminate\Database\Query\Builder
- * @throws \InvalidArgumentException
- * @static
- */
- public static function fromSub($query, $as)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->fromSub($query, $as);
- }
-
- /**
- * Add a raw from clause to the query.
- *
- * @param string $expression
- * @param mixed $bindings
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function fromRaw($expression, $bindings = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->fromRaw($expression, $bindings);
- }
-
- /**
- * Add a new select column to the query.
- *
- * @param array|mixed $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function addSelect($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->addSelect($column);
- }
-
- /**
- * Force the query to only return distinct results.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function distinct()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->distinct();
- }
-
- /**
- * Set the table which the query is targeting.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $table
- * @param string|null $as
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function from($table, $as = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->from($table, $as);
- }
-
- /**
- * Add an index hint to suggest a query index.
- *
- * @param string $index
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function useIndex($index)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->useIndex($index);
- }
-
- /**
- * Add an index hint to force a query index.
- *
- * @param string $index
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function forceIndex($index)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->forceIndex($index);
- }
-
- /**
- * Add an index hint to ignore a query index.
- *
- * @param string $index
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function ignoreIndex($index)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->ignoreIndex($index);
- }
-
- /**
- * Add a join clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $table
- * @param \Closure|string $first
- * @param string|null $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @param string $type
- * @param bool $where
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->join($table, $first, $operator, $second, $type, $where);
- }
-
- /**
- * Add a "join where" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $table
- * @param \Closure|string $first
- * @param string $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string $second
- * @param string $type
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function joinWhere($table, $first, $operator, $second, $type = 'inner')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->joinWhere($table, $first, $operator, $second, $type);
- }
-
- /**
- * Add a subquery join clause to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query
- * @param string $as
- * @param \Closure|string $first
- * @param string|null $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @param string $type
- * @param bool $where
- * @return \Illuminate\Database\Query\Builder
- * @throws \InvalidArgumentException
- * @static
- */
- public static function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->joinSub($query, $as, $first, $operator, $second, $type, $where);
- }
-
- /**
- * Add a left join to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $table
- * @param \Closure|string $first
- * @param string|null $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function leftJoin($table, $first, $operator = null, $second = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->leftJoin($table, $first, $operator, $second);
- }
-
- /**
- * Add a "join where" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $table
- * @param \Closure|string $first
- * @param string $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function leftJoinWhere($table, $first, $operator, $second)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->leftJoinWhere($table, $first, $operator, $second);
- }
-
- /**
- * Add a subquery left join to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query
- * @param string $as
- * @param \Closure|string $first
- * @param string|null $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function leftJoinSub($query, $as, $first, $operator = null, $second = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->leftJoinSub($query, $as, $first, $operator, $second);
- }
-
- /**
- * Add a right join to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $table
- * @param \Closure|string $first
- * @param string|null $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function rightJoin($table, $first, $operator = null, $second = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->rightJoin($table, $first, $operator, $second);
- }
-
- /**
- * Add a "right join where" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $table
- * @param \Closure|string $first
- * @param string $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function rightJoinWhere($table, $first, $operator, $second)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->rightJoinWhere($table, $first, $operator, $second);
- }
-
- /**
- * Add a subquery right join to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query
- * @param string $as
- * @param \Closure|string $first
- * @param string|null $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function rightJoinSub($query, $as, $first, $operator = null, $second = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->rightJoinSub($query, $as, $first, $operator, $second);
- }
-
- /**
- * Add a "cross join" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $table
- * @param \Closure|string|null $first
- * @param string|null $operator
- * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function crossJoin($table, $first = null, $operator = null, $second = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->crossJoin($table, $first, $operator, $second);
- }
-
- /**
- * Add a subquery cross join to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query
- * @param string $as
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function crossJoinSub($query, $as)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->crossJoinSub($query, $as);
- }
-
- /**
- * Merge an array of where clauses and bindings.
- *
- * @param array $wheres
- * @param array $bindings
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function mergeWheres($wheres, $bindings)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->mergeWheres($wheres, $bindings);
- }
-
- /**
- * Prepare the value and operator for a where clause.
- *
- * @param string $value
- * @param string $operator
- * @param bool $useDefault
- * @return array
- * @throws \InvalidArgumentException
- * @static
- */
- public static function prepareValueAndOperator($value, $operator, $useDefault = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->prepareValueAndOperator($value, $operator, $useDefault);
- }
-
- /**
- * Add a "where" clause comparing two columns to the query.
- *
- * @param string|array $first
- * @param string|null $operator
- * @param string|null $second
- * @param string|null $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereColumn($first, $operator = null, $second = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereColumn($first, $operator, $second, $boolean);
- }
-
- /**
- * Add an "or where" clause comparing two columns to the query.
- *
- * @param string|array $first
- * @param string|null $operator
- * @param string|null $second
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereColumn($first, $operator = null, $second = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereColumn($first, $operator, $second);
- }
-
- /**
- * Add a raw where clause to the query.
- *
- * @param string $sql
- * @param mixed $bindings
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereRaw($sql, $bindings = [], $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereRaw($sql, $bindings, $boolean);
- }
-
- /**
- * Add a raw or where clause to the query.
- *
- * @param string $sql
- * @param mixed $bindings
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereRaw($sql, $bindings = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereRaw($sql, $bindings);
- }
-
- /**
- * Add a "where in" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param mixed $values
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereIn($column, $values, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereIn($column, $values, $boolean, $not);
- }
-
- /**
- * Add an "or where in" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param mixed $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereIn($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereIn($column, $values);
- }
-
- /**
- * Add a "where not in" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param mixed $values
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereNotIn($column, $values, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereNotIn($column, $values, $boolean);
- }
-
- /**
- * Add an "or where not in" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param mixed $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereNotIn($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereNotIn($column, $values);
- }
-
- /**
- * Add a "where in raw" clause for integer values to the query.
- *
- * @param string $column
- * @param \Illuminate\Contracts\Support\Arrayable|array $values
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereIntegerInRaw($column, $values, $boolean, $not);
- }
-
- /**
- * Add an "or where in raw" clause for integer values to the query.
- *
- * @param string $column
- * @param \Illuminate\Contracts\Support\Arrayable|array $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereIntegerInRaw($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereIntegerInRaw($column, $values);
- }
-
- /**
- * Add a "where not in raw" clause for integer values to the query.
- *
- * @param string $column
- * @param \Illuminate\Contracts\Support\Arrayable|array $values
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereIntegerNotInRaw($column, $values, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereIntegerNotInRaw($column, $values, $boolean);
- }
-
- /**
- * Add an "or where not in raw" clause for integer values to the query.
- *
- * @param string $column
- * @param \Illuminate\Contracts\Support\Arrayable|array $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereIntegerNotInRaw($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereIntegerNotInRaw($column, $values);
- }
-
- /**
- * Add a "where null" clause to the query.
- *
- * @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereNull($columns, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereNull($columns, $boolean, $not);
- }
-
- /**
- * Add an "or where null" clause to the query.
- *
- * @param string|array|\Illuminate\Contracts\Database\Query\Expression $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereNull($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereNull($column);
- }
-
- /**
- * Add a "where not null" clause to the query.
- *
- * @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereNotNull($columns, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereNotNull($columns, $boolean);
- }
-
- /**
- * Add a where between statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param \Illuminate\Database\Query\iterable $values
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereBetween($column, $values, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereBetween($column, $values, $boolean, $not);
- }
-
- /**
- * Add a where between statement using columns to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param array $values
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereBetweenColumns($column, $values, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereBetweenColumns($column, $values, $boolean, $not);
- }
-
- /**
- * Add an or where between statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param \Illuminate\Database\Query\iterable $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereBetween($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereBetween($column, $values);
- }
-
- /**
- * Add an or where between statement using columns to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param array $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereBetweenColumns($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereBetweenColumns($column, $values);
- }
-
- /**
- * Add a where not between statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param \Illuminate\Database\Query\iterable $values
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereNotBetween($column, $values, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereNotBetween($column, $values, $boolean);
- }
-
- /**
- * Add a where not between statement using columns to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param array $values
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereNotBetweenColumns($column, $values, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereNotBetweenColumns($column, $values, $boolean);
- }
-
- /**
- * Add an or where not between statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param \Illuminate\Database\Query\iterable $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereNotBetween($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereNotBetween($column, $values);
- }
-
- /**
- * Add an or where not between statement using columns to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param array $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereNotBetweenColumns($column, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereNotBetweenColumns($column, $values);
- }
-
- /**
- * Add an "or where not null" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereNotNull($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereNotNull($column);
- }
-
- /**
- * Add a "where date" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|null $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereDate($column, $operator, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereDate($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where date" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|null $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereDate($column, $operator, $value = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereDate($column, $operator, $value);
- }
-
- /**
- * Add a "where time" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|null $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereTime($column, $operator, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereTime($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where time" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|null $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereTime($column, $operator, $value = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereTime($column, $operator, $value);
- }
-
- /**
- * Add a "where day" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|int|null $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereDay($column, $operator, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereDay($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where day" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|int|null $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereDay($column, $operator, $value = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereDay($column, $operator, $value);
- }
-
- /**
- * Add a "where month" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|int|null $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereMonth($column, $operator, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereMonth($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where month" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|int|null $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereMonth($column, $operator, $value = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereMonth($column, $operator, $value);
- }
-
- /**
- * Add a "where year" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|int|null $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereYear($column, $operator, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereYear($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where year" statement to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $operator
- * @param \DateTimeInterface|string|int|null $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereYear($column, $operator, $value = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereYear($column, $operator, $value);
- }
-
- /**
- * Add a nested where statement to the query.
- *
- * @param \Closure $callback
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereNested($callback, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereNested($callback, $boolean);
- }
-
- /**
- * Create a new query instance for nested where condition.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function forNestedWhere()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->forNestedWhere();
- }
-
- /**
- * Add another query builder as a nested where to the query builder.
- *
- * @param \Illuminate\Database\Query\Builder $query
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function addNestedWhereQuery($query, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->addNestedWhereQuery($query, $boolean);
- }
-
- /**
- * Add an exists clause to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $callback
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereExists($callback, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereExists($callback, $boolean, $not);
- }
-
- /**
- * Add an or exists clause to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $callback
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereExists($callback, $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereExists($callback, $not);
- }
-
- /**
- * Add a where not exists clause to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $callback
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereNotExists($callback, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereNotExists($callback, $boolean);
- }
-
- /**
- * Add a where not exists clause to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $callback
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereNotExists($callback)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereNotExists($callback);
- }
-
- /**
- * Add an exists clause to the query.
- *
- * @param \Illuminate\Database\Query\Builder $query
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function addWhereExistsQuery($query, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->addWhereExistsQuery($query, $boolean, $not);
- }
-
- /**
- * Adds a where condition using row values.
- *
- * @param array $columns
- * @param string $operator
- * @param array $values
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @throws \InvalidArgumentException
- * @static
- */
- public static function whereRowValues($columns, $operator, $values, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereRowValues($columns, $operator, $values, $boolean);
- }
-
- /**
- * Adds an or where condition using row values.
- *
- * @param array $columns
- * @param string $operator
- * @param array $values
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereRowValues($columns, $operator, $values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereRowValues($columns, $operator, $values);
- }
-
- /**
- * Add a "where JSON contains" clause to the query.
- *
- * @param string $column
- * @param mixed $value
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereJsonContains($column, $value, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereJsonContains($column, $value, $boolean, $not);
- }
-
- /**
- * Add an "or where JSON contains" clause to the query.
- *
- * @param string $column
- * @param mixed $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereJsonContains($column, $value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereJsonContains($column, $value);
- }
-
- /**
- * Add a "where JSON not contains" clause to the query.
- *
- * @param string $column
- * @param mixed $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereJsonDoesntContain($column, $value, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereJsonDoesntContain($column, $value, $boolean);
- }
-
- /**
- * Add an "or where JSON not contains" clause to the query.
- *
- * @param string $column
- * @param mixed $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereJsonDoesntContain($column, $value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereJsonDoesntContain($column, $value);
- }
-
- /**
- * Add a clause that determines if a JSON path exists to the query.
- *
- * @param string $column
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereJsonContainsKey($column, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereJsonContainsKey($column, $boolean, $not);
- }
-
- /**
- * Add an "or" clause that determines if a JSON path exists to the query.
- *
- * @param string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereJsonContainsKey($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereJsonContainsKey($column);
- }
-
- /**
- * Add a clause that determines if a JSON path does not exist to the query.
- *
- * @param string $column
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereJsonDoesntContainKey($column, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereJsonDoesntContainKey($column, $boolean);
- }
-
- /**
- * Add an "or" clause that determines if a JSON path does not exist to the query.
- *
- * @param string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereJsonDoesntContainKey($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereJsonDoesntContainKey($column);
- }
-
- /**
- * Add a "where JSON length" clause to the query.
- *
- * @param string $column
- * @param mixed $operator
- * @param mixed $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereJsonLength($column, $operator, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereJsonLength($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or where JSON length" clause to the query.
- *
- * @param string $column
- * @param mixed $operator
- * @param mixed $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereJsonLength($column, $operator, $value = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereJsonLength($column, $operator, $value);
- }
-
- /**
- * Handles dynamic "where" clauses to the query.
- *
- * @param string $method
- * @param array $parameters
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function dynamicWhere($method, $parameters)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->dynamicWhere($method, $parameters);
- }
-
- /**
- * Add a "where fulltext" clause to the query.
- *
- * @param string|string[] $columns
- * @param string $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function whereFullText($columns, $value, $options = [], $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->whereFullText($columns, $value, $options, $boolean);
- }
-
- /**
- * Add a "or where fulltext" clause to the query.
- *
- * @param string|string[] $columns
- * @param string $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orWhereFullText($columns, $value, $options = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orWhereFullText($columns, $value, $options);
- }
-
- /**
- * Add a "group by" clause to the query.
- *
- * @param array|\Illuminate\Contracts\Database\Query\Expression|string $groups
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function groupBy(...$groups)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->groupBy(...$groups);
- }
-
- /**
- * Add a raw groupBy clause to the query.
- *
- * @param string $sql
- * @param array $bindings
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function groupByRaw($sql, $bindings = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->groupByRaw($sql, $bindings);
- }
-
- /**
- * Add a "having" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|\Closure|string $column
- * @param string|int|float|null $operator
- * @param string|int|float|null $value
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function having($column, $operator = null, $value = null, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->having($column, $operator, $value, $boolean);
- }
-
- /**
- * Add an "or having" clause to the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|\Closure|string $column
- * @param string|int|float|null $operator
- * @param string|int|float|null $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orHaving($column, $operator = null, $value = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orHaving($column, $operator, $value);
- }
-
- /**
- * Add a nested having statement to the query.
- *
- * @param \Closure $callback
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function havingNested($callback, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->havingNested($callback, $boolean);
- }
-
- /**
- * Add another query builder as a nested having to the query builder.
- *
- * @param \Illuminate\Database\Query\Builder $query
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function addNestedHavingQuery($query, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->addNestedHavingQuery($query, $boolean);
- }
-
- /**
- * Add a "having null" clause to the query.
- *
- * @param string|array $columns
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function havingNull($columns, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->havingNull($columns, $boolean, $not);
- }
-
- /**
- * Add an "or having null" clause to the query.
- *
- * @param string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orHavingNull($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orHavingNull($column);
- }
-
- /**
- * Add a "having not null" clause to the query.
- *
- * @param string|array $columns
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function havingNotNull($columns, $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->havingNotNull($columns, $boolean);
- }
-
- /**
- * Add an "or having not null" clause to the query.
- *
- * @param string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orHavingNotNull($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orHavingNotNull($column);
- }
-
- /**
- * Add a "having between " clause to the query.
- *
- * @param string $column
- * @param \Illuminate\Database\Query\iterable $values
- * @param string $boolean
- * @param bool $not
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function havingBetween($column, $values, $boolean = 'and', $not = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->havingBetween($column, $values, $boolean, $not);
- }
-
- /**
- * Add a raw having clause to the query.
- *
- * @param string $sql
- * @param array $bindings
- * @param string $boolean
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function havingRaw($sql, $bindings = [], $boolean = 'and')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->havingRaw($sql, $bindings, $boolean);
- }
-
- /**
- * Add a raw or having clause to the query.
- *
- * @param string $sql
- * @param array $bindings
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orHavingRaw($sql, $bindings = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orHavingRaw($sql, $bindings);
- }
-
- /**
- * Add an "order by" clause to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|\Illuminate\Contracts\Database\Query\Expression|string $column
- * @param string $direction
- * @return \Illuminate\Database\Query\Builder
- * @throws \InvalidArgumentException
- * @static
- */
- public static function orderBy($column, $direction = 'asc')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orderBy($column, $direction);
- }
-
- /**
- * Add a descending "order by" clause to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|\Illuminate\Contracts\Database\Query\Expression|string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orderByDesc($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orderByDesc($column);
- }
-
- /**
- * Put the query's results in random order.
- *
- * @param string|int $seed
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function inRandomOrder($seed = '')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->inRandomOrder($seed);
- }
-
- /**
- * Add a raw "order by" clause to the query.
- *
- * @param string $sql
- * @param array $bindings
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function orderByRaw($sql, $bindings = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->orderByRaw($sql, $bindings);
- }
-
- /**
- * Alias to set the "offset" value of the query.
- *
- * @param int $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function skip($value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->skip($value);
- }
-
- /**
- * Set the "offset" value of the query.
- *
- * @param int $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function offset($value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->offset($value);
- }
-
- /**
- * Alias to set the "limit" value of the query.
- *
- * @param int $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function take($value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->take($value);
- }
-
- /**
- * Set the "limit" value of the query.
- *
- * @param int $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function limit($value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->limit($value);
- }
-
- /**
- * Set the limit and offset for a given page.
- *
- * @param int $page
- * @param int $perPage
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function forPage($page, $perPage = 15)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->forPage($page, $perPage);
- }
-
- /**
- * Constrain the query to the previous "page" of results before a given ID.
- *
- * @param int $perPage
- * @param int|null $lastId
- * @param string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->forPageBeforeId($perPage, $lastId, $column);
- }
-
- /**
- * Constrain the query to the next "page" of results after a given ID.
- *
- * @param int $perPage
- * @param int|null $lastId
- * @param string $column
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->forPageAfterId($perPage, $lastId, $column);
- }
-
- /**
- * Remove all existing orders and optionally add a new order.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string|null $column
- * @param string $direction
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function reorder($column = null, $direction = 'asc')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->reorder($column, $direction);
- }
-
- /**
- * Add a union statement to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $query
- * @param bool $all
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function union($query, $all = false)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->union($query, $all);
- }
-
- /**
- * Add a union all statement to the query.
- *
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $query
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function unionAll($query)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->unionAll($query);
- }
-
- /**
- * Lock the selected rows in the table.
- *
- * @param string|bool $value
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function lock($value = true)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->lock($value);
- }
-
- /**
- * Lock the selected rows in the table for updating.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function lockForUpdate()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->lockForUpdate();
- }
-
- /**
- * Share lock the selected rows in the table.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function sharedLock()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->sharedLock();
- }
-
- /**
- * Register a closure to be invoked before the query is executed.
- *
- * @param callable $callback
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function beforeQuery($callback)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->beforeQuery($callback);
- }
-
- /**
- * Invoke the "before query" modification callbacks.
- *
- * @return void
- * @static
- */
- public static function applyBeforeQueryCallbacks()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- $instance->applyBeforeQueryCallbacks();
- }
-
- /**
- * Get the SQL representation of the query.
- *
- * @return string
- * @static
- */
- public static function toSql()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->toSql();
- }
-
- /**
- * Get the raw SQL representation of the query with embedded bindings.
- *
- * @return string
- * @static
- */
- public static function toRawSql()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->toRawSql();
- }
-
- /**
- * Get a single expression value from the first result of a query.
- *
- * @param string $expression
- * @param array $bindings
- * @return mixed
- * @static
- */
- public static function rawValue($expression, $bindings = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->rawValue($expression, $bindings);
- }
-
- /**
- * Get the count of the total records for the paginator.
- *
- * @param array $columns
- * @return int
- * @static
- */
- public static function getCountForPagination($columns = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->getCountForPagination($columns);
- }
-
- /**
- * Concatenate values of a given column as a string.
- *
- * @param string $column
- * @param string $glue
- * @return string
- * @static
- */
- public static function implode($column, $glue = '')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->implode($column, $glue);
- }
-
- /**
- * Determine if any rows exist for the current query.
- *
- * @return bool
- * @static
- */
- public static function exists()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->exists();
- }
-
- /**
- * Determine if no rows exist for the current query.
- *
- * @return bool
- * @static
- */
- public static function doesntExist()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->doesntExist();
- }
-
- /**
- * Execute the given callback if no rows exist for the current query.
- *
- * @param \Closure $callback
- * @return mixed
- * @static
- */
- public static function existsOr($callback)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->existsOr($callback);
- }
-
- /**
- * Execute the given callback if rows exist for the current query.
- *
- * @param \Closure $callback
- * @return mixed
- * @static
- */
- public static function doesntExistOr($callback)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->doesntExistOr($callback);
- }
-
- /**
- * Retrieve the "count" result of the query.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $columns
- * @return int
- * @static
- */
- public static function count($columns = '*')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->count($columns);
- }
-
- /**
- * Retrieve the minimum value of a given column.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @return mixed
- * @static
- */
- public static function min($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->min($column);
- }
-
- /**
- * Retrieve the maximum value of a given column.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @return mixed
- * @static
- */
- public static function max($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->max($column);
- }
-
- /**
- * Retrieve the sum of the values of a given column.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @return mixed
- * @static
- */
- public static function sum($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->sum($column);
- }
-
- /**
- * Retrieve the average of the values of a given column.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @return mixed
- * @static
- */
- public static function avg($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->avg($column);
- }
-
- /**
- * Alias for the "avg" method.
- *
- * @param \Illuminate\Contracts\Database\Query\Expression|string $column
- * @return mixed
- * @static
- */
- public static function average($column)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->average($column);
- }
-
- /**
- * Execute an aggregate function on the database.
- *
- * @param string $function
- * @param array $columns
- * @return mixed
- * @static
- */
- public static function aggregate($function, $columns = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->aggregate($function, $columns);
- }
-
- /**
- * Execute a numeric aggregate function on the database.
- *
- * @param string $function
- * @param array $columns
- * @return float|int
- * @static
- */
- public static function numericAggregate($function, $columns = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->numericAggregate($function, $columns);
- }
-
- /**
- * Insert new records into the database.
- *
- * @param array $values
- * @return bool
- * @static
- */
- public static function insert($values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->insert($values);
- }
-
- /**
- * Insert new records into the database while ignoring errors.
- *
- * @param array $values
- * @return int
- * @static
- */
- public static function insertOrIgnore($values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->insertOrIgnore($values);
- }
-
- /**
- * Insert a new record and get the value of the primary key.
- *
- * @param array $values
- * @param string|null $sequence
- * @return int
- * @static
- */
- public static function insertGetId($values, $sequence = null)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->insertGetId($values, $sequence);
- }
-
- /**
- * Insert new records into the table using a subquery.
- *
- * @param array $columns
- * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query
- * @return int
- * @static
- */
- public static function insertUsing($columns, $query)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->insertUsing($columns, $query);
- }
-
- /**
- * Update records in a PostgreSQL database using the update from syntax.
- *
- * @param array $values
- * @return int
- * @static
- */
- public static function updateFrom($values)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->updateFrom($values);
- }
-
- /**
- * Insert or update a record matching the attributes, and fill it with values.
- *
- * @param array $attributes
- * @param array $values
- * @return bool
- * @static
- */
- public static function updateOrInsert($attributes, $values = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->updateOrInsert($attributes, $values);
- }
-
- /**
- * Increment the given column's values by the given amounts.
- *
- * @param array $columns
- * @param array $extra
- * @return int
- * @throws \InvalidArgumentException
- * @static
- */
- public static function incrementEach($columns, $extra = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->incrementEach($columns, $extra);
- }
-
- /**
- * Decrement the given column's values by the given amounts.
- *
- * @param array $columns
- * @param array $extra
- * @return int
- * @throws \InvalidArgumentException
- * @static
- */
- public static function decrementEach($columns, $extra = [])
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->decrementEach($columns, $extra);
- }
-
- /**
- * Run a truncate statement on the table.
- *
- * @return void
- * @static
- */
- public static function truncate()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- $instance->truncate();
- }
-
- /**
- * Get all of the query builder's columns in a text-only array with all expressions evaluated.
- *
- * @return array
- * @static
- */
- public static function getColumns()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->getColumns();
- }
-
- /**
- * Create a raw database expression.
- *
- * @param mixed $value
- * @return \Illuminate\Contracts\Database\Query\Expression
- * @static
- */
- public static function raw($value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->raw($value);
- }
-
- /**
- * Get the current query value bindings in a flattened array.
- *
- * @return array
- * @static
- */
- public static function getBindings()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->getBindings();
- }
-
- /**
- * Get the raw array of bindings.
- *
- * @return array
- * @static
- */
- public static function getRawBindings()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->getRawBindings();
- }
-
- /**
- * Set the bindings on the query builder.
- *
- * @param array $bindings
- * @param string $type
- * @return \Illuminate\Database\Query\Builder
- * @throws \InvalidArgumentException
- * @static
- */
- public static function setBindings($bindings, $type = 'where')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->setBindings($bindings, $type);
- }
-
- /**
- * Add a binding to the query.
- *
- * @param mixed $value
- * @param string $type
- * @return \Illuminate\Database\Query\Builder
- * @throws \InvalidArgumentException
- * @static
- */
- public static function addBinding($value, $type = 'where')
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->addBinding($value, $type);
- }
-
- /**
- * Cast the given binding value.
- *
- * @param mixed $value
- * @return mixed
- * @static
- */
- public static function castBinding($value)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->castBinding($value);
- }
-
- /**
- * Merge an array of bindings into our bindings.
- *
- * @param \Illuminate\Database\Query\Builder $query
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function mergeBindings($query)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->mergeBindings($query);
- }
-
- /**
- * Remove all of the expressions from a list of bindings.
- *
- * @param array $bindings
- * @return array
- * @static
- */
- public static function cleanBindings($bindings)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->cleanBindings($bindings);
- }
-
- /**
- * Get the database query processor instance.
- *
- * @return \Illuminate\Database\Query\Processors\Processor
- * @static
- */
- public static function getProcessor()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->getProcessor();
- }
-
- /**
- * Get the query grammar instance.
- *
- * @return \Illuminate\Database\Query\Grammars\Grammar
- * @static
- */
- public static function getGrammar()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->getGrammar();
- }
-
- /**
- * Use the "write" PDO connection when executing the query.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function useWritePdo()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->useWritePdo();
- }
-
- /**
- * Clone the query without the given properties.
- *
- * @param array $properties
- * @return static
- * @static
- */
- public static function cloneWithout($properties)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->cloneWithout($properties);
- }
-
- /**
- * Clone the query without the given bindings.
- *
- * @param array $except
- * @return static
- * @static
- */
- public static function cloneWithoutBindings($except)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->cloneWithoutBindings($except);
- }
-
- /**
- * Dump the current SQL and bindings.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function dump()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->dump();
- }
-
- /**
- * Dump the raw current SQL with embedded bindings.
- *
- * @return \Illuminate\Database\Query\Builder
- * @static
- */
- public static function dumpRawSql()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->dumpRawSql();
- }
-
- /**
- * Die and dump the current SQL and bindings.
- *
- * @return \Illuminate\Database\Query\never
- * @static
- */
- public static function dd()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->dd();
- }
-
- /**
- * Die and dump the current SQL with embedded bindings.
- *
- * @return \Illuminate\Database\Query\never
- * @static
- */
- public static function ddRawSql()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->ddRawSql();
- }
-
- /**
- * Explains the query.
- *
- * @return \Illuminate\Support\Collection
- * @static
- */
- public static function explain()
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->explain();
- }
-
- /**
- * Register a custom macro.
- *
- * @param string $name
- * @param object|callable $macro
- * @return void
- * @static
- */
- public static function macro($name, $macro)
- {
- \Illuminate\Database\Query\Builder::macro($name, $macro);
- }
-
- /**
- * Mix another object into the class.
- *
- * @param object $mixin
- * @param bool $replace
- * @return void
- * @throws \ReflectionException
- * @static
- */
- public static function mixin($mixin, $replace = true)
- {
- \Illuminate\Database\Query\Builder::mixin($mixin, $replace);
- }
-
- /**
- * Flush the existing macros.
- *
- * @return void
- * @static
- */
- public static function flushMacros()
- {
- \Illuminate\Database\Query\Builder::flushMacros();
- }
-
- /**
- * Dynamically handle calls to the class.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- * @throws \BadMethodCallException
- * @static
- */
- public static function macroCall($method, $parameters)
- {
- /** @var \Illuminate\Database\Query\Builder $instance */
- return $instance->macroCall($method, $parameters);
- }
- }
- class Event extends \Illuminate\Support\Facades\Event {}
- class File extends \Illuminate\Support\Facades\File {}
- class Gate extends \Illuminate\Support\Facades\Gate {}
- class Hash extends \Illuminate\Support\Facades\Hash {}
- class Http extends \Illuminate\Support\Facades\Http {}
- class Js extends \Illuminate\Support\Js {}
- class Lang extends \Illuminate\Support\Facades\Lang {}
- class Log extends \Illuminate\Support\Facades\Log {}
- class Mail extends \Illuminate\Support\Facades\Mail {}
- class Notification extends \Illuminate\Support\Facades\Notification {}
- class Password extends \Illuminate\Support\Facades\Password {}
- class Process extends \Illuminate\Support\Facades\Process {}
- class Queue extends \Illuminate\Support\Facades\Queue {}
- class RateLimiter extends \Illuminate\Support\Facades\RateLimiter {}
- class Redirect extends \Illuminate\Support\Facades\Redirect {}
- class Request extends \Illuminate\Support\Facades\Request {}
- class Response extends \Illuminate\Support\Facades\Response {}
- class Route extends \Illuminate\Support\Facades\Route {}
- class Schema extends \Illuminate\Support\Facades\Schema {}
- class Session extends \Illuminate\Support\Facades\Session {}
- class Storage extends \Illuminate\Support\Facades\Storage {}
- class Str extends \Illuminate\Support\Str {}
- class URL extends \Illuminate\Support\Facades\URL {}
- class Validator extends \Illuminate\Support\Facades\Validator {}
- class View extends \Illuminate\Support\Facades\View {}
- class Vite extends \Illuminate\Support\Facades\Vite {}
- class ImageIntervention extends \Intervention\Image\Facades\Image {}
- class Image extends \Intervention\Image\Facades\Image {}
- class Clockwork extends \Clockwork\Support\Laravel\Facade {}
- class Flare extends \Spatie\LaravelIgnition\Facades\Flare {}
-
-}
-
-
-
-
diff --git a/api.http b/api.http
new file mode 100644
index 0000000..1b4cd26
--- /dev/null
+++ b/api.http
@@ -0,0 +1,7 @@
+### Get media items
+GET http://127.0.0.1:8001/media
+Accept: application/json
+
+### Get media item
+GET http://127.0.0.1:8001/media/SC-After-Dark.png
+Accept: application/json
diff --git a/app/Conductors/AnalyticsConductor.php b/app/Conductors/AnalyticsConductor.php
deleted file mode 100644
index 302d364..0000000
--- a/app/Conductors/AnalyticsConductor.php
+++ /dev/null
@@ -1,71 +0,0 @@
-user();
- return ($user !== null && $user->hasPermission('admin/analytics') === true);
- }
-
- /**
- * Return if the current model is creatable.
- *
- * @return boolean Allow creating model.
- */
- public static function creatable(): bool
- {
- return true;
- }
-
- /**
- * Return if the current model is updatable.
- *
- * @param Model $model The model.
- * @return boolean Allow updating model.
- */
- public static function updatable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/analytics') === true);
- }
-
- /**
- * Return if the current model is destroyable.
- *
- * @param Model $model The model.
- * @return boolean Allow deleting model.
- */
- public static function destroyable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/analytics') === true);
- }
-}
diff --git a/app/Conductors/ArticleConductor.php b/app/Conductors/ArticleConductor.php
deleted file mode 100644
index 4814a3e..0000000
--- a/app/Conductors/ArticleConductor.php
+++ /dev/null
@@ -1,181 +0,0 @@
-user();
- if ($user === null || $user->hasPermission('admin/articles') === false) {
- $builder
- ->where('publish_at', '<=', now());
- }
- }
-
- /**
- * Return if the current model is visible.
- *
- * @param Model $model The model.
- * @return boolean Allow model to be visible.
- */
- public static function viewable(Model $model): bool
- {
- if (Carbon::parse($model->publish_at)->isFuture() === true) {
- /** @var \App\Models\User */
- $user = auth()->user();
- if ($user === null || $user->hasPermission('admin/articles') === false) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Return if the current model is creatable.
- *
- * @return boolean Allow creating model.
- */
- public static function creatable(): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/articles') === true);
- }
-
- /**
- * Return if the current model is updatable.
- *
- * @param Model $model The model.
- * @return boolean Allow updating model.
- */
- public static function updatable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/articles') === true);
- }
-
- /**
- * Return if the current model is destroyable.
- *
- * @param Model $model The model.
- * @return boolean Allow deleting model.
- */
- public static function destroyable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/articles') === true);
- }
-
- /**
- * Transform the final model data
- *
- * @param array $data The model data to transform.
- * @return array The transformed model.
- */
- public function transformFinal(array $data): array
- {
- unset($data['user_id']);
- return $data;
- }
-
- /**
- * Include Attachments Field.
- *
- * @param Model $model Them model.
- * @return mixed The model result.
- */
- public function includeAttachments(Model $model)
- {
- return $model->getAttachments()->map(function ($attachment) {
- return MediaConductor::includeModel(request(), 'attachments', $attachment->media);
- });
- }
-
- /**
- * Include Gallery Field.
- *
- * @param Model $model Them model.
- * @return mixed The model result.
- */
- public function includeGallery(Model $model)
- {
- return $model->getGallery()->map(function ($item) {
- return MediaConductor::includeModel(request(), 'gallery', $item->media);
- });
- }
-
- /**
- * Include User Field.
- *
- * @param Model $model Them model.
- * @return mixed The model result.
- */
- public function includeUser(Model $model)
- {
- $cacheKey = "user:{$model['user_id']}";
- $user = Cache::remember($cacheKey, now()->addDays(28), function () use ($model) {
- return User::find($model['user_id']);
- });
-
- return UserConductor::includeModel(request(), 'user', $user);
- }
-
- /**
- * Transform the Hero field.
- *
- * @param mixed $value The current value.
- * @return array|null The new value.
- */
- public function transformHero(mixed $value): array|null
- {
- $cacheKey = "media:{$value}";
- $media = Cache::remember($cacheKey, now()->addDays(28), function () use ($value) {
- return Media::find($value);
- });
-
- return MediaConductor::includeModel(request(), 'hero', $media);
- }
-}
diff --git a/app/Conductors/Conductor.php b/app/Conductors/Conductor.php
deleted file mode 100644
index 5ed9823..0000000
--- a/app/Conductors/Conductor.php
+++ /dev/null
@@ -1,1055 +0,0 @@
-all();
- if ($limitFields !== null) {
- $filterFields = array_intersect_key($filterFields, array_flip($limitFields));
- }
- $filterFields += $this->defaultFilters;
-
- foreach ($filterFields as $field => $value) {
- if (
- is_array($limitFields) === false ||
- in_array(strtolower($field), array_map('strtolower', $limitFields)) !== false
- ) {
- $value = trim($value);
- $operator = '';
- $join = 'AND';
-
- // Check if value has a operator and remove it if it's a number
- if (preg_match('/^(!?=|[<>]=?|<>|!|\|)([^=!<>].*)*$/', $value, $matches) > 0) {
- $operator = $matches[1];
- $value = ($matches[2] ?? '');
- }
-
- if (strlen($value) === 0 && ($operator !== '==' && $operator !== '!=')) {
- continue;
- }
-
- switch ($operator) {
- case '=':
- $operator = '==';
- break;
- case '!':
- $operator = 'NOT LIKE';
- $value = "%{$value}%";
- break;
- case '>':
- case '<':
- case '|':
- $separatorPos = strpos($value, '|');
- if ($separatorPos !== false) {
- $operator = '==';
- $valueList = explode('|', $value);
- foreach ($valueList as $valueItem) {
- $this->appendFilter($field, $operator, $valueItem, 'OR');
- }
- continue 2;
- }
- break;
- case '>=':
- case '<=':
- case '!=':
- break;
- case '<>':
- $operator = '!=';
- break;
- default:
- $operator = 'LIKE';
- $value = "%{$value}%";
- break;
- }//end switch
-
- $this->appendFilter($field, $operator, $value, $join);
- }//end if
- }//end foreach
- if ($request->has('filter') === true) {
- $this->appendFilterString($request->input('filter', ''), $limitFields);
- }
-
- $this->applyFilters();
- }
-
- /**
- * Apple the filter array to the collection.
- *
- * @return void
- */
- final public function applyFilters(): void
- {
- $parseFunc = function ($filterArray, $query) use (&$parseFunc) {
- $item = null;
- $result = null;
- $join = 'AND';
-
- $relationFilter = [];
-
- $buildWhereFunc = function ($query, $field, $operator, $value, $join) {
- if ($join === 'OR') {
- if ($operator === '<>') {
- $separatorPos = strpos($value, '|');
- if ($separatorPos !== false) {
- $query->orWhereBetween(
- $field,
- [substr($value, 0, $separatorPos), substr($value, ($separatorPos + 1))]
- );
- } else {
- $query->orWhere($field, '!=', $value);
- }
- } else {
- $query->orWhere($field, $operator, $value);
- }
- } else {
- if ($operator === '<>') {
- $separatorPos = strpos($value, '|');
- if ($separatorPos !== false) {
- $query->whereBetween(
- $field,
- [substr($value, 0, $separatorPos), substr($value, ($separatorPos + 1))]
- );
- } else {
- $query->where($field, '!=', $value);
- }
- } else {
- $query->where($field, $operator, $value);
- }
- }//end if
- };
-
- if (gettype($query) === 'array') {
- $item = $query;
- }
-
- foreach ($filterArray as $condition) {
- $currentResult = false;
-
- if (is_array($condition) === true) {
- if (isset($condition[0]) === true && is_array($condition[0]) === true) {
- if ($item !== null) {
- $currentResult = $parseFunc($condition, $item);
- } else {
- if ($join === 'OR') {
- $query->orWhere(function ($subQuery) use ($parseFunc, $condition) {
- $parseFunc($condition, $subQuery);
- });
- } else {
- $query->where(function ($subQuery) use ($parseFunc, $condition) {
- $parseFunc($condition, $subQuery);
- });
- }
- }
- } else {
- if (count($condition) < 3 && $condition[0] !== '') {
- if (count($condition) < 2) {
- $condition[1] = 'LIKE';
- }
- $condition[2] = '%';
- }
-
- if (count($condition) === 3) {
- list($field, $operator, $value) = $condition;
-
- if ($item !== null) {
- if (array_key_exists($field, $item) === true) {
- switch ($operator) {
- case '==':
- $currentResult = ($item[$field] == $value);
- break;
- case 'NOT LIKE':
- $currentResult = (stripos($item[$field], substr($value, 1, -1)) === false);
- break;
- case '>':
- $currentResult = ($item[$field] > $value);
- break;
- case '<':
- $currentResult = ($item[$field] < $value);
- break;
- case '>=':
- $currentResult = ($item[$field] >= $value);
- break;
- case '<=':
- $currentResult = ($item[$field] <= $value);
- break;
- case '!=':
- $currentResult = ($item[$field] != $value);
- break;
- case '<>':
- $separatorPos = strpos($value, '|');
- if ($separatorPos !== false) {
- $fieldInt = intval($item[$field]);
- $currentResult = (
- $fieldInt > intVal(
- substr($value, 0, $separatorPos)
- ) && $fieldInt < intVal(substr($value, ($separatorPos + 1))));
- } else {
- $currentResult = ($item[$field] != $value);
- }
- break;
- case 'LIKE':
- $currentResult = (stripos($item[$field], substr($value, 1, -1)) !== false);
- break;
- }//end switch
- }//end if
- } else {
- if ($operator === '==') {
- $operator = '=';
- }
-
- $relationSplit = strpos($field, '.');
- if ($relationSplit !== false) {
- $relation = substr($field, 0, $relationSplit);
- $field = substr($field, ($relationSplit + 1));
-
- if (method_exists($this->class, $relation) === true) {
- $relationFilter[$relation][] = [$field, $operator, $value, $join];
- }
- } else {
- $buildWhereFunc($query, $field, $operator, $value, $join);
- }
- }//end if
- }//end if
- }//end if
-
- if ($item !== null) {
- if ($result === null) {
- $result = $currentResult;
- } else {
- if ($join === 'OR') {
- $result = $result || $currentResult;
- } else {
- $result = $result && $currentResult;
- }
- }
- }
-
- $join = 'OR';
- } else {
- $join = $condition;
- }//end if
- }//end foreach
-
- foreach ($relationFilter as $relation => $conditions) {
- $query->whereHas($relation, function ($subQuery) use ($buildWhereFunc, $conditions) {
- foreach ($conditions as $condition) {
- $buildWhereFunc($subQuery, $condition[0], $condition[1], $condition[2], $condition[3]);
- }
- });
- }
-
- return $result;
- };
-
- $filterArray = $this->filterArray;
- if (count($filterArray) === 0) {
- $filterArray = $this->defaultFilters;
- }
- if (count($filterArray) !== 0) {
- if ($this->collection !== null) {
- $this->collection = $this->collection->filter(function ($item) use ($parseFunc) {
- return $parseFunc($this->filterArray, $item);
- });
- } else {
- $parseFunc($this->filterArray, $this->query);
- }
- }
- }
-
- /**
- * Run the conductor on a Request to generate a collection and total.
- *
- * @param Request $request The request data.
- * @return array The processed and transformed collection | the total rows found.
- */
- final public static function request(Request $request): array
- {
- $conductor_class = get_called_class();
- $conductor = new $conductor_class();
-
- $total = 0;
-
- try {
- $conductor->query = $conductor->class::query();
- } catch (\Throwable $e) {
- throw new \Exception('Failed to create query builder instance for ' . $conductor->class . '.', 0, $e);
- }
-
- // Filter request
- $limitFields = $conductor->fields(new $conductor->class());
- if (is_array($limitFields) === false) {
- $limitFields = [];
- }
- $conductor->filter($request, $limitFields);
-
- // After Scope query
- $conductor->query->where(function ($query) use ($conductor) {
- $conductor->scope($query);
- });
-
- // Sort request
- $sort = $request->input('sort', $conductor->sort);
- if (strlen($sort) === 0) {
- if (strlen($conductor->sort) > 0) {
- $conductor->sort($conductor->sort);
- }
- } else {
- $conductor->sort($sort);
- }
-
- // Get total
- $total = $conductor->count();
-
- // Paginate
- $conductor->paginate($request->input('page', 1), $request->input('limit', -1), $request->input('offset', 0));
-
- // Filter request
- $fields = $conductor->fields(new $conductor->class());
- if (is_array($fields) === false) {
- $fields = [];
- }
-
- // Limit fields
- $limitFields = array_map(function ($field) {
- if (strpos($field, '.') !== false) {
- return substr($field, 0, strpos($field, '.'));
- }
- return $field;
- }, explode(',', $request->input('fields', '')));
- if ($limitFields === null) {
- $limitFields = $fields;
- } else {
- $limitFields = array_intersect($limitFields, $fields);
- }
- $conductor->limitFields($limitFields);
- $conductor->collection = $conductor->query->get();
-
- // Transform and Includes
- $includes = $conductor->includes;
- if (count($limitFields) > 0) {
- $includes = array_intersect($limitFields, $conductor->includes);
- }
-
- $conductor->collection = $conductor->collection->map(
- function ($model) use ($conductor, $includes, $limitFields) {
- $conductor->applyIncludes($model, $includes);
-
- if (count($limitFields) > 0) {
- $model->setAppends(array_intersect($model->getAppends(), $limitFields));
- }
-
- $model = $conductor->transformModel($model);
-
- return $model;
- }
- );
-
- return [$conductor->collection, $total];
- }
-
- /**
- * Run the conductor on a collection with the data stored in a Request.
- *
- * @param Request $request The request data.
- * @param Collection $collection The collection.
- * @return array The processed and transformed model data.
- */
- final public static function collection(Request $request, Collection $collection): array
- {
- $conductor_class = get_called_class();
- $conductor = new $conductor_class();
-
- $conductor->collection = collect();
-
- foreach ($collection as $item) {
- if ($conductor->viewable($item) === true) {
- $conductor->collection->push($conductor->transformModel($item));
- }
- }
-
- // Filter request
- $limitFields = $conductor->fields(new $conductor->class());
- if (is_array($limitFields) === false) {
- $limitFields = [];
- }
- $conductor->filter($request, $limitFields);
-
- // Get total
- $total = $conductor->collection->count();
-
- // Sort request
- $sort = $request->input('sort', $conductor->sort);
- if (strlen($sort) === 0) {
- if (strlen($conductor->sort) > 0) {
- $conductor->sort($sort);
- }
- } else {
- $conductor->sort($sort);
- }
-
- // Paginate
- $conductor->paginate($request->input('page', 1), $request->input('limit', -1), $request->input('offset', 0));
-
-
- return [$conductor->collection, $total];
- }
-
- /**
- * Filter a custom query on a user request.
- *
- * @param Builder $query The custom query.
- * @param Request $request The request.
- * @param array|null $limitFields Limit the request to these fields.
- * @return Builder
- */
- public static function filterQuery(Builder $query, Request $request, array|null $limitFields = null): Builder
- {
- $conductor_class = get_called_class();
- $conductor = new $conductor_class();
-
- $conductor->query = $query;
- $conductor->filter($request, $limitFields);
-
- return $conductor->query;
- }
-
-
- /**
- * Run the conductor on a Model with the data stored in a Request.
- *
- * @param Request $request The request data.
- * @param string $key The key prefix to use.
- * @param Model|null $model The model.
- * @return array|null The processed and transformed model data.
- */
- final public static function includeModel(Request $request, string $key, mixed $model): array|null
- {
- $fields = [];
-
- if ($request !== null && $request->has('fields') === true) {
- $requestFields = $request->input('fields');
- if ($requestFields !== null) {
- $requestFields = explode(',', $requestFields);
- if (in_array($key, $requestFields) === false) {
- foreach ($requestFields as $field) {
- if (strpos($field, $key . '.') === 0) {
- $fields[] = substr($field, (strlen($key) + 1));
- }
- }
- }
- }
- }
-
- return static::model($fields, $model);
- }
-
- /**
- * Run the conductor on a Model with the data stored in a Request.
- *
- * @param mixed $fields The fields to show.
- * @param Model|null $model The model.
- * @return array|null The processed and transformed model data.
- */
- final public static function model(mixed $fields, mixed $model): array|null
- {
- if ($model === null) {
- return null;
- }
-
- $conductor_class = get_called_class();
- $conductor = new $conductor_class();
-
- $requestIncludes = [];
- $modelFields = $conductor->fields(new $conductor->class());
-
- // Limit fields
- $limitFields = $modelFields;
- if ($fields instanceof Request) {
- if ($fields !== null && $fields->has('fields') === true) {
- $requestFields = $fields->input('fields');
- if ($requestFields !== null) {
- $limitFields = array_intersect(explode(',', $requestFields), $modelFields);
- }
- }
- } elseif (is_array($fields) === true && count($fields) > 0) {
- $limitFields = array_intersect($fields, $modelFields);
- }
-
- if (empty($limitFields) === false) {
- $modelAppends = $model->getAppends();
-
- foreach (array_diff($modelFields, $limitFields) as $attribute) {
- $key = array_search($attribute, $modelAppends);
- if ($key !== false) {
- unset($modelAppends[$key]);
- } else {
- unset($model[$attribute]);
- }
- }
- $model->setAppends($modelAppends);
- }
-
- // Includes
- $includes = array_intersect($limitFields, $conductor->includes);
- $conductor->applyIncludes($model, $includes);
-
- // Transform
- $model = $conductor->transformModel($model);
-
- return $model;
- }
-
- /**
- * Return the current conductor collection count.
- *
- * @return integer The current collection count.
- */
- final public function count(): int
- {
- if ($this->query !== null) {
- return $this->query->count();
- }
-
- return 0;
- }
-
- /**
- * Sort the conductor collection.
- *
- * @param mixed $fields A field name or array of field names to sort. Supports prefix of +/- to change direction.
- * @return void
- */
- final public function sort(mixed $fields = null): void
- {
- $collectionSort = [];
-
- if (is_string($fields) === true) {
- $fields = explode(',', $fields);
- } elseif ($fields === null) {
- $fields = $this->sort;
- }
-
- if (is_array($fields) === true) {
- foreach ($fields as $orderByField) {
- $direction = 'asc';
- $directionChar = substr($orderByField, 0, 1);
-
- if (in_array($directionChar, ['-', '+']) === true) {
- $orderByField = substr($orderByField, 1);
- if ($directionChar === '-') {
- $direction = 'desc';
- }
- }
-
- if ($this->collection !== null) {
- $collectionSort[] = [trim($orderByField), $direction];
- } else {
- $this->query->orderBy(trim($orderByField), $direction);
- }
- }
- } else {
- throw new \InvalidArgumentException('Expected string or array, got ' . gettype($fields));
- }//end if
-
- if ($this->collection !== null) {
- $this->collection = $this->collection->sortBy($collectionSort)->values();
- }
- }
-
- /**
- * Paginate the conductor collection.
- *
- * @param integer $page The current page to return.
- * @param integer $limit The limit of items to include or use default.
- * @param integer $offset Offset the page count after this count of rows.
- * @return mixed
- */
- final public function paginate(int $page = 1, int $limit = -1, int $offset = 0)
- {
- // Limit
- if ($limit < 1) {
- $limit = $this->limit;
- } else {
- $limit = min($limit, $this->maxLimit);
- }
-
- // Page
- if ($page < 1) {
- $page = 1;
- }
-
- // After
- if ($offset < 0) {
- $offset = 0;
- }
-
- if ($this->collection !== null) {
- $this->collection = $this->collection->splice(((($page - 1) * $limit) + $offset), $limit);
- } else {
- $this->query->limit($limit);
- $this->query->offset((($page - 1) * $limit) + $offset);
- }
- }
-
- /**
- * Apply a list of includes to the model.
- *
- * @param Model $model The model to append.
- * @param array $includes The list of includes to include.
- * @return void
- */
- final public function applyIncludes(Model $model, array $includes): void
- {
- foreach ($includes as $include) {
- $includeMethodName = 'include' . Str::studly($include);
- if (method_exists($this, $includeMethodName) === true) {
- $attributeName = Str::snake($include);
- $attributeValue = $this->{$includeMethodName}($model);
- if ($attributeValue !== null) {
- $model->$attributeName = $this->{$includeMethodName}($model);
- }
- }
- }
- }
-
- /**
- * Limit the returned fields in the conductor collection.
- *
- * @param array $fields An array of field names.
- * @return void
- */
- final public function limitFields(array $fields): void
- {
- if (empty($fields) !== true) {
- $this->query->select(array_diff($fields, $this->includes));
- }
- }
-
- /**
- * Filter the conductor collection using raw data.
- *
- * @param string $rawFilter The raw filter string to parse.
- * @param array|null $limitFields The fields to allow in the filter string.
- * @param string $outerJoin The join for this filter group.
- * @return void
- */
- final public function appendFilterString(
- string $rawFilter,
- array|null $limitFields = null,
- string $outerJoin = 'AND'
- ): void {
- if ($rawFilter === '') {
- return;
- }
-
- if (substr($rawFilter, -1) !== ',') {
- $rawFilter .= ',';
- }
-
- $parseFunc = function ($string, &$i = 0) use (&$parseFunc, $limitFields) {
- $tokens = [];
- $ignoreUntil = '';
- $skipUntil = '';
- $field = '';
- $value = null;
- $set = &$field;
-
- for (; $i < strlen($string); $i++) {
- $char = $string[$i];
-
- if ($skipUntil !== '' && $char !== $skipUntil) {
- continue;
- }
-
- if ($ignoreUntil === '') {
- if ($char === '\'' || $char === '"') {
- $ignoreUntil = $char;
- } elseif ($char === ':') {
- if ($field === '') {
- $skipUntil = ',';
- continue;
- }
-
- if ($field[0] === '\'' || $field[0] === '"') {
- $field = substr($field, 1, -1);
- }
-
- if ($set !== $value) {
- $set = &$value;
- continue;
- }
- } elseif (($char === ')' && $string[($i + 1)] === ',') || $char === ',') {
- if ($value === null) {
- $tokens[] = $field;
- } else {
- $value = trim($value);
- $operator = 'LIKE';
-
- // Check if value has a operator and remove it if it's a number
- if (preg_match('/^(!?=|[<>]=?|<>|!)([^=!<>].*)*$/', $value, $matches) > 0) {
- $operator = $matches[1];
- $value = ($matches[2] ?? '');
- }
-
- if ($value[0] === '\'' || $value[0] === '"') {
- $value = substr($value, 1, -1);
- }
-
- if ($operator === 'LIKE') {
- $value = "%{$value}%";
- }
-
- if (
- is_array($limitFields) === false ||
- in_array(strtolower($field), array_map('strtolower', $limitFields)) !== false
- ) {
- $tokens[] = [$field, $operator, $value];
- }
- }//end if
-
- $field = '';
- $value = null;
- $set = &$field;
-
- if ($char === ')') {
- $i++;
- return $tokens;
- }
-
- continue;
- } elseif ($char === '(') {
- if ($field === '') {
- $i++;
- $tokens[] = $parseFunc($string, $i);
- continue;
- }
- }//end if
- } elseif ($char === $ignoreUntil) {
- $ignoreUntil = '';
- }//end if
-
- $set .= $char;
- }//end for
-
- return $tokens;
- };
-
- $i = 0;
- $filterArray = $parseFunc($rawFilter, $i);
-
- if (count($this->filterArray) !== 0) {
- $this->filterArray[] = $outerJoin;
- }
- $this->filterArray[] = $filterArray;
- }
-
- /**
- * Append a field to the filter array.
- *
- * @param string $field The field name to append.
- * @param string $operator The operator to append.
- * @param string $value The value to append.
- * @param string $join The join to append.
- * @return void
- */
- final public function appendFilter(string $field, string $operator, string $value, string $join = 'OR'): void
- {
- if (count($this->filterArray) !== 0) {
- $this->filterArray[] = $join;
- }
- $this->filterArray[] = [$field, $operator, $value];
- }
-
- /**
- * Run a scope query on the collection before anything else.
- *
- * @param Builder $builder The builder in use.
- * @return void
- */
- public function scope(Builder $builder): void
- {
- // empty
- }
-
- /**
- * Return an array of model fields visible to the current user.
- *
- * @param Model $model The model in question.
- * @return array The array of field names.
- */
- public function fields(Model $model): array
- {
- $visibleFields = Cache::remember(
- "model:{$model->getTable()}:visible",
- now()->addDays(28),
- function () use ($model) {
- $fields = $model->getVisible();
- if (empty($fields) === true) {
- $fields = Cache::remember(
- "schema:{$model->getTable()}:columns",
- now()->addDays(28),
- function () use ($model) {
- return $model->getConnection()
- ->getSchemaBuilder()
- ->getColumnListing($model->getTable());
- }
- );
- }
-
- return $fields;
- }
- );
-
- $appends = $model->getAppends();
- if (is_array($appends) === true) {
- $visibleFields = array_merge($visibleFields, $appends);
- }
-
- if (is_array($this->includes) === true) {
- $visibleFields = array_merge($visibleFields, $this->includes);
- }
-
- return $visibleFields;
- }
-
- /**
- * Transform the passed Model to an array
- *
- * @param Model $model The model to transform.
- * @return array The transformed model.
- */
- protected function transformModel(Model $model): array
- {
- $result = $this->transform($model);
- foreach ($result as $key => $value) {
- $transformFunction = 'transform' . Str::studly($key);
- if (method_exists($this, $transformFunction) === true) {
- $result[$key] = $this->$transformFunction($value);
- }
- }
-
- $result = $this->transformFinal($result);
- return $result;
- }
-
- /**
- * Transform the passed Model to an array
- *
- * @param Model $model The model to transform.
- * @return array The transformed model.
- */
- public function transform(Model $model): array
- {
- $result = $model->toArray();
-
- $fields = $this->fields($model);
-
- if (is_array($fields) === true) {
- $result = array_intersect_key($result, array_flip($fields));
- }
-
- return $result;
- }
-
- /**
- * Final Transform of the model array
- *
- * @param array $data The model array to transform.
- * @return array The transformed model.
- */
- public function transformFinal(array $data): array
- {
- return $data;
- }
-
- /**
- * Is the passed model viewable by the current user?
- *
- * @param Model $model The model in question.
- * @return boolean Is the model viewable.
- */
- public static function viewable(Model $model): bool
- {
- return true;
- }
-
- /**
- * Is the model creatable by the current user?
- *
- * @return boolean Is the model creatable.
- */
- public static function creatable(): bool
- {
- return true;
- }
-
- /**
- * Is the passed model updatable by the current user?
- *
- * @param Model $model The model in question.
- * @return boolean Is the model updatable.
- */
- public static function updatable(Model $model): bool
- {
- return true;
- }
-
- /**
- * Is the passed model destroyable by the current user?
- *
- * @param Model $model The model in question.
- * @return boolean Is the model destroyable.
- */
- public static function destroyable(Model $model): bool
- {
- return true;
- }
-}
diff --git a/app/Conductors/EventConductor.php b/app/Conductors/EventConductor.php
deleted file mode 100644
index d91c14e..0000000
--- a/app/Conductors/EventConductor.php
+++ /dev/null
@@ -1,140 +0,0 @@
-user();
- if ($user === null || $user->hasPermission('admin/events') === false) {
- $builder
- ->where('status', '!=', 'draft')
- ->where('publish_at', '<=', now());
- }
- }
-
- /**
- * Return if the current model is visible.
- *
- * @param Model $model The model.
- * @return boolean Allow model to be visible.
- */
- public static function viewable(Model $model): bool
- {
- if (strtolower($model->status) === 'draft' || Carbon::parse($model->publish_at)->isFuture() === true) {
- /** @var \App\Models\User */
- $user = auth()->user();
- if ($user === null || $user->hasPermission('admin/events') === false) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Return if the current model is creatable.
- *
- * @return boolean Allow creating model.
- */
- public static function creatable(): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/events') === true);
- }
-
- /**
- * Return if the current model is updatable.
- *
- * @param Model $model The model.
- * @return boolean Allow updating model.
- */
- public static function updatable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/events') === true);
- }
-
- /**
- * Return if the current model is destroyable.
- *
- * @param Model $model The model.
- * @return boolean Allow deleting model.
- */
- public static function destroyable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/events') === true);
- }
-
- /**
- * Include Attachments Field.
- *
- * @param Model $model Them model.
- * @return mixed The model result.
- */
- public function includeAttachments(Model $model)
- {
- /** @var \App\Models\User */
- $user = auth()->user();
-
- return $model->getAttachments()->map(function ($attachment) use ($user) {
- if ($attachment->private === false || ($user !== null && $user->hasPermission('admin/events') === true)) {
- return MediaConductor::includeModel(request(), 'attachments', $attachment->media);
- }
- });
- }
-
- /**
- * Transform the Hero field.
- *
- * @param mixed $value The current value.
- * @return array|null The new value.
- */
- public function transformHero(mixed $value): array|null
- {
- $cacheKey = "media:{$value}";
- $media = Cache::remember($cacheKey, now()->addDays(28), function () use ($value) {
- return Media::find($value);
- });
-
- return MediaConductor::includeModel(request(), 'hero', $media);
- }
-}
diff --git a/app/Conductors/MediaConductor.php b/app/Conductors/MediaConductor.php
deleted file mode 100644
index f627744..0000000
--- a/app/Conductors/MediaConductor.php
+++ /dev/null
@@ -1,184 +0,0 @@
- 'OK'
- // ];
-
-
- /**
- * Return an array of model fields visible to the current user.
- *
- * @param Model $model The model in question.
- * @return array The array of field names.
- */
- public function fields(Model $model): array
- {
- $fields = parent::fields($model);
-
- /** @var \App\Models\User */
- $user = auth()->user();
- if ($user === null || $user->hasPermission('admin/media') === false) {
- $fields = arrayRemoveItem($fields, ['security_data', 'storage']);
- }
-
- return $fields;
- }
-
- /**
- * Run a scope query on the collection before anything else.
- *
- * @param Builder $builder The builder in use.
- * @return void
- */
- public function scope(Builder $builder): void
- {
- $user = auth()->user();
- if ($user === null) {
- $builder->where('security_type', '')
- ->orWhere('security_type', 'password');
- } else {
- $builder->where(function ($query) use ($user) {
- $query->where('security_type', '')
- ->orWhere('security_type', 'password')
- ->orWhere(function ($subquery) use ($user) {
- $subquery->where('security_type', 'permission')
- ->whereIn('security_data', $user->permissions);
- });
- });
- }
- }
-
- /**
- * Return if the current model is visible.
- *
- * @param Model $model The model.
- * @return boolean Allow model to be visible.
- */
- public static function viewable(Model $model): bool
- {
- if (strcasecmp('permission', $model->security_type) === 0) {
- /** @var \App\Models\User */
- $user = auth()->user();
- if ($user === null || $user->hasPermission($model->security_data) === false) {
- return false;
- }
- } elseif ($model->security_type !== '' && strcasecmp('password', $model->security_type) !== 0) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Return if the current model is creatable.
- *
- * @return boolean Allow creating model.
- */
- public static function creatable(): bool
- {
- $user = auth()->user();
- return ($user !== null);
- }
-
- /**
- * Return if the current model is updatable.
- *
- * @param Model $model The model.
- * @return boolean Allow updating model.
- */
- public static function updatable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && (strcasecmp($model->user_id, $user->id) === 0 ||
- $user->hasPermission('admin/media') === true));
- }
-
- /**
- * Return if the current model is destroyable.
- *
- * @param Model $model The model.
- * @return boolean Allow deleting model.
- */
- public static function destroyable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && ($model->user_id === $user->id || $user->hasPermission('admin/media') === true));
- }
-
- /**
- * Transform the final model data
- *
- * @param array $data The model data to transform.
- * @return array The transformed model.
- */
- public function transformFinal(array $data): array
- {
- unset($data['user_id']);
- return $data;
- }
-
- /**
- * Include User Field.
- *
- * @param Model $model Them model.
- * @return mixed The model result.
- */
- public function includeUser(Model $model)
- {
- $user = Cache::remember("user:{$model['user_id']}", now()->addDays(28), function () use ($model) {
- return User::find($model['user_id']);
- });
-
- return UserConductor::includeModel(request(), 'user', $user);
- }
-
- /**
- * Include job models in Media
- *
- * @param Model $model The reference model.
- * @return mixed
- */
- public function includeJobs(Model $model)
- {
- $jobs = $model->jobs()
- ->select(['id','created_at','updated_at','user_id','status','status_text','progress'])
- ->orderBy('created_at', 'desc')->get();
- return $jobs;
- }
-}
diff --git a/app/Conductors/MediaJobConductor.php b/app/Conductors/MediaJobConductor.php
deleted file mode 100644
index a55ef30..0000000
--- a/app/Conductors/MediaJobConductor.php
+++ /dev/null
@@ -1,76 +0,0 @@
-user();
- return ($user !== null && $user->hasPermission('admin/shortlinks') === true);
- }
-
- /**
- * Return if the current model is updatable.
- *
- * @param Model $model The model.
- * @return boolean Allow updating model.
- */
- public static function updatable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/shortlinks') === true);
- }
-
- /**
- * Return if the current model is destroyable.
- *
- * @param Model $model The model.
- * @return boolean Allow deleting model.
- */
- public static function destroyable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/shortlinks') === true);
- }
-}
diff --git a/app/Conductors/SubscriptionConductor.php b/app/Conductors/SubscriptionConductor.php
deleted file mode 100644
index 5bc3a3a..0000000
--- a/app/Conductors/SubscriptionConductor.php
+++ /dev/null
@@ -1,45 +0,0 @@
-user();
- return ($user !== null && (
- (strcasecmp($model->email, $user->email) === 0 && $user->email_verified_at !== null) ||
- $user->hasPermission('admin/subscriptions') === true
- ));
- }
-
- /**
- * Return if the current model is destroyable.
- *
- * @param Model $model The model.
- * @return boolean Allow deleting model.
- */
- public static function destroyable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && ((strcasecmp($model->email, $user->email) === 0 &&
- $user->email_verified_at !== null) || $user->hasPermission('admin/subscriptions') === true));
- }
-}
diff --git a/app/Conductors/UserConductor.php b/app/Conductors/UserConductor.php
deleted file mode 100644
index 4222de9..0000000
--- a/app/Conductors/UserConductor.php
+++ /dev/null
@@ -1,89 +0,0 @@
-user();
- if ($user === null || $user->hasPermission('admin/users') === false) {
- return ['id', 'display_name'];
- }
-
- return parent::fields($model);
- }
-
- /**
- * Transform the passed Model to an array
- *
- * @param Model $model The model to transform.
- * @return array The transformed model.
- */
- public function transform(Model $model): array
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- $data = $model->toArray();
- $limit = $this->fields($model);
-
- if (
- $user === null || (
- $user->hasPermission('admin/users') === false && strcasecmp($user->id, $model->id) !== 0
- )
- ) {
- $limit = ['id', 'display_name'];
- } else {
- $data['permissions'] = $user->permissions;
- }
-
- $data = arrayLimitKeys($data, $limit);
- return $data;
- }
-
- /**
- * Return if the current model is updatable.
- *
- * @param Model $model The model.
- * @return boolean Allow updating model.
- */
- public static function updatable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- if ($user !== null) {
- return ($user->hasPermission('admin/users') === true || strcasecmp($user->id, $model->id) === 0);
- }
-
- return false;
- }
-
- /**
- * Return if the current model is destroyable.
- *
- * @param Model $model The model.
- * @return boolean Allow deleting model.
- */
- public static function destroyable(Model $model): bool
- {
- /** @var \App\Models\User */
- $user = auth()->user();
- return ($user !== null && $user->hasPermission('admin/users') === true);
- }
-}
diff --git a/app/Console/Commands/CleanupTempFiles.php b/app/Console/Commands/CleanupTempFiles.php
deleted file mode 100644
index a68ad2f..0000000
--- a/app/Console/Commands/CleanupTempFiles.php
+++ /dev/null
@@ -1,46 +0,0 @@
- $keepTime) {
- unlink($filename);
- $deletedFileCount++;
- }
- }
-
- $this->comment('Deleted ' . $deletedFileCount . ' files');
- }
-}
diff --git a/app/Console/Commands/RemoveStaleMediaJobs.php b/app/Console/Commands/RemoveStaleMediaJobs.php
deleted file mode 100644
index 48aee29..0000000
--- a/app/Console/Commands/RemoveStaleMediaJobs.php
+++ /dev/null
@@ -1,42 +0,0 @@
-subHours(48);
-
- $staleJobs = MediaJob::where('updated_at', '<=', $threshold)->get();
-
- foreach ($staleJobs as $job) {
- $job->delete();
- }
-
- $this->info(count($staleJobs) . ' stale media_jobs removed.');
- }
-}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
deleted file mode 100644
index 61d0d1a..0000000
--- a/app/Console/Kernel.php
+++ /dev/null
@@ -1,34 +0,0 @@
-command('inspire')->hourly();
- $schedule->command('app:cleanup-temp-files')->everyThirtyMinutes();
- $schedule->command('app:remove-stale-media-jobs')->everyThirtyMinutes();
- }
-
- /**
- * Register the commands for the application.
- *
- * @return void
- */
- protected function commands(): void
- {
- $this->load(__DIR__ . '/Commands');
-
- require base_path('routes/console.php');
- }
-}
diff --git a/app/Enum/CurlErrorCodes.php b/app/Enum/CurlErrorCodes.php
deleted file mode 100644
index 9429f13..0000000
--- a/app/Enum/CurlErrorCodes.php
+++ /dev/null
@@ -1,169 +0,0 @@
- 'Unsupported protocol.',
- 2 => 'Failed initalization.',
- 3 => 'Invalid URL format.',
- 4 => 'CURLE_URL_MALFORMAT_USER.',
- 5 => 'Could not resolve proxy.',
- 6 => 'Could not resolve host.',
- 7 => 'Could not connect to host.',
- 8 => 'Invalid reply from FTP server.',
- 9 => 'Access denied on host.',
- 11 => 'Invalid pass reply from FTP server.',
- 13 => 'Invalid pasv reply from FTP server.',
- 14 => 'Invalid 227 format from FTP server.',
- 15 => 'Could not get FTP host.',
- 17 => 'Could not set type for FTP transfer.',
- 18 => 'Invalid partial size.',
- 19 => 'Could not retrieve file from FTP server.',
- 21 => 'Quote error.',
- 22 => 'HTTP server returned error.',
- 23 => 'File write error.',
- 25 => 'Upload file error.',
- 26 => 'File read error.',
- 27 => 'Out of memory.',
- 28 => 'File transfer timed out.',
- 30 => 'Invalid port for FTP server.',
- 31 => 'Could not use rest for FTP server.',
- 33 => 'File range error.',
- 34 => 'Invalid POST for HTTP server.',
- 35 => 'SSL connectio error.',
- 36 => 'Invalid resume download.',
- 37 => 'Could not read file.',
- 38 => 'Could not bind to LDAP.',
- 39 => 'LDAP search failed.',
- 41 => 'Function not found.',
- 42 => 'Aborted by callback.',
- 43 => 'Bad function argument.',
- 45 => 'Interface failed.',
- 47 => 'Too many redirects.',
- 48 => 'Unknown telnet option.',
- 49 => 'Telnet option syntax invalid.',
- 51 => 'Peer failed verification.',
- 52 => 'Did not receive any data.',
- 53 => 'SSL engine was not found.',
- 54 => 'SSL engine failed.',
- 55 => 'Send data error.',
- 56 => 'Receive data error.',
- 58 => 'SSL certificate error.',
- 59 => 'SSL cipher error.',
- 60 => 'SSL CACertificate failed.',
- 61 => 'Invalid content encoding.',
- 62 => 'Invalid LDAP url.',
- 63 => 'Filesize exceeded.',
- 64 => 'SSL Failed.',
- 65 => 'CURLE_SEND_FAIL_REWIND.',
- 66 => 'SSL engine initalization failed.',
- 67 => 'CURLE_LOGIN_DENIED.',
- 68 => 'CURLE_TFTP_NOTFOUND.',
- 69 => 'CURLE_TFTP_PERM.',
- 70 => 'CURLE_REMOTE_DISK_FULL.',
- 71 => 'CURLE_TFTP_ILLEGAL.',
- 72 => 'CURLE_TFTP_UNKNOWNID.',
- 73 => 'Remote file already exists.',
- 74 => 'No such user on FTP server.',
- 75 => 'Conversion failed.',
- 76 => 'Conversion required.',
- 77 => 'SSL CACertificate bad file.',
- 78 => 'Remove file not found.',
- 79 => 'SSH error.',
- 80 => 'SSL Shutdown failed.',
- 81 => 'Again.',
- 82 => 'SSL bad CRL file.',
- 83 => 'SSL issuer error.',
- 84 => 'FTP pret failed.',
- 85 => 'CURLE_RTSP_CSEQ_ERROR.',
- 86 => 'CURLE_RTSP_SESSION_ERROR.',
- 87 => 'CURLE_FTP_BAD_FILE_LIST.',
- 88 => 'CURLE_CHUNK_FAILED.',
-
-
- ];
-}
diff --git a/app/Enum/Enum.php b/app/Enum/Enum.php
deleted file mode 100644
index 9217845..0000000
--- a/app/Enum/Enum.php
+++ /dev/null
@@ -1,73 +0,0 @@
->
- */
- public static $messages = [];
-
- /**
- * Caches reflections of enum subclasses.
- *
- * @var array, ReflectionClass>
- */
- public static $reflectionCache = [];
-
-
- /**
- * Returns a reflection of the enum subclass.
- *
- * @return ReflectionClass
- */
- public static function getReflection(): ReflectionClass
- {
- $class = static::class;
-
- return static::$reflectionCache[$class] ??= new ReflectionClass($class);
- }
-
-
- /**
- * Returns the constants in the enum subclass
- *
- * @return array
- */
- public static function getConstants(): array
- {
- return static::getReflection()->getConstants();
- }
-
-
- /**
- * Returns the constants values in the enum subclass
- *
- * @return array
- */
- public static function getConstantValues(): array
- {
- return array_values(static::getReflection()->getConstants());
- }
-
- /**
- * Returns a message from the enum subclass
- *
- * @param integer $messageIndex The message index to retrieve.
- * @param string $defaultMessage Message to use if index does not exist.
- * @return string
- */
- public static function getMessage(int $messageIndex, string $defaultMessage = 'Unknown'): string
- {
- if (array_key_exists($messageIndex, self::$messages) === true) {
- return self::$messages[$messageIndex];
- }
-
- return $defaultMessage;
- }
-}
diff --git a/app/Enum/HttpResponseCodes.php b/app/Enum/HttpResponseCodes.php
deleted file mode 100644
index 73513b5..0000000
--- a/app/Enum/HttpResponseCodes.php
+++ /dev/null
@@ -1,165 +0,0 @@
- 'Continue.',
- 101 => 'Switching Protocols.',
- 102 => 'Processing.',
- // RFC2518
- 200 => 'OK.',
- 201 => 'Created.',
- 202 => 'Accepted.',
- 203 => 'Non-Authoritative Information.',
- 204 => 'No Content.',
- 205 => 'Reset Content.',
- 206 => 'Partial Content.',
- 207 => 'Multi-Status.',
- // RFC4918
- 208 => 'Already Reported.',
- // RFC5842
- 226 => 'IM Used.',
- // RFC3229
- 300 => 'Multiple Choices.',
- 301 => 'Moved Permanently.',
- 302 => 'Found.',
- 303 => 'See Other.',
- 304 => 'Not Modified.',
- 305 => 'Use Proxy.',
- 307 => 'Temporary Redirect.',
- 308 => 'Permanent Redirect.',
- // RFC7238
- 400 => 'Bad Request.',
- 401 => 'Unauthorized.',
- 402 => 'Payment Required.',
- 403 => 'Forbidden.',
- 404 => 'Not Found.',
- 405 => 'Method Not Allowed.',
- 406 => 'Not Acceptable.',
- 407 => 'Proxy Authentication Required.',
- 408 => 'Request Timeout.',
- 409 => 'Conflict.',
- 410 => 'Gone.',
- 411 => 'Length Required.',
- 412 => 'Precondition Failed.',
- 413 => 'Payload Too Large.',
- 414 => 'URI Too Long.',
- 415 => 'Unsupported Media Type.',
- 416 => 'Range Not Satisfiable.',
- 417 => 'Expectation Failed.',
- 418 => 'I\'m a teapot.',
- // RFC2324
- 421 => 'Misdirected Request.',
- // RFC7540
- 422 => 'Unprocessable Entity.',
- // RFC4918
- 423 => 'Locked.',
- // RFC4918
- 424 => 'Failed Dependency.',
- // RFC4918
- 425 => 'Reserved for WebDAV advanced collections expired proposal.',
- // RFC2817
- 426 => 'Upgrade Required.',
- // RFC2817
- 428 => 'Precondition Required.',
- // RFC6585
- 429 => 'Too Many Requests.',
- // RFC6585
- 431 => 'Request Header Fields Too Large.',
- // RFC6585
- 451 => 'Unavailable For Legal Reasons.',
- // RFC7725
- 500 => 'Internal Server Error.',
- 501 => 'Not Implemented.',
- 502 => 'Bad Gateway.',
- 503 => 'Service Unavailable.',
- 504 => 'Gateway Timeout.',
- 505 => 'HTTP Version Not Supported.',
- 506 => 'Variant Also Negotiates.',
- // RFC2295
- 507 => 'Insufficient Storage.',
- // RFC4918
- 508 => 'Loop Detected.',
- // RFC5842
- 510 => 'Not Extended.',
- // RFC2774
- 511 => 'Network Authentication Required.',
- // RFC6585
- ];
-}
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
deleted file mode 100644
index 74672f9..0000000
--- a/app/Exceptions/Handler.php
+++ /dev/null
@@ -1,98 +0,0 @@
-
- */
- protected $dontFlash = [
- 'current_password',
- 'password',
- 'password_confirmation',
- ];
-
-
- /**
- * Register the exception handling callbacks for the application.
- *
- * @return void
- */
- public function register(): void
- {
- // $this->renderable(function (HttpException $e, $request) {
- // if ($request->is('api/*')) {
- // $message = $e->getMessage();
- // if ($message === '') {
- // $message = HttpResponseCodes::$statusTexts[$e->getStatusCode()];
- // }
-
- // return response()->json([
- // 'message' => $message
- // ], $e->getStatusCode());
- // }
- // });
-
- $this->renderable(function (NotFoundHttpException $e, $request) {
- if ($request->is('api/*') === true) {
- return response()->json([
- 'message' => 'Resource not found'
- ], 404);
- }
- });
-
- $this->renderable(function (PDOException $e, $request) {
- if ($request->is('api/*') === true) {
- return response()->json([
- 'message' => 'The server is currently unavailable'
- ], 503);
- }
- });
-
- $this->reportable(function (Throwable $e) {
- if ($this->shouldReport($e) === true) {
- if (App::runningUnitTests() === false) {
- $this->sendEmail($e);
- }
- }
- });
- }
-
- /**
- * Send email
- *
- * @param Throwable $exception Throwable object.
- * @return void
- */
- public function sendEmail(Throwable $exception)
- {
- try {
- $e = FlattenException::createFromThrowable($exception);
- $handler = new HtmlErrorRenderer(true);
- $css = $handler->getStylesheet();
- $content = $handler->getBody($e);
-
- Mail::send('emails.exception', compact('css', 'content'), function ($message) {
- $message
- ->to('webmaster@stemmechanics.com.au')
- ->subject('Exception Generated')
- ;
- });
- } catch (Throwable $ex) {
- Log::error($ex);
- }
- }
-}
diff --git a/app/Exceptions/MediaServiceException.php b/app/Exceptions/MediaServiceException.php
new file mode 100644
index 0000000..e0183a6
--- /dev/null
+++ b/app/Exceptions/MediaServiceException.php
@@ -0,0 +1,37 @@
+message = $message;
+ $this->code = $code;
+
+ parent::__construct($message, $code);
+ }
+}
diff --git a/app/Filters/SubscriptionFilter.php b/app/Filters/SubscriptionFilter.php
deleted file mode 100644
index 8e210d2..0000000
--- a/app/Filters/SubscriptionFilter.php
+++ /dev/null
@@ -1,30 +0,0 @@
-hasPermission('admin/users') !== true) {
- return ['id', 'email', 'confirmed_at'];
- }
- }
-}
diff --git a/app/Helpers.php b/app/Helpers.php
new file mode 100644
index 0000000..e7ee83f
--- /dev/null
+++ b/app/Helpers.php
@@ -0,0 +1,173 @@
+ 1024; $i++) {
+ $bytes /= 1024;
+ }
+ return round($bytes, 2) . ' ' . $units[$i];
+ }
+
+ public static function arrayToString(array $array, string $separator = ','): string
+ {
+ return implode($separator, array_map(function ($item) use ($separator) {
+ if (str_contains($item, $separator)) {
+ return '"' . str_replace('"', '\\"', $item) . '"';
+ } else {
+ return $item;
+ }
+ }, $array));
+ }
+
+ public static function stringToArray(string $string, string $separator = ','): array
+ {
+ return array_map(function ($item) {
+ // Remove quotes and unescape any escaped quotes within the string
+ return str_replace('\\"', '"', trim($item, '"'));
+ }, explode($separator, $string));
+ }
+
+ public static function timestampNoSeconds(string $timestamp): string
+ {
+ if(empty($timestamp)) {
+ return '';
+ }
+
+ $datetime = new DateTime($timestamp);
+ return $datetime->format('Y-m-d\TH:i');
+ }
+
+ public static function isUnderAge(mixed $ages): bool
+ {
+ if(!is_string($ages)) {
+ return true;
+ }
+
+ preg_match('/\d+/', $ages, $matches);
+ if (empty($matches)) {
+ return true;
+ }
+
+ $firstNumber = $matches[0];
+ return ($firstNumber <= 8);
+ }
+
+ public static function createTimeDurationStr(string $startStr, string $endStr): array
+ {
+ try {
+ $start = new DateTime($startStr);
+ $end = new DateTime($endStr);
+
+ if ($start->format('Y-m-d') === $end->format('Y-m-d')) {
+ return [
+ $start->format('l j M Y'),
+ $start->format('g:i a') . ' - ' . $end->format('g:i a')
+ ];
+ } else {
+ return [
+ $start->format('D j/m/Y') . ' - ' . $end->format('D j/m/Y')
+ ];
+ }
+ } catch(\Exception $e) {
+ return ['Error parsing date'];
+ }
+ }
+
+ public static function matchesMimeType(string $mimeType, string|array $patterns): bool
+ {
+ if (is_string($patterns)) {
+ $patterns = [$patterns];
+ }
+
+ foreach ($patterns as $pattern) {
+ $pattern = str_replace('\*', '.*', preg_quote($pattern, '/'));
+ $regex = '/^' . $pattern . '$/';
+ if (preg_match($regex, $mimeType) === 1) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static function findMatchingMimeTypeKey(string $mimeType, array $patterns): string|bool
+ {
+ $match = '';
+
+ foreach ($patterns as $key => $value) {
+ $keys = explode(',', $key);
+ foreach($keys as $key) {
+ $pattern = str_replace('\*', '.*', preg_quote($key, '/'));
+ $regex = '/^' . $pattern . '$/';
+ if (preg_match($regex, $mimeType) === 1) {
+ if($match !== $mimeType) {
+ $match = $key;
+ }
+ }
+ }
+ }
+
+ if($match !== '') {
+ return $match;
+ }
+
+ return false;
+ }
+
+ public static function cleanFileName(string $name): string
+ {
+ $name = strtolower($name);
+ $name = mb_ereg_replace('/^\.+/', '', $name);
+ $name = mb_ereg_replace("([\s_])", '-', $name);
+ $name = mb_ereg_replace("([^\w\s\d\-_.])", '', $name);
+ $name = mb_ereg_replace("([\.]{2,})", '', $name);
+ $name = mb_ereg_replace("([\-]{2,})", '-', $name);
+
+ return $name;
+ }
+}
diff --git a/app/Helpers/Array.php b/app/Helpers/Array.php
deleted file mode 100644
index 76e0103..0000000
--- a/app/Helpers/Array.php
+++ /dev/null
@@ -1,78 +0,0 @@
- $directory,
- 'basename' => $name . ($extension !== '' ? ".{$extension}" : ''),
- 'filename' => $name,
- 'extension' => $extension,
- 'part' => $part,
- ];
-}
-
-/**
- * Check a temporary file exists.
- *
- * @param string $dir The file parent directory.
- * @param string $name The file name.
- * @param string $extension The file extension to use.
- * @param string $part The file part number.
- * @return boolean If the file exists.
- */
-function tempFileExists(string $dir, string $name, string $extension = '', string $part = ''): bool
-{
- $filename = constructTempFileName($dir, $name, $extension, $part);
- $exists = file_exists($filename);
-
- return $exists;
-}
-
-/**
- * Construct the temp file name based on the information
- *
- * @param string $dir The file parent directory.
- * @param string $name The file name.
- * @param string $extension The file extension to use.
- * @param string $part The file part number.
- * @return string The file path.
- */
-function constructTempFileName(string $dir, string $name, string $extension = '', string $part = ''): string
-{
- $filename = $dir . DIRECTORY_SEPARATOR . $name . ($extension !== '' ? ".{$extension}" : '') .
- ($part !== "" ? ".part-{$part}" : '');
-
- return $filename;
-}
diff --git a/app/Helpers/TypeValue.php b/app/Helpers/TypeValue.php
deleted file mode 100644
index fac3573..0000000
--- a/app/Helpers/TypeValue.php
+++ /dev/null
@@ -1,27 +0,0 @@
-all(), [
+ 'firstname' => 'required',
+ 'surname' => 'required',
+ 'email' => 'required|email',
+ 'phone' => 'required',
+
+ 'home_address' => 'required_with:home_city,home_postcode,home_country,home_state',
+ 'home_city' => 'required_with:home_address,home_postcode,home_country,home_state',
+ 'home_postcode' => 'required_with:home_address,home_city,home_country,home_state',
+ 'home_country' => 'required_with:home_address,home_city,home_postcode,home_state',
+ 'home_state' => 'required_with:home_address,home_city,home_postcode,home_country',
+
+ 'billing_address' => 'required_with:billing_city,billing_postcode,billing_country,billing_state',
+ 'billing_city' => 'required_with:billing_address,billing_postcode,billing_country,billing_state',
+ 'billing_postcode' => 'required_with:billing_address,billing_city,billing_country,billing_state',
+ 'billing_country' => 'required_with:billing_address,billing_city,billing_postcode,billing_state',
+ 'billing_state' => 'required_with:billing_address,billing_city,billing_postcode,billing_country',
+ ], [
+ 'firstname.required' => __('validation.custom_messages.firstname_required'),
+ 'surname.required' => __('validation.custom_messages.surname_required'),
+ 'email.required' => __('validation.custom_messages.email_required'),
+ 'email.email' => __('validation.custom_messages.email_invalid'),
+ 'phone.required' => __('validation.custom_messages.phone_required'),
+
+ 'home_address.required' => __('validation.custom_messages.home_address_required'),
+ 'home_city.required' => __('validation.custom_messages.home_city_required'),
+ 'home_postcode.required' => __('validation.custom_messages.home_postcode_required'),
+ 'home_country.required' => __('validation.custom_messages.home_country_required'),
+ 'home_state.required' => __('validation.custom_messages.home_state_required'),
+
+ 'billing_address.required' => __('validation.custom_messages.billing_address_required'),
+ 'billing_city.required' => __('validation.custom_messages.billing_city_required'),
+ 'billing_postcode.required' => __('validation.custom_messages.billing_postcode_required'),
+ 'billing_country.required' => __('validation.custom_messages.billing_country_required'),
+ 'billing_state.required' => __('validation.custom_messages.billing_state_required'),
+ ]);
+
+ if ($validator->fails()) {
+ return redirect()->back()->withErrors($validator)->withInput();
+ }
+
+ $user = auth()->user();
+ $userData = $request->all();
+
+ $newEmail = $userData['email'];
+ unset($userData['email']);
+
+ if ($user->email !== $newEmail) {
+ if(User::where('email', $request->get('email'))->exists()) {
+ $validator->errors()->add('email', __('validation.custom_messages.email_exists'));
+ return redirect()->back()->withErrors($validator)->withInput();
+ }
+
+ $token = Str::random(60);
+ $user->emailUpdate()->delete();
+ $emailUpdate = $user->emailUpdate()->create([
+ 'email' => $newEmail,
+ 'token' => $token
+ ]);
+
+ dispatch(new SendEmail($user->email, new EmailUpdateLink($token, $user->getName(), $user->email, $newEmail)))->onQueue('mail');
+ }
+
+ $userData['subscribed'] = ($request->get('subscribed', false) === 'on');
+ $user->update($userData);
+ $user->save();
+
+ session()->flash('message', 'Your account details have been saved');
+ session()->flash('message-title', 'Details updated');
+ session()->flash('message-type', 'success');
+ return redirect()->back();
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ */
+ public function destroy()
+ {
+ /** @var User $user */
+ $user = auth()->user();
+ auth()->logout();
+
+ $user->delete();
+
+ session()->flash('message', 'Your account has been deleted');
+ session()->flash('message-title', 'Account Deleted');
+ session()->flash('message-type', 'success');
+ return redirect()->route('index');
+ }
+}
diff --git a/app/Http/Controllers/Api/AnalyticsController.php b/app/Http/Controllers/Api/AnalyticsController.php
deleted file mode 100644
index 003b50e..0000000
--- a/app/Http/Controllers/Api/AnalyticsController.php
+++ /dev/null
@@ -1,121 +0,0 @@
-middleware('auth:sanctum')
- ->only([
- 'index',
- 'update',
- 'delete'
- ]);
- }
-
- /**
- * Display a listing of the resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @return \Illuminate\Http\Response
- */
- public function index(Request $request)
- {
- if ($request->user() !== null && $request->user()?->hasPermission('admin/analytics') === true) {
- $request->rename([
- 'type' => 'requests.type',
- 'path' => 'requests.path'
- ]);
-
- list($collection, $total) = AnalyticsConductor::request($request);
-
- return $this->respondAsResource(
- $collection,
- ['resourceName' => 'session',
- 'isCollection' => true,
- 'appendData' => ['total' => $total]
- ]
- );
- }//end if
-
- return $this->respondForbidden();
- }
-
- /**
- * Display the specified resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\AnalyticsSession $session The analytics session.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, AnalyticsSession $session)
- {
- if ($request->user() !== null && $request->user()?->hasPermission('admin/analytics') === true) {
- $session->load(['requests' => function ($query) {
- $query->select('session_id', 'type', 'path', 'created_at');
- }
- ]);
-
- foreach ($session->requests as $requestItem) {
- $requestItem->makeHidden('session_id');
- }
-
- return $this->respondAsResource(
- $session,
- ['resourceName' => 'session']
- );
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Store a newly created resource in storage.
- *
- * @param \App\Http\Requests\AnalyticsRequest $request The user request.
- * @return \Illuminate\Http\Response
- */
- public function store(AnalyticsRequest $request)
- {
- if (AnalyticsConductor::creatable() === true) {
- $analytics = null;
- $user = $request->user();
-
- $data = [
- 'type' => $request->input('type'),
- 'path' => $request->input('path', ''),
- 'useragent' => $request->userAgent(),
- 'ip' => $request->ip()
- ];
-
- if (
- $user !== null &&
- $user->hasPermission('admin/analytics') === true &&
- $request->has('session') === true
- ) {
- $data['session_id'] = $request->input('session_id');
- $analytics = AnalyticsItemRequest::create($data);
- } else {
- $analytics = AnalyticsItemRequest::create($data);
- }
-
- return $this->respondAsResource(
- AnalyticsConductor::model($request, $analytics),
- ['respondCode' => HttpResponseCodes::HTTP_CREATED]
- );
- } else {
- return $this->respondForbidden();
- }//end if
- }
-}
diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php
deleted file mode 100644
index d51842b..0000000
--- a/app/Http/Controllers/Api/ApiController.php
+++ /dev/null
@@ -1,243 +0,0 @@
-json($data, $respondCode, $headers);
- }
-
- /**
- * Return forbidden message
- *
- * @param string $message Response message.
- * @return JsonResponse
- */
- public function respondForbidden(
- string $message = 'You do not have permission to access the resource.'
- ): JsonResponse {
- return response()->json(['message' => $message], HttpResponseCodes::HTTP_FORBIDDEN);
- }
-
- /**
- * Return forbidden message
- *
- * @param string $message Response message.
- * @return JsonResponse
- */
- public function respondNotFound(string $message = 'The resource was not found.'): JsonResponse
- {
- return response()->json(['message' => $message], HttpResponseCodes::HTTP_NOT_FOUND);
- }
-
- /**
- * Return too large message
- *
- * @param string $message Response message.
- * @return JsonResponse
- */
- public function respondTooLarge(string $message = 'The request entity is too large.'): JsonResponse
- {
- return response()->json(['message' => $message], HttpResponseCodes::HTTP_REQUEST_ENTITY_TOO_LARGE);
- }
-
- /**
- * Return no content.
- *
- * @return JsonResponse
- */
- public function respondNoContent(): JsonResponse
- {
- return response()->json([], HttpResponseCodes::HTTP_NO_CONTENT);
- }
-
- /**
- * Return no content
- *
- * @return JsonResponse
- */
- public function respondNotImplemented(): JsonResponse
- {
- return response()->json([], HttpResponseCodes::HTTP_NOT_IMPLEMENTED);
- }
-
- /**
- * Return created.
- *
- * @return JsonResponse
- */
- public function respondCreated(): JsonResponse
- {
- return response()->json([], HttpResponseCodes::HTTP_CREATED);
- }
-
- /**
- * Return accepted.
- *
- * @return JsonResponse
- */
- public function respondAccepted(): JsonResponse
- {
- return response()->json([], HttpResponseCodes::HTTP_ACCEPTED);
- }
-
- /**
- * Return server error.
- *
- * @return JsonResponse
- */
- public function respondServerError(): JsonResponse
- {
- return response()->json([], HttpResponseCodes::HTTP_INTERNAL_SERVER_ERROR);
- }
-
- /**
- * Return single error message
- *
- * @param string $message Error message.
- * @param integer $responseCode Resource code.
- * @return JsonResponse
- */
- public function respondError(
- string $message,
- int $responseCode = HttpResponseCodes::HTTP_UNPROCESSABLE_ENTITY
- ): JsonResponse {
- return response()->json([
- 'message' => $message
- ], $responseCode);
- }
-
- /**
- * Return formatted errors
- *
- * @param array $errors Error messages.
- * @param integer $responseCode Resource code.
- * @return JsonResponse
- */
- public function respondWithErrors(
- array $errors,
- int $responseCode = HttpResponseCodes::HTTP_UNPROCESSABLE_ENTITY
- ): JsonResponse {
- $keys = array_keys($errors);
- $error = $errors[$keys[0]];
-
- if (count($keys) > 1) {
- $additional_errors = (count($keys) - 1);
- $error .= sprintf(' (and %d more %s', $additional_errors, Str::plural('error', $additional_errors));
- }
-
- return response()->json([
- 'message' => $error,
- 'errors' => $errors
- ], $responseCode);
- }
-
- /**
- * Return resource data
- *
- * @param array|Model|Collection $data Resource data.
- * @param array $options Respond options.
- * @param callable|null $validationFn Optional validation function to check the data before responding.
- * @return JsonResponse
- */
- protected function respondAsResource(
- mixed $data,
- array $options = [],
- $validationFn = null
- ): JsonResponse {
- $isCollection = ($options['isCollection'] ?? false);
- $appendData = ($options['appendData'] ?? null);
- $resourceName = ($options['resourceName'] ?? '');
- $transformResourceName = ($options['transformResourceName'] ?? true);
- $respondCode = ($options['respondCode'] ?? HttpResponseCodes::HTTP_OK);
-
- if ($data === null || ($data instanceof Collection && $data->count() === 0)) {
- $validationData = [];
- if (array_key_exists('appendData', $options) === true) {
- $validationData = $options['appendData'];
- }
-
- if ($validationFn === null || $validationFn($validationData) === true) {
- return $this->respondNotFound();
- }
- }
-
- if (empty($resourceName) === true) {
- $resourceName = $this->resourceName;
- }
-
- if (empty($resourceName) === true) {
- $resourceName = get_class($this);
- $resourceName = substr($resourceName, (strrpos($resourceName, '\\') + 1));
- $resourceName = substr($resourceName, 0, strpos($resourceName, 'Controller'));
- $resourceName = strtolower($resourceName);
- }
-
- $dataArray = [];
- if ($data instanceof Collection) {
- $dataArray = $data->toArray();
- } elseif (is_array($data) === true) {
- $dataArray = $data;
- } elseif ($data instanceof Model) {
- $dataArray = $data->toArray();
- }
-
- $resource = [];
- if ($isCollection === true) {
- $resource = [$transformResourceName === true ? Str::plural($resourceName) : $resourceName => $dataArray];
- } else {
- $resource = [$transformResourceName === true ? Str::singular($resourceName) : $resourceName => $dataArray];
- }
-
- if ($appendData !== null) {
- $resource += $appendData;
- }
-
- return response()->json($resource, $respondCode);
- }
-
- /**
- * Get the Controller Model Class name.
- *
- * @return string
- */
- public function getModelClass(): string
- {
- $controllerClass = static::class;
-
- $modelName = 'App\\Models\\' . Str::replaceLast('Controller', '', Str::afterLast($controllerClass, '\\'));
-
- if (class_exists($modelName) === false) {
- return $modelName;
- }
-
- return $modelName;
- }
-}
diff --git a/app/Http/Controllers/Api/ArticleController.php b/app/Http/Controllers/Api/ArticleController.php
deleted file mode 100644
index dd98184..0000000
--- a/app/Http/Controllers/Api/ArticleController.php
+++ /dev/null
@@ -1,139 +0,0 @@
-middleware('auth:sanctum')
- ->only([
- 'store',
- 'update',
- 'delete'
- ]);
- }
-
- /**
- * Display a listing of the resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @return \Illuminate\Http\Response
- */
- public function index(Request $request)
- {
- list($collection, $total) = ArticleConductor::request($request);
-
- return $this->respondAsResource(
- $collection,
- ['isCollection' => true,
- 'appendData' => ['total' => $total]
- ]
- );
- }
-
- /**
- * Display the specified resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\Article $article The article model.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, Article $article)
- {
- if (ArticleConductor::viewable($article) === true) {
- return $this->respondAsResource(ArticleConductor::model($request, $article));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Store a newly created resource in storage.
- *
- * @param \App\Http\Requests\ArticleRequest $request The user request.
- * @return \Illuminate\Http\Response
- */
- public function store(ArticleRequest $request)
- {
- if (ArticleConductor::creatable() === true) {
- $article = Article::create($request->except(['attachments', 'gallery']));
-
- if ($request->has('attachments') === true) {
- $article->addAttachments($request->get('attachments'));
- }
-
- if ($request->has('gallery') === true) {
- $article->galleryAddMany($request->get('gallery'));
- }
-
- return $this->respondAsResource(
- ArticleConductor::model($request, $article),
- ['respondCode' => HttpResponseCodes::HTTP_CREATED]
- );
- } else {
- return $this->respondForbidden();
- }//end if
- }
-
- /**
- * Update the specified resource in storage.
- *
- * @param \App\Http\Requests\ArticleRequest $request The article update request.
- * @param \App\Models\Article $article The specified article.
- * @return \Illuminate\Http\Response
- */
- public function update(ArticleRequest $request, Article $article)
- {
- if (ArticleConductor::updatable($article) === true) {
- if ($request->has('attachments') === true) {
- $article->deleteAttachments();
- $article->addAttachments($request->get('attachments'));
- }
-
- if ($request->has('gallery') === true) {
- $article->gallery()->delete();
- $article->galleryAddMany($request->get('gallery'));
- }
-
- $article->update($request->except(['attachments', 'gallery']));
- return $this->respondAsResource(ArticleConductor::model($request, $article));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Remove the specified resource from storage.
- *
- * @param \App\Models\Article $article The specified article.
- * @return \Illuminate\Http\Response
- */
- public function destroy(Article $article)
- {
- if (ArticleConductor::destroyable($article) === true) {
- $article->delete();
- return $this->respondNoContent();
- } else {
- return $this->respondForbidden();
- }
- }
-}
diff --git a/app/Http/Controllers/Api/AuthController.php b/app/Http/Controllers/Api/AuthController.php
deleted file mode 100644
index 0fe1851..0000000
--- a/app/Http/Controllers/Api/AuthController.php
+++ /dev/null
@@ -1,105 +0,0 @@
-middleware('auth:sanctum')
- // ->only(['me']);
- }
-
- /**
- * Current User details
- *
- * @param Request $request Current request data.
- * @return JsonResponse
- */
- public function me(Request $request): JsonResponse
- {
- $user = $request->user()->makeVisible(['permissions']);
- return $this->respondAsResource($user);
- }
-
- /**
- * Login user with supplied creditials
- *
- * @param App\Http\Controllers\Api\AuthLoginRequest $request Created request data.
- * @return JsonResponse|void
- */
- public function login(AuthLoginRequest $request)
- {
- $user = User::where('email', '=', $request->input('email'))->first();
-
- if (
- $user !== null &&
- strlen($user->password) > 0 &&
- Hash::check($request->input('password'), $user->password) === true
- ) {
- if ($user->email_verified_at === null) {
- return $this->respondWithErrors([
- 'email' => 'Email address has not been verified.'
- ]);
- }
-
- if ($user->disabled === true) {
- return $this->respondWithErrors([
- 'email' => 'Account has been disabled.'
- ]);
- }
-
- $token = $user->createToken('user_token')->plainTextToken;
-
- $user->logins()->create([
- 'token' => $token,
- 'login' => now(),
- 'ip_address' => $request->ip(),
- 'user_agent' => $request->userAgent()
- ]);
-
- return $this->respondAsResource(
- $user->makeVisible(['permissions']),
- ['appendData' => ['token' => $token]]
- );
- }//end if
-
- return $this->respondWithErrors([
- 'email' => 'Invalid email or password',
- 'password' => 'Invalid email or password',
- ]);
- }
-
- /**
- * Logout current user
- *
- * @param Request $request Current request data.
- * @return JsonResponse
- */
- public function logout(Request $request): JsonResponse
- {
- $user = $request->user();
-
- $user->logins()->where('token', $user->currentAccessToken())->update(['logout' => now()]);
- $user->currentAccessToken()->delete();
-
- return $this->respondNoContent();
- }
-}
diff --git a/app/Http/Controllers/Api/ContactController.php b/app/Http/Controllers/Api/ContactController.php
deleted file mode 100644
index 85d65fb..0000000
--- a/app/Http/Controllers/Api/ContactController.php
+++ /dev/null
@@ -1,30 +0,0 @@
-input('name'),
- $request->input('email'),
- $request->input('content')
- )
- )))->onQueue('mail');
-
- return $this->respondCreated();
- }
-}
diff --git a/app/Http/Controllers/Api/EventController.php b/app/Http/Controllers/Api/EventController.php
deleted file mode 100644
index 31b562c..0000000
--- a/app/Http/Controllers/Api/EventController.php
+++ /dev/null
@@ -1,234 +0,0 @@
-middleware('auth:sanctum')
- ->only(['store','update','destroy', 'userAdd', 'userUpdate', 'userDelete']);
- }
-
- /**
- * Display a listing of the resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @return \Illuminate\Http\Response
- */
- public function index(Request $request)
- {
- list($collection, $total) = EventConductor::request($request);
-
- return $this->respondAsResource(
- $collection,
- ['isCollection' => true,
- 'appendData' => ['total' => $total]
- ]
- );
- }
-
- /**
- * Display the specified resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\Event $event The specified event.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, Event $event)
- {
- if (EventConductor::viewable($event) === true) {
- return $this->respondAsResource(EventConductor::model($request, $event));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Store a newly created resource in storage.
- *
- * @param \App\Http\Requests\EventRequest $request The request.
- * @return \Illuminate\Http\Response
- */
- public function store(EventRequest $request)
- {
- if (EventConductor::creatable() === true) {
- $event = Event::create($request->except(['attachments']));
-
- if ($request->has('attachments') === true) {
- $event->addAttachments($request->get('attachments'));
- }
-
- return $this->respondAsResource(
- EventConductor::model($request, $event),
- ['respondCode' => HttpResponseCodes::HTTP_CREATED]
- );
- } else {
- return $this->respondForbidden();
- }
- }
-
- /**
- * Update the specified resource in storage.
- *
- * @param \App\Http\Requests\EventRequest $request The endpoint request.
- * @param \App\Models\Event $event The specified event.
- * @return \Illuminate\Http\Response
- */
- public function update(EventRequest $request, Event $event)
- {
- if (EventConductor::updatable($event) === true) {
- if ($request->has('attachments') === true) {
- $event->deleteAttachments();
- $event->addAttachments($request->get('attachments'));
- }
-
- $event->update($request->except(['attachments']));
- return $this->respondAsResource(EventConductor::model($request, $event));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Remove the specified resource from storage.
- *
- * @param \App\Models\Event $event The specified event.
- * @return \Illuminate\Http\Response
- */
- public function destroy(Event $event)
- {
- if (EventConductor::destroyable($event) === true) {
- $event->delete();
- return $this->respondNoContent();
- } else {
- return $this->respondForbidden();
- }
- }
-
- /**
- * List users of Event
- * @param Request $request The HTTP request.
- * @param Event $event Event model.
- * @return JsonResponse
- */
- public function userList(Request $request, Event $event): JsonResponse
- {
- $authUser = $request->user();
- $eventUsers = $event->users;
-
- if ($authUser !== null) {
- $isAdmin = $authUser->hasPermission('admin/events');
- $isEventUser = $eventUsers->contains($authUser->id);
-
- if ($isAdmin === true || $isEventUser === true) {
- if ($isAdmin === false) {
- $eventUsers = $eventUsers->filter(function ($user) use ($authUser) {
- return $user->id === $authUser->id;
- });
- }
-
- return $this->respondAsResource(
- UserConductor::collection($request, $eventUsers),
- [
- 'isCollection' => true,
- 'resourceName' => 'users'
- ]
- );
- }
-
- return $this->respondNotFound();
- }//end if
-
- return $this->respondForbidden();
- }
-
- /**
- * Add user to Event
- * @param Request $request The HTTP request.
- * @param Event $event Event model.
- * @return JsonResponse
- */
- public function userAdd(Request $request, Event $event): JsonResponse
- {
- $authUser = $request->user();
- if ($authUser !== null && $authUser->hasPermission('admin/events') === true) {
- if ($request->has("users") === true) {
- $eventUsers = $event->users()->pluck('user_id')->toArray(); // Get the current users in the event
- $requestedUsers = $request->input("users"); // Get the requested users
-
- $usersToAdd = array_diff($requestedUsers, $eventUsers); // Users to add
- $usersToRemove = array_diff($eventUsers, $requestedUsers); // Users to remove
-
- // Add missing users
- foreach ($usersToAdd as $userToAdd) {
- if (User::find($userToAdd) !== null) {
- $event->users()->attach($userToAdd);
- }
- }
-
- // Remove extra users
- foreach ($usersToRemove as $userToRemove) {
- $event->users()->detach($userToRemove);
- }
-
- return $this->respondNoContent();
- }//end if
-
- return $this->respondWithErrors(['users' => 'The user list was not found']);
- }//end if
-
- return $this->respondForbidden();
- }
-
- /**
- * Update user
- * @param Request $request The HTTP request.
- * @param Event $event Event model.
- * @return void
- */
- public function userUpdate(Request $request, Event $event): void
- {
- // only admin/events permitted
- }
-
- /**
- * Delete user from event
- *
- * @param Request $request The HTTP request.
- * @param Event $event Event model.
- * @param User $user User model.
- * @return JsonResponse
- */
- public function userDelete(Request $request, Event $event, User $user): JsonResponse
- {
- $authUser = $request->user();
- if ($authUser !== null && $authUser->hasPermission('admin/events') === true) {
- $eventUsers = $event->users;
- if ($eventUsers->find($user->id) !== null) {
- $eventUsers->detach($user->id);
- return $this->respondNoContent();
- } else {
- return $this->respondNotFound();
- }
- }
-
- return $this->respondForbidden();
- }
-}
diff --git a/app/Http/Controllers/Api/InfoController.php b/app/Http/Controllers/Api/InfoController.php
deleted file mode 100644
index 964ba6b..0000000
--- a/app/Http/Controllers/Api/InfoController.php
+++ /dev/null
@@ -1,26 +0,0 @@
- "1.0.0",
- "max_upload_size" => Media::getMaxUploadSize()
- ];
-
- return $this->respondJson($info);
- }
-}
diff --git a/app/Http/Controllers/Api/LogController.php b/app/Http/Controllers/Api/LogController.php
deleted file mode 100644
index c81c802..0000000
--- a/app/Http/Controllers/Api/LogController.php
+++ /dev/null
@@ -1,165 +0,0 @@
-middleware('auth:sanctum')
- ->only(['show']);
- }
-
- /**
- * Display the specified resource.
- *
- * @param Request $request The log request.
- * @param string $name The log name.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, string $name)
- {
- if ($request->user()?->hasPermission('logs/' . $name) === true) {
- switch (strtolower($name)) {
- case 'discord':
- $data = [];
-
- $log = $request->get('log');
- if ($log === null) {
- $log = ['output', 'error'];
- } else {
- $log = explode(',', strtolower($log));
- }
-
- $lines = intval($request->get('lines', 50));
- if ($lines > 100) {
- $lines = 100;
- } elseif ($lines < 0) {
- $lines = 1;
- }
-
- $before = $request->get('before');
- if ($before !== null) {
- $before = preg_split(
- "/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/",
- $before,
- -1,
- (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
- );
- if (count($before) !== 6) {
- $before = null;
- }
- }
-
- $after = $request->get('after');
- if ($after !== null) {
- $after = preg_split(
- "/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/",
- $after,
- -1,
- (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
- );
- if (count($after) !== 6) {
- $after = null;
- }
- }
-
- $logFiles = [
- [
- 'name' => 'output',
- 'path' => '/home/discordbot/.pm2/logs/stemmech-discordbot-out-0.log'
- ],[
- 'name' => 'error',
- 'path' => '/home/discordbot/.pm2/logs/stemmech-discordbot-error-0.log'
- ]
- ];
-
- foreach ($logFiles as $logFile) {
- if (in_array($logFile['name'], $log) === true) {
- $logContent = '';
-
- if (file_exists($logFile['path']) === true) {
- $logContent = file_get_contents($logFile['path']);
- }
-
- $logArray = preg_split(
- // phpcs:ignore Generic.Files.LineLength.TooLong
- "/(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}: (?:(?!\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}: )[\s\S])*)/",
- $logContent,
- -1,
- (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
- );
-
- $logContent = '';
- $logLineCount = 0;
- $logLineSkip = false;
- foreach (array_reverse($logArray) as $logLine) {
- $lineDate = preg_split(
- "/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2}): /",
- $logLine,
- -1,
- (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
- );
- if (count($lineDate) >= 6) {
- $logLineSkip = false;
-
- // Is line before
- if (
- $before !== null && (
- $lineDate[0] > $before[0] ||
- $lineDate[1] > $before[1] ||
- $lineDate[2] > $before[2] ||
- $lineDate[3] > $before[3] ||
- $lineDate[4] > $before[4] ||
- $lineDate[5] > $before[5]
- )
- ) {
- $logLineSkip = true;
- continue;
- }
-
- // Is line after
- if (
- $after !== null && (
- $after[0] > $lineDate[0] ||
- $after[1] > $lineDate[1] ||
- $after[2] > $lineDate[2] ||
- $after[3] > $lineDate[3] ||
- $after[4] > $lineDate[4] ||
- $after[5] > $lineDate[5]
- )
- ) {
- $logLineSkip = true;
- continue;
- }
-
- $logLineCount += 1;
- }//end if
-
- if ($logLineCount > $lines) {
- break;
- }
-
- if ($logLineSkip === false) {
- $logContent .= $logLine;
- }
- }//end foreach
-
- $data[$logFile['name']] = $logContent;
- }//end if
- }//end foreach
-
- return $this->respondJson([
- 'log' => $data
- ]);
- }//end switch
- }//end if
-
- return $this->respondForbidden();
- }
-}
diff --git a/app/Http/Controllers/Api/MediaController.php b/app/Http/Controllers/Api/MediaController.php
deleted file mode 100644
index 7e6b87c..0000000
--- a/app/Http/Controllers/Api/MediaController.php
+++ /dev/null
@@ -1,443 +0,0 @@
-middleware('auth:sanctum')
- ->only(['store','update','destroy']);
- }
-
- /**
- * Display a listing of the resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @return \Illuminate\Http\Response
- */
- public function index(Request $request)
- {
- list($collection, $total) = MediaConductor::request($request);
-
- return $this->respondAsResource(
- $collection,
- ['isCollection' => true,
- 'appendData' => ['total' => $total]
- ],
- function ($options) {
- return $options['total'] === 0;
- }
- );
- }
-
- /**
- * Display the specified resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\Media $medium The request media.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, Media $medium)
- {
- if (MediaConductor::viewable($medium) === true) {
- return $this->respondAsResource(MediaConductor::model($request, $medium));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Store a new media resource
- *
- * @param \App\Http\Requests\MediaRequest $request The uploaded media.
- * @return \Illuminate\Http\Response
- */
- public function store(MediaRequest $request)
- {
- // allowed to create a media item
- if (MediaConductor::creatable() === false) {
- return $this->respondForbidden();
- }
-
- // check for file
- $file = $request->file('file');
- if ($file === null) {
- return $this->respondWithErrors(['file' => 'The browser did not upload the file correctly to the server.']);
- }
-
- return $this->storeOrUpdate($request, null);
- }
-
- /**
- * Update the media resource in storage.
- *
- * @param \App\Http\Requests\MediaRequest $request The update request.
- * @param \App\Models\Media $medium The specified media.
- * @return \Illuminate\Http\Response
- */
- public function update(MediaRequest $request, Media $medium)
- {
- // allowed to update a media item
- if (MediaConductor::updatable($medium) === false) {
- return $this->respondForbidden();
- }
-
- return $this->storeOrUpdate($request, $medium);
- }
-
- /**
- * Store a new media resource
- *
- * @param \App\Http\Requests\MediaRequest $request The uploaded media.
- * @param \App\Models\Media|null $medium The specified media.
- * @return \Illuminate\Http\Response
- */
- public function storeOrUpdate(MediaRequest $request, Media|null $medium)
- {
- $file = $request->file('file');
- if ($file !== null) {
- // validate file object
- if ($file->isValid() !== true) {
- switch ($file->getError()) {
- case UPLOAD_ERR_INI_SIZE:
- case UPLOAD_ERR_FORM_SIZE:
- return $this->respondTooLarge();
- case UPLOAD_ERR_PARTIAL:
- return $this->respondWithErrors([$file => 'The file upload was interrupted.']);
- default:
- return $this->respondWithErrors(
- [$file => 'An error occurred uploading the file to the server.']
- );
- }
- }
-
- if ($file->getSize() > Media::getMaxUploadSize()) {
- return $this->respondTooLarge();
- }
- }
-
- // create/get media job
- $mediaJob = null;
- $data = [];
-
- if ($request->missing('job_id') === true) {
- /** @var \App\Models\User */
- $user = auth()->user();
-
- $mediaJob = new MediaJob();
- $mediaJob->user_id = $user->id;
- if ($medium !== null) {
- $mediaJob->media_id = $medium->id;
- }
-
- if ($request->has('title') === true || $file !== null) {
- $data['title'] = $request->get('title', '');
- }
-
- if ($request->has('name') === true || $file !== null) {
- $data['name'] = (
- $request->has('chunk') === true ? $request->get('name', '') : $file->getClientOriginalName()
- );
- }
-
- if ($file !== null) {
- $data['size'] = $request->has('chunk') === true ? intval($request->get('size', 0)) : $file->getSize();
- $data['mime_type'] = (
- $request->has('chunk') === true ? $request->get('mime_type', '') : $file->getMimeType()
- );
- }
-
- if ($request->has('storage') === true || $file !== null) {
- $data['storage'] = $request->get('storage', '');
- }
-
- if ($request->has('security_type') === true || $file !== null) {
- $data['security']['type'] = $request->get('security_type', '');
- $data['security']['data'] = $request->get('security_data', '');
-
- if ($data['security']['type'] === '') {
- $data['security']['data'] = '';
- }
-
- if ($medium === null || strcasecmp($data['security']['type'], $medium->security_type) !== 0) {
- if ($request->has('storage') === false) {
- $mime_type = $request->get('mime_type', $medium === null ? '' : $medium->mime_type);
- $data['storage'] = Media::recommendedStorage($mime_type, $data['security']['type']);
- }
- }
- }
-
- if (
- array_key_exists('storage', $data) === true && (
- array_key_exists('security', $data) === true &&
- array_key_exists('type', $data['security']) === true
- ) &&
- array_key_exists('mime_type', $data) === true &&
- $data['mime_type'] !== ""
- ) {
- $error = Media::verifyStorage($data['mime_type'], $data['security']['type'], $data['storage']);
- // Log::error($data['mime_type'] . ' - ' . $data['security']['type'] . ' - ' . $data['storage']);
- switch ($error) {
- case Media::STORAGE_VALID:
- break;
- case Media::STORAGE_MIME_MISSING:
- return $this->respondWithErrors(['mime_type' => 'The file type is required.']);
- case Media::STORAGE_NOT_FOUND:
- return $this->respondWithErrors(['storage' => 'Storage was not found.']);
- case Media::STORAGE_INVALID_SECURITY:
- return $this->respondWithErrors(
- ['storage' => 'Storage invalid for this security requirement.']
- );
- default:
- return $this->respondWithErrors(['storage' => 'Storage verification error occurred.']);
- }
- }
-
- if ($request->has('transform') === true) {
- $transform = [];
-
- foreach (explode(',', $request->get('transform', '')) as $value) {
- if (is_string($value) === true) {
- if (preg_match('/^rotate-(-?\d+)$/', $value, $matches) !== false) {
- $transform['rotate'] = $matches[1];
- } elseif (preg_match('/^flip-([vh]|vh|hv)$/', $value, $matches) !== false) {
- $transform['flip'] = $matches[1];
- } elseif (preg_match('/^crop-(\d+)-(\d+)$/', $value, $matches) !== false) {
- $transform['crop'] = ['width' => $matches[1], 'height' => $matches[2]];
- } elseif (preg_match('/^crop-(\d+)-(\d+)-(\d+)-(\d+)$/', $value, $matches) !== false) {
- $transform['crop'] = [
- 'width' => $matches[1],
- 'height' => $matches[2],
- 'x' => $matches[3],
- 'y' => $matches[4]
- ];
- }
- }
- }
-
- if (count($transform) > 0) {
- $data['transform'] = $transform;
- }
- }//end if
-
- $mediaJob->setStatusWaiting();
- } else {
- $mediaJob = MediaJob::find($request->get('job_id'));
- if ($mediaJob === null || $mediaJob->exists() === false) {
- $this->respondNotFound();
- }
-
- $data = json_decode($mediaJob->data, true);
- if ($data === null) {
- Log::error(`{$mediaJob->id} contains no data`);
- return $this->respondServerError();
- }
-
- if (array_key_exists('name', $data) === false) {
- Log::error(`{$mediaJob->id} data does not contain the name key`);
- return $this->respondServerError();
- }
- }//end if
-
- if ($mediaJob === null) {
- Log::error(`media job does not exist`);
- return $this->respondServerError();
- }
-
- // save uploaded file
- if ($file !== null) {
- if ($data['name'] === '') {
- Log::error(`filename does not exist`);
- return $this->respondServerError();
- }
-
- $temporaryFilePath = generateTempFilePath(
- pathinfo($data['name'], PATHINFO_EXTENSION),
- $request->get('chunk', '')
- );
- copy($file->path(), $temporaryFilePath);
-
- if ($request->has('chunk') === true) {
- $data['chunks'][$request->get('chunk', '1')] = $temporaryFilePath;
- $data['chunk_count'] = $request->get('chunk_count', 1);
- } else {
- $data['file'] = $temporaryFilePath;
- }
- }
-
- $mediaJob->data = json_encode($data, true);
- $mediaJob->save();
- $mediaJob->process();
-
- return $this->respondAsResource(
- MediaJobConductor::model($request, $mediaJob),
- ['resourceName' => 'media_job', 'respondCode' => HttpResponseCodes::HTTP_ACCEPTED]
- );
- }
-
- /**
- * Remove the specified resource from storage.
- *
- * @param \App\Models\Media $medium Specified media file.
- * @return \Illuminate\Http\Response
- */
- public function destroy(Media $medium)
- {
- if (MediaConductor::destroyable($medium) === true) {
- $medium->delete();
- return $this->respondNoContent();
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Display the specified resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\Media $media Specified media.
- * @return \Illuminate\Http\Response
- */
- public function download(Request $request, Media $media): Response
- {
- $headers = [];
-
- /* Check file exists */
- if (Storage::disk($media->storage)->exists($media->name) === false) {
- return $this->respondNotFound();
- }
-
- $updated_at = Carbon::parse(Storage::disk($media->storage)->lastModified($media->name));
-
- $headerPragma = 'no-cache';
- $headerCacheControl = 'max-age=0, must-revalidate';
- $headerExpires = $updated_at->toRfc2822String();
-
- /* construct user if can */
- $user = $request->user();
- if ($user === null && $request->has('token') === true) {
- $accessToken = PersonalAccessToken::findToken(urldecode($request->input('token')));
-
- if (
- $accessToken !== null && (config('sanctum.expiration') === null ||
- $accessToken->created_at->lte(now()->subMinutes(config('sanctum.expiration'))) === false)
- ) {
- $user = $accessToken->tokenable;
- }
- }
-
- if ($media->security_type === '') {
- /* no security */
- $headerPragma = 'public';
- $headerExpires = $updated_at->addMonth()->toRfc2822String();
- } elseif (strcasecmp('password', $media->security_type) === 0) {
- /* password */
- if (
- ($user === null || $user->hasPermission('admin/media') === false) &&
- ($request->has('password') === false || $request->get('password') !== $media->security_data)
- ) {
- return $this->respondForbidden();
- }
- } elseif (strcasecmp('permission', $media->security_type) === 0) {
- /* permission */
- if (
- $user === null || (
- $user->hasPermission('admin/media') === false &&
- $user->hasPermission($media->security_data) === false
- )
- ) {
- return $this->respondForbidden();
- }
- }//end if
-
- // deepcode ignore InsecureHash: Browsers expect Etag to be a md5 hash
- $headerEtag = md5($updated_at->format('U'));
- $headerLastModified = $updated_at->toRfc2822String();
-
- $headers = [
- 'Cache-Control' => $headerCacheControl,
- 'Content-Disposition' => sprintf('inline; filename="%s"', basename($media->name)),
- 'Etag' => $headerEtag,
- 'Expires' => $headerExpires,
- 'Last-Modified' => $headerLastModified,
- 'Pragma' => $headerPragma,
- ];
-
- $server = request()->server;
-
- $requestModifiedSince = $server->has('HTTP_IF_MODIFIED_SINCE') &&
- $server->get('HTTP_IF_MODIFIED_SINCE') === $headerLastModified;
-
- $requestNoneMatch = $server->has('HTTP_IF_NONE_MATCH') &&
- $server->get('HTTP_IF_NONE_MATCH') === $headerEtag;
-
- if ($requestModifiedSince === true || $requestNoneMatch === true) {
- return response()->make('', 304, $headers);
- }
-
- $headers['Content-Type'] = Storage::disk($media->storage)->mimeType($media->name);
- $headers['Content-Length'] = Storage::disk($media->storage)->size($media->name);
- $headers['Content-Disposition'] = 'attachment; filename="' . basename($media->name) . '"';
-
- $stream = Storage::disk($media->storage)->readStream($media->name);
- return response()->stream(
- function () use ($stream) {
- while (ob_get_level() > 0) {
- ob_end_flush();
- }
- fpassthru($stream);
- },
- 200,
- $headers
- );
- }
-
- /**
- * Validate a File item in a request is valid
- *
- * @param UploadedFile $file The file to validate.
- * @param string $errorKey The error key to use.
- * @return JsonResponse|null
- */
- private function validateFileObject(UploadedFile $file, string $errorKey = 'file'): JsonResponse|null
- {
- if ($file->isValid() !== true) {
- switch ($file->getError()) {
- case UPLOAD_ERR_INI_SIZE:
- case UPLOAD_ERR_FORM_SIZE:
- return $this->respondTooLarge();
- case UPLOAD_ERR_PARTIAL:
- return $this->respondWithErrors([$errorKey => 'The file upload was interrupted.']);
- default:
- return $this->respondWithErrors(
- [$errorKey => 'An error occurred uploading the file to the server.']
- );
- }
- }
-
- if ($file->getSize() > Media::getMaxUploadSize()) {
- return $this->respondTooLarge();
- }
-
- return null;
- }
-}
diff --git a/app/Http/Controllers/Api/MediaJobController.php b/app/Http/Controllers/Api/MediaJobController.php
deleted file mode 100644
index daa1c22..0000000
--- a/app/Http/Controllers/Api/MediaJobController.php
+++ /dev/null
@@ -1,52 +0,0 @@
-respondAsResource(
- $collection,
- ['isCollection' => true,
- 'appendData' => ['total' => $total],
- 'resourceName' => 'media_job'
- ],
- function ($options) {
- return $options['total'] === 0;
- }
- );
- }
-
- /**
- * Display the specified resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\MediaJob $mediaJob The request media job.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, MediaJob $mediaJob)
- {
- if (MediaJobConductor::viewable($mediaJob) === true) {
- return $this->respondAsResource(
- MediaJobConductor::model($request, $mediaJob),
- ['resourceName' => 'media_job']
- );
- }
-
- return $this->respondForbidden();
- }
-}
diff --git a/app/Http/Controllers/Api/OCRController.php b/app/Http/Controllers/Api/OCRController.php
deleted file mode 100644
index 7c2cce5..0000000
--- a/app/Http/Controllers/Api/OCRController.php
+++ /dev/null
@@ -1,234 +0,0 @@
-middleware('auth:sanctum')
- // ->only(['show']);
- }
-
- /**
- * Display the specified resource.
- *
- * @param Request $request The log request.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request)
- {
- // if ($request->user()?->hasPermission('logs/' . $name) === true) {
- $url = $request->get('url');
- if ($url !== null) {
- $data = ['ocr' => []];
-
- $filters = $request->get('filters', ['tesseract']);
- if (is_array($filters) === false) {
- $filters = explode(',', $filters);
- }
-
- $tesseractOEM = $request->get('tesseract.oem');
- $tesseractDigits = $request->get('tesseract.digits');
- $tesseractAllowlist = $request->get('tesseract.allowlist');
-
- // Download URL
- $urlDownloadFilePath = tempnam(sys_get_temp_dir(), 'download');
- $maxDownloadSize = (1024 * 1024); // 1MB
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-
- // We need progress updates to break the connection mid-way
- curl_setopt($ch, CURLOPT_BUFFERSIZE, 128); // more progress info
- curl_setopt($ch, CURLOPT_NOPROGRESS, false);
- curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function (
- $downloadSize,
- $downloaded,
- $uploadSize,
- $uploaded
- ) use ($maxDownloadSize) {
- return ($downloaded > $maxDownloadSize) ? 1 : 0;
- });
-
- $curlResult = curl_exec($ch);
- $curlError = curl_errno($ch);
- $curlSize = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
- curl_close($ch);
- if ($curlError !== 0) {
- $error = 'File size is larger then allowed';
- if ($curlError !== CurlErrorCodes::CURLE_ABORTED_BY_CALLBACK) {
- $error = CurlErrorCodes::getMessage($curlError);
- }
-
- return $this->respondWithErrors(['url' => $error]);
- }
-
- // Save url file
- file_put_contents($urlDownloadFilePath, $curlResult);
- $urlDownloadFilePathBase = preg_replace('/\\.[^.\\s]{3,4}$/', '', $urlDownloadFilePath);
-
- // tesseract (overall)
- $ocr = null;
- foreach ($filters as $filterItem) {
- if (str_starts_with($filterItem, 'tesseract') === true) {
- $ocr = new TesseractOCR();
- $ocr->image($urlDownloadFilePath);
- if ($tesseractOEM !== null) {
- $ocr->oem($tesseractOEM);
- }
- if ($tesseractDigits !== null) {
- $ocr->digits();
- }
- if ($tesseractAllowlist !== null) {
- $ocr->allowlist($tesseractAllowlist);
- }
- break;
- }
- }
-
- // Image Filter Function
- $tesseractImageFilterFunc = function ($filter, $options = null) use ($curlResult, $curlSize, $ocr) {
- $result = '';
- $img = imagecreatefromstring($curlResult);
- if (
- $img !== false && (($options !== null && imagefilter($img, $filter, $options) === true) ||
- ($options === null && imagefilter($img, $filter) === true))
- ) {
- ob_start();
- imagepng($img);
- $imgData = ob_get_contents();
- ob_end_clean();
- $imgDataSize = strlen($imgData);
-
- $ocr->imageData($imgData, $imgDataSize);
- imagedestroy($img);
-
- $result = $ocr->run(500);
- }
-
- return $result;
- };
-
- // Image Scale Function
- $tesseractImageScaleFunc = function ($scaleFunc) use ($curlResult, $ocr) {
- $result = '';
- $srcImage = imagecreatefromstring($curlResult);
- $srcWidth = imagesx($srcImage);
- $srcHeight = imagesy($srcImage);
-
- $dstWidth = $scaleFunc($srcWidth);
- $dstHeight = $scaleFunc($srcHeight);
- $dstImage = imagecreatetruecolor($dstWidth, $dstHeight);
-
- imagecopyresampled($dstImage, $srcImage, 0, 0, 0, 0, $dstWidth, $dstHeight, $srcWidth, $srcHeight);
-
- ob_start();
- imagepng($dstImage);
- $imgData = ob_get_contents();
- ob_end_clean();
- $imgDataSize = strlen($imgData);
-
- imagedestroy($srcImage);
- imagedestroy($dstImage);
-
- $ocr->imageData($imgData, $imgDataSize);
- $result = $ocr->run(500);
- return $result;
- };
-
- // filter: tesseract
- if (in_array('tesseract', $filters) === true) {
- $data['ocr']['tesseract'] = $ocr->run(500);
- }
-
- // filter: tesseract.grayscale
- if (in_array('tesseract.grayscale', $filters) === true) {
- $data['ocr']['tesseract.grayscale'] = $tesseractImageFilterFunc(IMG_FILTER_GRAYSCALE);
- }
-
- // filter: tesseract.double_scale
- if (in_array('tesseract.double_scale', $filters) === true) {
- $data['ocr']['tesseract.double_scale'] = $tesseractImageScaleFunc(function ($size) {
- return $size * 2;
- });
- }
-
- // filter: tesseract.half_scale
- if (in_array('tesseract.half_scale', $filters) === true) {
- $data['ocr']['tesseract.half_scale'] = $tesseractImageScaleFunc(function ($size) {
- return $size / 2;
- });
- }
-
- // filter: tesseract.edgedetect
- if (in_array('tesseract.edgedetect', $filters) === true) {
- $data['ocr']['tesseract.edgedetect'] = $tesseractImageFilterFunc(IMG_FILTER_EDGEDETECT);
- }
-
- // filter: tesseract.mean_removal
- if (in_array('tesseract.mean_removal', $filters) === true) {
- $data['ocr']['tesseract.mean_removal'] = $tesseractImageFilterFunc(IMG_FILTER_MEAN_REMOVAL);
- }
-
- // filter: tesseract.negate
- if (in_array('tesseract.negate', $filters) === true) {
- $data['ocr']['tesseract.negate'] = $tesseractImageFilterFunc(IMG_FILTER_NEGATE);
- }
-
- // filter: tesseract.pixelate
- if (in_array('tesseract.pixelate', $filters) === true) {
- $data['ocr']['tesseract.pixelate'] = $tesseractImageFilterFunc(IMG_FILTER_PIXELATE, 3);
- }
-
- // filter: keras
- if (in_array('keras', $filters) === true) {
- $cmd = '/usr/bin/python3 ' . base_path() . '/scripts/keras_oc.py ' . urlencode($url);
- $command = escapeshellcmd($cmd);
- $output = shell_exec($cmd);
- if ($output !== null && strlen($output) > 0) {
- $output = substr($output, (strpos($output, '----------START----------') + 25));
- } else {
- $output = '';
- }
- $data['ocr']['keras'] = $output;
- }
-
- unlink($urlDownloadFilePath);
- return $this->respondJson($data);
- }//end if
-
- return $this->respondWithErrors(['url' => 'url is missing']);
- }
-
- // $ffmpeg = FFMpeg\FFMpeg::create();
-
- // // Load the input video
- // $inputFile = $ffmpeg->open('input.mp4');
-
- // // Split the video into individual frames
- // $videoFrames = $inputFile->frames();
- // foreach ($videoFrames as $frame) {
- // // Save the frame as a PNG
- // $frame->save(new FFMpeg\Format\Video\PNG(), 'frame-' . $frame->getMetadata('pts') . '.png');
-
- // // Pass the PNG to Tesseract for processing
- // exec("tesseract frame-" . $frame->getMetadata('pts') . ".png output");
- // }
-
- // // Read the output from Tesseract
- // $text = file_get_contents("output.txt");
-
- // // Do something with the text from Tesseract
- // echo $text;
-}
diff --git a/app/Http/Controllers/Api/ShortlinkController.php b/app/Http/Controllers/Api/ShortlinkController.php
deleted file mode 100644
index a8d1c23..0000000
--- a/app/Http/Controllers/Api/ShortlinkController.php
+++ /dev/null
@@ -1,111 +0,0 @@
-middleware('auth:sanctum')
- ->only(['store','update','destroy']);
- }
-
- /**
- * Display a listing of the resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @return \Illuminate\Http\Response
- */
- public function index(Request $request)
- {
- list($collection, $total) = ShortlinkConductor::request($request);
-
- return $this->respondAsResource(
- $collection,
- ['isCollection' => true,
- 'appendData' => ['total' => $total]
- ],
- function ($options) {
- return $options['total'] === 0;
- }
- );
- }
-
- /**
- * Display the specified resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\Shortlink $shortlink The request shortlink.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, Shortlink $shortlink)
- {
- if (ShortlinkConductor::viewable($shortlink) === true) {
- return $this->respondAsResource(ShortlinkConductor::model($request, $shortlink));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Store a new media resource
- *
- * @param \App\Http\Requests\ShortlinkRequest $request The shortlink.
- * @return \Illuminate\Http\Response
- */
- public function store(ShortlinkRequest $request)
- {
- if (ShortlinkConductor::creatable() === true) {
- $shortlink = Shortlink::create($request->all());
-
- return $this->respondAsResource(
- ShortlinkConductor::model($request, $shortlink),
- ['respondCode' => HttpResponseCodes::HTTP_ACCEPTED]
- );
- }//end if
-
- return $this->respondForbidden();
- }
-
- /**
- * Update the media resource in storage.
- *
- * @param \App\Http\Requests\ShortlinkRequest $request The update request.
- * @param \App\Models\Shortlink $shortlink The specified shortlink.
- * @return \Illuminate\Http\Response
- */
- public function update(ShortlinkRequest $request, Shortlink $shortlink)
- {
- if (ShortlinkConductor::updatable($shortlink) === true) {
- $shortlink->update($request->all());
- return $this->respondAsResource(ShortlinkConductor::model($request, $shortlink));
- }//end if
-
- return $this->respondForbidden();
- }
-
- /**
- * Remove the specified resource from storage.
- *
- * @param \App\Models\Shortlink $shortlink Specified shortlink.
- * @return \Illuminate\Http\Response
- */
- public function destroy(Shortlink $shortlink)
- {
- if (ShortlinkConductor::destroyable($shortlink) === true) {
- $shortlink->delete();
- return $this->respondNoContent();
- }
-
- return $this->respondForbidden();
- }
-}
diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php
deleted file mode 100644
index 3cea08a..0000000
--- a/app/Http/Controllers/Api/UserController.php
+++ /dev/null
@@ -1,369 +0,0 @@
-middleware('auth:sanctum')
- ->except([
- 'index',
- 'show',
- 'register',
- 'exists',
- 'forgotPassword',
- 'resetPassword',
- 'verifyEmail',
- 'resendVerifyEmailCode',
- 'eventList',
- ]);
- }
-
- /**
- * Display a listing of the resource.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @return \Illuminate\Http\Response
- */
- public function index(Request $request)
- {
- list($collection, $total) = UserConductor::request($request);
-
- return $this->respondAsResource(
- $collection,
- ['isCollection' => true,
- 'appendData' => ['total' => $total]
- ]
- );
- }
-
- /**
- * Store a newly created user in the database.
- *
- * @param \App\Http\Requests\UserRequest $request The endpoint request.
- * @return \Illuminate\Http\Response
- */
- public function store(UserRequest $request)
- {
- if (UserConductor::creatable() === true) {
- $user = User::create($request->all());
- return $this->respondAsResource(
- UserConductor::model($request, $user),
- ['respondCode' => HttpResponseCodes::HTTP_CREATED]
- );
- } else {
- return $this->respondForbidden();
- }
- }
-
- /**
- * Display the specified user.
- *
- * @param \Illuminate\Http\Request $request The endpoint request.
- * @param \App\Models\User $user The user model.
- * @return \Illuminate\Http\Response
- */
- public function show(Request $request, User $user)
- {
- if (UserConductor::viewable($user) === true) {
- return $this->respondAsResource(UserConductor::model($request, $user));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Update the specified resource in storage.
- *
- * @param \App\Http\Requests\UserRequest $request The user update request.
- * @param \App\Models\User $user The specified user.
- * @return \Illuminate\Http\Response
- */
- public function update(UserRequest $request, User $user)
- {
- if (UserConductor::updatable($user) === true) {
- $input = [];
- $updatable = ['first_name', 'last_name', 'email', 'phone', 'password', 'display_name'];
-
- if ($request->user()->hasPermission('admin/user') === true) {
- $updatable = array_merge($updatable, ['email_verified_at']);
- }
-
- $input = $request->only($updatable);
- if (array_key_exists('password', $input) === true) {
- $input['password'] = Hash::make($request->input('password'));
- }
-
- $user->update($input);
-
- return $this->respondAsResource(UserConductor::model($request, $user));
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Remove the user from the database.
- *
- * @param \App\Models\User $user The specified user.
- * @return \Illuminate\Http\Response
- */
- public function destroy(User $user)
- {
- if (UserConductor::destroyable($user) === true) {
- $user->delete();
- return $this->respondNoContent();
- }
-
- return $this->respondForbidden();
- }
-
- /**
- * Register a new user
- *
- * @param \App\Http\Requests\UserRegisterRequest $request The register user request.
- * @return JsonResponse
- */
- public function register(UserRegisterRequest $request): JsonResponse
- {
- try {
- $userData = $request->only([
- 'first_name',
- 'last_name',
- 'email',
- 'phone',
- 'password',
- 'display_name',
- ]);
-
- $userData['password'] = Hash::make($userData['password']);
-
- $user = User::where('email', $request->input('email'))
- ->whereNull('password')
- ->first();
-
- if ($user === null) {
- $user = User::create($userData);
- } else {
- unset($userData['email']);
- $user->update($userData);
- }//end if
-
- $code = $user->codes()->create([
- 'action' => 'verify-email',
- ]);
-
- dispatch((new SendEmailJob($user->email, new EmailVerify($user, $code->code))))->onQueue('mail');
-
- return response()->json([
- 'message' => 'Check your email for a welcome code.'
- ]);
- } catch (\Exception $e) {
- return response()->json([
- 'message' => 'A server error occurred. Please try again later' . $e
- ], 500);
- }//end try
- }
-
- /**
- * Generates a new reset password code
- *
- * @param \App\Http\Requests\UserForgotPasswordRequest $request The reset password request.
- * @return \Illuminate\Http\Response
- */
- public function forgotPassword(UserForgotPasswordRequest $request)
- {
- $user = User::where('email', $request->input('email'))->first();
- if ($user !== null) {
- $user->codes()->where('action', 'reset-password')->delete();
- $code = $user->codes()->create([
- 'action' => 'reset-password'
- ]);
-
- dispatch((new SendEmailJob($user->email, new ForgotPassword($user, $code->code))))->onQueue('mail');
- return $this->respondNoContent();
- }
-
- return $this->respondNotFound();
- }
-
- /**
- * Resets a user password
- *
- * @param \App\Http\Requests\UserResetPasswordRequest $request The reset password request.
- * @return \Illuminate\Http\Response
- */
- public function resetPassword(UserResetPasswordRequest $request)
- {
- UserCode::clearExpired();
-
- $code = UserCode::where('code', $request->input('code'))->where('action', 'reset-password')->first();
- if ($code !== null) {
- $user = $code->user()->first();
-
- $code->delete();
- $user->codes()->where('action', 'verify-email')->delete();
-
- $user->password = Hash::make($request->input('password'));
-
- if ($user->email_verified_at === null) {
- $user->email_verified_at = now();
- }
-
- $user->save();
-
- dispatch((new SendEmailJob($user->email, new ChangedPassword($user))))->onQueue('mail');
- return $this->respondNoContent();
- }
-
- return $this->respondError([
- 'code' => 'The code was not found or has expired.'
- ]);
- }
-
- /**
- * Verify an email code
- *
- * @param \App\Http\Requests\UserVerifyEmailRequest $request The verify email request.
- * @return \Illuminate\Http\Response
- */
- public function verifyEmail(UserVerifyEmailRequest $request)
- {
- UserCode::clearExpired();
-
- $code = UserCode::where('code', $request->input('code'))->where('action', 'verify-email')->first();
- if ($code !== null) {
- $user = $code->user()->first();
- $new_email = $code->data;
-
- if ($new_email === null) {
- if ($user->email_verified_at === null) {
- $user->email_verified_at = now();
- }
- } else {
- dispatch((new SendEmailJob($user->email, new ChangedEmail($user, $user->email, $new_email))))
- ->onQueue('mail');
-
- $user->email = $new_email;
- $user->email_verified_at = now();
- }
-
- $code->delete();
- $user->save();
-
- return $this->respondNoContent();
- }//end if
-
- return $this->respondWithErrors([
- 'code' => 'The code was not found or has expired.'
- ]);
- }
-
- /**
- * Resend a new verify email
- *
- * @param \App\Http\Requests\UserResendVerifyEmailRequest $request The resend verify email request.
- * @return JsonResponse
- */
- public function resendVerifyEmail(UserResendVerifyEmailRequest $request): JsonResponse
- {
- UserCode::clearExpired();
-
- $user = User::where('email', $request->input('email'))->first();
- if ($user !== null) {
- $code = $user->codes()->where('action', 'verify-email')->first();
- $code->regenerate();
- $code->save();
-
- if ($code->data === null) {
- dispatch((new SendEmailJob($user->email, new EmailVerify($user, $code->code))))->onQueue('mail');
- } else {
- dispatch((new SendEmailJob($user->email, new ChangeEmailVerify($user, $code->code, $code->data))))
- ->onQueue('mail');
- }
- }
-
- return response()->json(['message' => 'Verify email sent if user registered and required']);
- }
-
- /**
- * Resend verification email
- *
- * @param \App\Http\Requests\UserResendVerifyEmailRequest $request The resend user request.
- * @return \Illuminate\Http\Response
- */
- public function resendVerifyEmailCode(UserResendVerifyEmailRequest $request)
- {
- $user = User::where('email', $request->input('email'))->first();
- if ($user !== null) {
- $user->codes()->where('action', 'verify-email')->delete();
-
- if ($user->email_verified_at === null) {
- $code = $user->codes()->create([
- 'action' => 'verify-email'
- ]);
-
- dispatch((new SendEmailJob($user->email, new EmailVerify($user, $code->code))))->onQueue('mail');
- }
-
- return $this->respondNoContent();
- }
-
- return $this->respondNotFound();
- }
-
- /**
- * Return a JSON event list of a user.
- *
- * @param Request $request The http request.
- * @param User $user The specified user.
- * @return JsonResponse
- */
- public function eventList(Request $request, User $user): JsonResponse
- {
- if (
- $request->user() !== null && (
- $request->user() === $user || $request->user()->hasPermission('admin/events') === true
- )
- ) {
- $collection = $user->events;
- $total = $collection->count();
-
- $collection = EventConductor::collection($request, $collection);
- return $this->respondAsResource(
- $collection,
- ['isCollection' => true,
- 'appendData' => ['total' => $total]
- ]
- );
- } else {
- return $this->respondForbidden();
- }
- }
-}
diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php
new file mode 100644
index 0000000..cddccf3
--- /dev/null
+++ b/app/Http/Controllers/AuthController.php
@@ -0,0 +1,155 @@
+check()) {
+// return redirect()->route('dashboard');
+ return redirect()->action([HomeController::class, 'index']);
+ }
+
+ $token = $request->query('token');
+ if ($token) {
+ return $this->tokenLogin($token);
+ }
+
+ return view('auth.login');
+ }
+
+ public function tokenLogin($token)
+ {
+ $loginToken = DB::table('login_tokens')->where('token', $token)->first();
+
+ if ($loginToken) {
+ $user = User::where('email', $loginToken->email)->first();
+ $intended_url = $loginToken->intended_url;
+
+ DB::table('login_tokens')->where('token', $token)->delete();
+
+ if ($user) {
+ Auth::login($user);
+
+ $user->markEmailAsVerified();
+ DB::table('login_tokens')->where('token', $token)->delete();
+
+ session()->flash('message', 'You have been logged in');
+ session()->flash('message-title', 'Logged in');
+ session()->flash('message-type', 'success');
+
+ if($intended_url) {
+ return redirect($intended_url);
+ }
+
+ return redirect()->action([HomeController::class, 'index']);
+ }
+ }
+
+ session()->flash('message', 'That token has expired or is invalid');
+ session()->flash('message-title', 'Log in failed');
+ session()->flash('message-type', 'danger');
+ return view('auth.login');
+ }
+
+ public function postLogin(Request $request) {
+ $request->validate([
+ 'email' => 'required|email',
+ ], [
+ 'email.required' => __('validation.custom_messages.email_required'),
+ 'email.email' => __('validation.custom_messages.email_invalid'),
+ ]);
+
+ $user = User::where('email', $request->email)->first();
+ if($user) {
+ $token = $user->createLoginToken(session()->pull('url.intended', null));
+ dispatch(new SendEmail($user->email, new LoginLink($token, $user->getName(), $user->email)))->onQueue('mail');
+
+ return view('auth.login-link');
+ }
+
+ session()->flash('status', 'not-found');
+ return view('auth.login');
+ }
+
+ public function logout() {
+ auth()->logout();
+
+ session()->flash('message', 'You have been logged out');
+ session()->flash('message-title', 'Logged out');
+ session()->flash('message-type', 'warning');
+ return redirect()->route('index');
+ }
+
+ public function showRegister(Request $request) {
+ if (auth()->check()) {
+ return redirect()->route('dashboard');
+ }
+
+ return view('auth.register');
+ }
+
+ public function postRegister(Request $request) {
+ $request->validate([
+ 'email' => 'required|email',
+ ], [
+ 'email.required' => __('validation.custom_messages.email_required'),
+ 'email.email' => __('validation.custom_messages.email_invalid')
+ ]);
+
+ $user = User::where('email', $request->email)->first();
+ if($user) {
+ if($user->email_verified_at !== null) {
+ return redirect()->back()->withInput()->withErrors([
+ 'email' => __('validation.custom_messages.email_exists'),
+ ]);
+ }
+ } else {
+ $firstname = explode('@', $request->email)[0];
+
+ $user = User::create([
+ 'firstname' => $firstname,
+ 'email' => $request->email,
+ ]);
+
+ EmailUpdate::where('email', $request->email)->delete();
+ }
+
+ $token = $user->createLoginToken(session()->pull('url.intended', null));
+ dispatch(new SendEmail($user->email, new RegisterLink($token, $user->getName(), $user->email)))->onQueue('mail');
+
+ return view('auth.login-link');
+ }
+
+ public function updateEmail(Request $request)
+ {
+ $token = $request->query('token');
+ $emailUpdate = EmailUpdate::where('token', $token)->first();
+ if($emailUpdate && $emailUpdate->user) {
+ $emailUpdate->user->email = $emailUpdate->email;
+ $emailUpdate->user->email_verified_at = now();
+ $emailUpdate->user->save();
+ $emailUpdate->delete();
+
+ session()->flash('message', 'Your email has been updated');
+ session()->flash('message-title', 'Email updated');
+ session()->flash('message-type', 'success');
+ return redirect()->route('index');
+ }
+
+ session()->flash('message', 'That token has expired or is invalid');
+ session()->flash('message-title', 'Email update failed');
+ session()->flash('message-type', 'danger');
+ return redirect()->route('index');
+ }
+}
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index f1406be..8677cd5 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -2,12 +2,7 @@
namespace App\Http\Controllers;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-use Illuminate\Foundation\Validation\ValidatesRequests;
-use Illuminate\Routing\Controller as BaseController;
-
-class Controller extends BaseController
+abstract class Controller
{
- use AuthorizesRequests;
- use ValidatesRequests;
+ //
}
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
new file mode 100644
index 0000000..6add24b
--- /dev/null
+++ b/app/Http/Controllers/HomeController.php
@@ -0,0 +1,20 @@
+orderBy('created_at', 'desc')->limit(4)->get();
+ $workshops = Workshop::query()->where('starts_at', '>', now())->orderBy('created_at', 'asc')->limit(4)->get();
+
+ return view('home', [
+ 'posts' => $posts,
+ 'workshops' => $workshops,
+ ]);
+ }
+}
diff --git a/app/Http/Controllers/LocationController.php b/app/Http/Controllers/LocationController.php
new file mode 100644
index 0000000..e18651b
--- /dev/null
+++ b/app/Http/Controllers/LocationController.php
@@ -0,0 +1,102 @@
+has('search')) {
+ $query->where('name', 'like', '%' . $request->search . '%');
+ $query->orWhere('address', 'like', '%' . $request->search . '%');
+ }
+
+ $locations = $query->orderBy('name')->paginate(12)->onEachSide(1);
+
+ return view('admin.location.index', [
+ 'locations' => $locations
+ ]);
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ */
+ public function create()
+ {
+ return view('admin.location.edit');
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ */
+ public function store(Request $request)
+ {
+ $request->validate([
+ 'name' => 'required',
+ 'address_url' => 'nullable|url',
+ ], [
+// 'firstname.required' => __('validation.custom_messages.firstname_required'),
+// 'surname.required' => __('validation.custom_messages.surname_required'),
+ ]);
+
+ Location::create(array_merge(
+ $request->all(),
+ ));
+
+ session()->flash('message', 'Location has been created');
+ session()->flash('message-title', 'Location created');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.location.index');
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ */
+ public function edit(Location $location)
+ {
+ return view('admin.location.edit', ['location' => $location]);
+ }
+
+ /**
+ * Update the specified resource in storage.
+ */
+ public function update(Request $request, Location $location)
+ {
+ $request->validate([
+ 'name' => 'required',
+ 'address_url' => 'url',
+ ], [
+// 'firstname.required' => __('validation.custom_messages.firstname_required'),
+// 'surname.required' => __('validation.custom_messages.surname_required'),
+ ]);
+
+ $location->update($request->all());
+
+ session()->flash('message', 'Location has been updated');
+ session()->flash('message-title', 'Location updated');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.location.index');
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ */
+ public function destroy(Location $location)
+ {
+ $location->delete();
+ session()->flash('message', 'Location has been deleted');
+ session()->flash('message-title', 'Location deleted');
+ session()->flash('message-type', 'danger');
+
+ return redirect()->route('admin.location.index');
+ }
+}
diff --git a/app/Http/Controllers/MediaController.php b/app/Http/Controllers/MediaController.php
new file mode 100644
index 0000000..cf5f399
--- /dev/null
+++ b/app/Http/Controllers/MediaController.php
@@ -0,0 +1,343 @@
+wantsJson()) {
+ abort(404);
+ }
+
+ $media = $this->getMedia($request);
+ return response()->json($media);
+ }
+
+ public function admin_index(Request $request)
+ {
+ $media = $this->getMedia($request);
+
+ return view('admin.media.index', [
+ 'media' => $media,
+ ]);
+
+ }
+
+ public function getMedia(Request $request)
+ {
+ $query = Media::query();
+ $perPage = $request->input('per_page', 25);
+
+ if(!empty($request->get('search'))) {
+ $query->where(function($query) use ($request) {
+ $query->where('title', 'like', '%' . $request->search . '%');
+ $query->orWhere('name', 'like', '%' . $request->search . '%');
+ });
+ }
+
+ if($request->has('mime_type')) {
+ $mime_types = explode(',', $request->mime_type);
+ $query->where(function ($query) use ($mime_types) {
+ foreach ($mime_types as $mime_type) {
+ $mime_type = str_replace('*', '%', $mime_type);
+ $query->orWhere('mime_type', 'like', $mime_type);
+ }
+ });
+ }
+
+ $media = $query->orderBy('created_at', 'desc');
+
+ if($request->wantsJson() && !(empty($request->input('selected'))) && empty($request->get('search')) && !$request->has('page')) {
+ $selected = $request->input('selected')[0];
+ $selectedMedia = $media->get();
+ $selectedMediaIndex = $selectedMedia->search(function ($item) use ($selected) {
+ return $item->name == $selected;
+ });
+
+ if ($selectedMediaIndex !== false) {
+ $page = intdiv($selectedMediaIndex, $perPage) + 1;
+ $request->merge(['page' => $page]);
+ }
+ }
+
+ $media = $media->paginate($perPage)->onEachSide(1);
+ return $media;
+ }
+
+ /**
+ * Display the specified resource.
+ */
+ public function show(Request $request, Media $media)
+ {
+ if(!$request->wantsJson()) {
+ abort(404);
+ }
+
+ return response()->json($media);
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ */
+ public function admin_create()
+ {
+ return view('admin.media.edit');
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ */
+ public function admin_store(Request $request)
+ {
+ $max_size = Helpers::getMaxUploadSize();
+
+ $validator = Validator::make($request->all(), [
+ 'title' => 'required',
+ 'file' => 'required|file|max:' . (max(round($max_size / 1024),0)),
+ ], [
+ 'title.required' => __('validation.custom_messages.title_required'),
+ 'file.required' => __('validation.custom_messages.file_required'),
+ 'file.file' => __('validation.custom_messages.file_file'),
+ 'file.max' => __('validation.custom_messages.file_max', ['max' => Helpers::bytesToString($max_size)])
+ ]);
+
+ if ($validator->fails()) {
+ return redirect()->back()->withErrors($validator)->withInput();
+ }
+
+ $file = $request->file('file');
+
+ $name = $file->getClientOriginalName();
+ $name = Helpers::cleanFileName($name);
+
+ if(Media::find($name) !== null) {
+ $increment = 2;
+ while(Media::find($name . '-' . $increment) !== null) {
+ $increment++;
+ }
+
+ $name = $name . '-' . $increment;
+ }
+
+ $hash = hash_file('sha256', $file->path());
+
+ $storage = Storage::disk('media');
+ if(!$storage->exists($hash)) {
+ if($file->storeAs('/', $hash, 'media') === false) {
+ session()->flash('message', 'A server error occurred uploading the file.');
+ session()->flash('message-title', 'Upload failed');
+ session()->flash('message-type', 'danger');
+ return redirect()->back();
+ }
+ }
+
+ $media = Media::Create([
+ 'title' => $request->get('title', $name),
+ 'user_id' => auth()->id(),
+ 'name' => $name,
+ 'size' => $file->getSize(),
+ 'mime_type' => $file->getMimeType(),
+ 'hash' => $hash
+ ]);
+
+ $media->generateVariants(false);
+ unlink($file);
+
+ session()->flash('message', 'Media has been uploaded');
+ session()->flash('message-title', 'Media uploaded');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.media.index');
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ */
+ public function admin_edit(Media $media)
+ {
+ return view('admin.media.edit', ['medium' => $media]);
+ }
+
+ /**
+ * Update the specified resource in storage.
+ */
+ public function admin_update(Request $request, Media $media)
+ {
+ $request->validate([
+ 'title' => 'required',
+ 'content' => 'required',
+ ], [
+// 'firstname.required' => __('validation.custom_messages.firstname_required'),
+// 'surname.required' => __('validation.custom_messages.surname_required'),
+ ]);
+
+ $media->update($request->all());
+
+ session()->flash('message', 'Media has been updated');
+ session()->flash('message-title', 'Media updated');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.media.index');
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ */
+ public function admin_destroy(Request $request, Media $media)
+ {
+ $media->delete();
+ session()->flash('message', 'Media has been deleted');
+ session()->flash('message-title', 'Media deleted');
+ session()->flash('message-type', 'danger');
+
+ if($request->wantsJson()) {
+ return response()->json([
+ 'success' => true,
+ 'redirect' => route('admin.media.index'),
+ ]);
+ }
+
+ return redirect()->route('admin.media.index');
+ }
+
+ public function upload(Request $request)
+ {
+ $request->validate([
+ 'file' => 'required|file',
+ ]);
+
+ if(auth()->guest()) {
+ return response()->json([
+ 'message' => 'You must be logged in to upload media',
+ ], 401);
+ }
+
+ if(!auth()->user()?->admin) {
+ return response()->json([
+ 'message' => 'You do not have permission to upload media',
+ ], 403);
+ }
+
+ if(!$request->hasFile('file')) {
+ return response()->json([
+ 'message' => 'No file was received by the server',
+ ], 422);
+ }
+
+ $max_size = Helpers::getMaxUploadSize();
+
+ $file = $request->file('file');
+
+ if($file->getSize() > $max_size) {
+ return response()->json([
+ 'message' => 'The file ' . $file->getClientOriginalName() . ' is larger than the maximum size allowed of ' . Helpers::bytesToString($max_size)
+ ], 422);
+ }
+
+ $name = $file->getClientOriginalName();
+ if(Media::find($name) !== null) {
+ $increment = 2;
+ while(Media::find($name . '-' . $increment) !== null) {
+ $increment++;
+ }
+
+ $name = $name . '-' . $increment;
+ }
+
+ $media = Media::Create([
+ 'title' => $request->get('title', $name),
+ 'user_id' => auth()->id(),
+ 'name' => $name,
+ 'size' => $file->getSize(),
+ 'mime_type' => $file->getMimeType(),
+ 'hash' => hash_file('sha256', $file->path()),
+ ]);
+
+ $file->storeAs('/', $media->hash, 'public');
+ $media->generateVariants();
+ unlink($file);
+
+ return response()->json([
+ 'message' => 'File has been uploaded',
+ 'name' => $media->name,
+ 'size' => $media->size,
+ 'mime_type' => $media->mime_type
+ ]);
+ }
+
+ public function download(Request $request, Media $media)
+ {
+ $file = $media->path();
+ if($file === null) {
+ abort(404, 'File not found');
+ }
+
+ $variant = '';
+ $download = false;
+ $variants = array_keys($media->getVariantTypes());
+ $query = $request->getQueryString();
+ if($query !== '') {
+ $queryList = explode('&', $query);
+ foreach($queryList as $queryItem) {
+ $parts = explode('=', $queryItem);
+ if($variant === '' && in_array($parts[0], $variants) && ($parts[1] === '' || filter_var($parts[1], FILTER_VALIDATE_BOOLEAN))) {
+ $variant = $parts[0];
+ }
+
+ if($parts[0] === 'download' && ($parts[1] === '' || filter_var($parts[1], FILTER_VALIDATE_BOOLEAN))) {
+ $download = true;
+ }
+ }
+ }
+
+ $mime_type = $media->mime_type;
+ $name = $media->name;
+
+ if($variant !== '') {
+ $variantFile = $media->getClosestVariant($variant);
+ $file = $variantFile['file'];
+ $mime_type = $variantFile['mime_type'];
+ $name = $variantFile['name'];
+ }
+
+ $headers = [
+ 'Content-Type' => $mime_type,
+ 'Content-Disposition' => ($download ? 'attachment; ' : '') . 'filename="' . $name . '"',
+ ];
+
+ return response()->file($file, $headers);
+ }
+}
diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php
new file mode 100644
index 0000000..6e97db4
--- /dev/null
+++ b/app/Http/Controllers/PostController.php
@@ -0,0 +1,148 @@
+where('status', 'published');
+
+ if($request->has('search')) {
+ $query->where('title', 'like', '%' . $request->search . '%');
+ $query->orWhere('content', 'like', '%' . $request->search . '%');
+ }
+
+ $posts = $query->orderBy('created_at', 'desc')->paginate(12)->onEachSide(1);
+
+ return view('post.index', [
+ 'posts' => $posts
+ ]);
+ }
+
+ /**
+ * Display a listing of the resource.
+ */
+ public function admin_index(Request $request)
+ {
+ $query = Post::query();
+
+ if($request->has('search')) {
+ $query->where('title', 'like', '%' . $request->search . '%');
+ $query->orWhere('content', 'like', '%' . $request->search . '%');
+ }
+
+ $posts = $query->orderBy('created_at', 'desc')->paginate(12)->onEachSide(1);
+
+ return view('admin.post.index', [
+ 'posts' => $posts
+ ]);
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ */
+ public function admin_create()
+ {
+ return view('admin.post.create');
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ */
+ public function admin_store(Request $request)
+ {
+ $request->validate([
+ 'title' => 'required',
+ 'content' => 'required',
+ 'hero_media_name' => 'required|exists:media,name',
+ ], [
+ 'title.required' => __('validation.custom_messages.title_required'),
+ 'content.required' => __('validation.custom_messages.content_required'),
+ 'hero_media_name.required' => __('validation.custom_messages.hero_media_name_required'),
+ ]);
+
+ $postData = $request->all();
+ $postData['user_id'] = auth()->user()->id;
+
+ $post = Post::create($postData);
+ $post->updateFiles($request->input('files'));
+ $post->updateFiles($request->input('gallery'), 'gallery');
+
+ session()->flash('message', 'Post has been created');
+ session()->flash('message-title', 'Post created');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.post.index');
+ }
+
+ /**
+ * Display the specified resource.
+ */
+ public function show(Post $post)
+ {
+ return view('post.show', ['post' => $post]);
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ */
+ public function admin_edit(Post $post)
+ {
+ $fileNameList = $post->files->pluck('name')->toArray();
+ $post->files = $fileNameList;
+
+ return view('admin.post.edit', ['post' => $post]);
+ }
+
+ /**
+ * Update the specified resource in storage.
+ */
+ public function admin_update(Request $request, Post $post)
+ {
+ $request->validate([
+ 'title' => 'required',
+ 'content' => 'required',
+ 'hero_media_name' => 'required|exists:media,name',
+ ], [
+ 'title.required' => __('validation.custom_messages.title_required'),
+ 'content.required' => __('validation.custom_messages.content_required'),
+ 'hero_media_name.required' => __('validation.custom_messages.hero_media_name_required'),
+ ]);
+
+ $postData = $request->all();
+ $post->update($postData);
+ $post->updateFiles($request->input('files'));
+ $post->updateFiles($request->input('gallery'), 'gallery');
+
+ session()->flash('message', 'Post has been updated');
+ session()->flash('message-title', 'Post updated');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.post.index');
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ */
+ public function admin_destroy(Post $post)
+ {
+ $post->delete();
+ session()->flash('message', 'Post has been deleted');
+ session()->flash('message-title', 'Post deleted');
+ session()->flash('message-type', 'danger');
+
+ return redirect()->route('admin.post.index');
+ }
+}
diff --git a/app/Http/Controllers/TicketController.php b/app/Http/Controllers/TicketController.php
new file mode 100644
index 0000000..a828ae9
--- /dev/null
+++ b/app/Http/Controllers/TicketController.php
@@ -0,0 +1,65 @@
+has('search')) {
+ $query->where('firstname', 'like', '%' . $request->search . '%');
+ $query->orWhere('surname', 'like', '%' . $request->search . '%');
+ $query->orWhere('phone', 'like', '%' . $request->search . '%');
+ $query->orWhere('email', 'like', '%' . $request->search . '%');
+ }
+
+ $users = $query->orderBy('created_at', 'desc')->paginate(12)->onEachSide(1);
+
+ return view('admin.user.index', [
+ 'users' => $users
+ ]);
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ */
+ public function create()
+ {
+ return view('admin.user.create');
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ */
+ public function store(Request $request)
+ {
+ $request->validate([
+ 'firstname' => 'required',
+ 'surname' => 'required',
+ 'email' => 'required|email|unique:users,email',
+ 'phone' => 'required',
+
+ 'home_address' => 'required',
+ 'home_city' => 'required',
+ 'home_postcode' => 'required',
+ 'home_country' => 'required',
+ 'home_state' => 'required',
+
+ 'billing_address' => 'required',
+ 'billing_city' => 'required',
+ 'billing_postcode' => 'required',
+ 'billing_country' => 'required',
+ 'billing_state' => 'required',
+ ], [
+ 'firstname.required' => __('validation.custom_messages.firstname_required'),
+ 'surname.required' => __('validation.custom_messages.surname_required'),
+ 'email.required' => __('validation.custom_messages.email_required'),
+ 'email.email' => __('validation.custom_messages.email_invalid'),
+ 'phone.required' => __('validation.custom_messages.phone_required'),
+
+ 'home_address.required' => __('validation.custom_messages.home_address_required'),
+ 'home_city.required' => __('validation.custom_messages.home_city_required'),
+ 'home_postcode.required' => __('validation.custom_messages.home_postcode_required'),
+ 'home_country.required' => __('validation.custom_messages.home_country_required'),
+ 'home_state.required' => __('validation.custom_messages.home_state_required'),
+
+ 'billing_address.required' => __('validation.custom_messages.billing_address_required'),
+ 'billing_city.required' => __('validation.custom_messages.billing_city_required'),
+ 'billing_postcode.required' => __('validation.custom_messages.billing_postcode_required'),
+ 'billing_country.required' => __('validation.custom_messages.billing_country_required'),
+ 'billing_state.required' => __('validation.custom_messages.billing_state_required'),
+ ]);
+
+ User::create($request->all());
+
+ session()->flash('message', 'User has been created');
+ session()->flash('message-title', 'User created');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.user.index');
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ */
+ public function edit(User $user)
+ {
+ return view('admin.user.edit', compact('user'));
+ }
+
+ /**
+ * Update the specified resource in storage.
+ */
+ public function update(Request $request, User $user)
+ {
+ $request->validate([
+ 'firstname' => 'required',
+ 'surname' => 'required',
+ 'email' => ['required', 'email', Rule::unique('users')->ignore($user->id),],
+ 'phone' => 'required',
+
+ 'home_address' => 'required',
+ 'home_city' => 'required',
+ 'home_postcode' => 'required',
+ 'home_country' => 'required',
+ 'home_state' => 'required',
+
+ 'billing_address' => 'required',
+ 'billing_city' => 'required',
+ 'billing_postcode' => 'required',
+ 'billing_country' => 'required',
+ 'billing_state' => 'required',
+ ], [
+ 'firstname.required' => __('validation.custom_messages.firstname_required'),
+ 'surname.required' => __('validation.custom_messages.surname_required'),
+ 'email.required' => __('validation.custom_messages.email_required'),
+ 'email.email' => __('validation.custom_messages.email_invalid'),
+ 'phone.required' => __('validation.custom_messages.phone_required'),
+
+ 'home_address.required' => __('validation.custom_messages.home_address_required'),
+ 'home_city.required' => __('validation.custom_messages.home_city_required'),
+ 'home_postcode.required' => __('validation.custom_messages.home_postcode_required'),
+ 'home_country.required' => __('validation.custom_messages.home_country_required'),
+ 'home_state.required' => __('validation.custom_messages.home_state_required'),
+
+ 'billing_address.required' => __('validation.custom_messages.billing_address_required'),
+ 'billing_city.required' => __('validation.custom_messages.billing_city_required'),
+ 'billing_postcode.required' => __('validation.custom_messages.billing_postcode_required'),
+ 'billing_country.required' => __('validation.custom_messages.billing_country_required'),
+ 'billing_state.required' => __('validation.custom_messages.billing_state_required'),
+ ]);
+
+ $user->update($request->all());
+
+ session()->flash('message', 'User details have been updated');
+ session()->flash('message-title', 'Details updated');
+ session()->flash('message-type', 'success');
+ return redirect()->back();
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ */
+ public function destroy(User $user)
+ {
+ if($user->id !== '1') {
+ $user->delete();
+ session()->flash('message', 'User has been deleted');
+ session()->flash('message-title', 'User deleted');
+ session()->flash('message-type', 'success');
+ } else {
+ session()->flash('message', 'You cannot delete the main admin user');
+ session()->flash('message-title', 'User not deleted');
+ session()->flash('message-type', 'error');
+ }
+
+ return redirect()->route('admin.user.index');
+ }
+}
diff --git a/app/Http/Controllers/WorkshopController.php b/app/Http/Controllers/WorkshopController.php
new file mode 100644
index 0000000..afce121
--- /dev/null
+++ b/app/Http/Controllers/WorkshopController.php
@@ -0,0 +1,231 @@
+get('search', '');
+
+ $query = Workshop::query();
+
+ if(!auth()->user()?->admin) {
+ $query = $query->where('status', '!=', 'draft');
+ }
+
+ if($request->has('search') && $request->search !== '') {
+ $query = $query->where(function ($query) use ($request) {
+ $query->where('title', 'like', '%' . $request->search . '%')
+ ->orWhere('content', 'like', '%' . $request->search . '%');
+ });
+ }
+
+ if($request->has('location') && $request->location !== '') {
+ $query = $query->whereHas('location', function ($query) use ($request) {
+ $query->where('name', 'like', '%' . $request->location . '%');
+ });
+ }
+
+ if($request->has('date') && $request->date !== '') {
+ $dates = explode('-', $request->date);
+ $dates = array_map('trim', $dates);
+ $dates = array_map(function($date) {
+ $date = trim($date);
+
+ if(preg_match('/^\d{4}-\d{2}-\d{2}$/', $date)) {
+ return $date;
+ }
+ if(preg_match('/^(\d{2})-(\d{2})-(\d{2})$/', $date, $matches)) {
+ return '20' . $matches[1] . '-' . $matches[2] . '-' . $matches[3];
+ }
+ if(preg_match('/^\d{4}-\d{2}$/', $date)) {
+ return $date . '-01';
+ }
+ if(preg_match('/^\d{4}$/', $date)) {
+ return $date . '-01-01';
+ }
+ if(preg_match('/^(\d{2})\/(\d{2})\/(\d{2})$/', $date, $matches)) {
+ return '20' . $matches[3] . '-' . $matches[2] . '-' . $matches[1];
+ }
+ if(preg_match('/^(\d{2})\/(\d{2})\/(\d{4})$/', $date, $matches)) {
+ return $matches[3] . '-' . $matches[2] . '-' . $matches[1];
+ }
+
+ return '';
+ }, $dates);
+
+ if(count($dates) == 2) {
+ // If there are two dates, filter between starts_at and ends_at
+ $query = $query->whereDate('starts_at', '>=', $dates[0])
+ ->whereDate('ends_at', '<=', $dates[1]);
+ } else {
+ // If there is one date, filter starts_at that date or newer
+ $query = $query->whereDate('starts_at', '>=', $dates[0]);
+ }
+ }
+
+ $workshops = $query
+ ->orderBy('starts_at', 'desc')
+ ->paginate(12);
+
+ return view('workshop.index', [
+ 'workshops' => $workshops,
+ 'search' => $search,
+ ]);
+ }
+
+ /**
+ * Display a listing of the resource.
+ */
+ public function admin_index(Request $request)
+ {
+ $query = Workshop::query();
+
+ if($request->has('search')) {
+ $query->where('title', 'like', '%' . $request->search . '%');
+ $query->orWhere('content', 'like', '%' . $request->search . '%');
+ }
+
+ $workshops = $query->orderBy('starts_at', 'desc')->paginate(12)->onEachSide(1);
+
+ return view('admin.workshop.index', [
+ 'workshops' => $workshops
+ ]);
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ */
+ public function admin_create()
+ {
+ return view('admin.workshop.edit');
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ */
+ public function admin_store(Request $request)
+ {
+ $request->validate([
+ 'title' => 'required',
+ 'content' => 'required',
+ 'starts_at' => 'required',
+ 'ends_at' => 'required|after:starts_at',
+ 'publish_at' => 'required',
+ 'closes_at' => 'required',
+ 'status' => 'required',
+ 'hero_media_name' => 'required|exists:media,name',
+ 'registration_data' => 'required_unless:registration,none',
+ ], [
+ 'title.required' => __('validation.custom_messages.title_required'),
+ 'content.required' => __('validation.custom_messages.content_required'),
+ 'starts_at.required' => __('validation.custom_messages.starts_at_required'),
+ 'ends_at.required' => __('validation.custom_messages.ends_at_required'),
+ 'ends_at.after' => __('validation.custom_messages.ends_at_after'),
+ 'publish_at.required' => __('validation.custom_messages.publish_at_required'),
+ 'closes_at.required' => __('validation.custom_messages.closes_at_required'),
+ 'status.required' => __('validation.custom_messages.status_required'),
+ 'hero_media_name.required' => __('validation.custom_messages.hero_media_name_required'),
+ 'hero_media_name.exists' => __('validation.custom_messages.hero_media_name_exists'),
+ 'registration_data.required_unless' => __('validation.custom_messages.registration_data_required_unless'),
+ ]);
+
+ $workshopData = $request->all();
+ $workshopData['user_id'] = auth()->user()->id;
+
+ if($workshopData['status'] === 'open' && Carbon::parse($workshopData['starts_at'])->lt(Carbon::now())) {
+ $workshopData['status'] = 'closed';
+ }
+
+ $workshop = Workshop::create($workshopData);
+ $workshop->updateFiles($request->input('files'));
+
+ session()->flash('message', 'Workshop has been created');
+ session()->flash('message-title', 'Workshop created');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.workshop.index');
+ }
+
+ /**
+ * Display the specified resource.
+ */
+ public function show(Workshop $workshop)
+ {
+ if(!auth()->user()?->admin && $workshop->status == 'draft') {
+ abort(404);
+ }
+
+ return view('workshop.show', ['workshop' => $workshop]);
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ */
+ public function admin_edit(Workshop $workshop)
+ {
+ return view('admin.workshop.edit', ['workshop' => $workshop]);
+ }
+
+ /**
+ * Update the specified resource in storage.
+ */
+ public function admin_update(Request $request, Workshop $workshop)
+ {
+ $request->validate([
+ 'title' => 'required',
+ 'content' => 'required',
+ 'starts_at' => 'required',
+ 'ends_at' => 'required|after:starts_at',
+ 'publish_at' => 'required',
+ 'closes_at' => 'required',
+ 'status' => 'required',
+ 'hero_media_name' => 'required|exists:media,name',
+ 'registration_data' => 'required_unless:registration,none',
+ ], [
+ 'title.required' => __('validation.custom_messages.title_required'),
+ 'content.required' => __('validation.custom_messages.content_required'),
+ 'starts_at.required' => __('validation.custom_messages.starts_at_required'),
+ 'ends_at.required' => __('validation.custom_messages.ends_at_required'),
+ 'ends_at.after' => __('validation.custom_messages.ends_at_after'),
+ 'publish_at.required' => __('validation.custom_messages.publish_at_required'),
+ 'closes_at.required' => __('validation.custom_messages.closes_at_required'),
+ 'status.required' => __('validation.custom_messages.status_required'),
+ 'hero_media_name.required' => __('validation.custom_messages.hero_media_name_required'),
+ 'hero_media_name.exists' => __('validation.custom_messages.hero_media_name_exists'),
+ 'registration_data.required_unless' => __('validation.custom_messages.registration_data_required_unless'),
+ ]);
+
+ $workshopData = $request->all();
+ if($workshopData['status'] === 'open' && Carbon::parse($workshopData['starts_at'])->lt(Carbon::now())) {
+ $workshopData['status'] = 'closed';
+ }
+
+ $workshop->update($workshopData);
+
+ session()->flash('message', 'Workshop has been updated');
+ session()->flash('message-title', 'Workshop updated');
+ session()->flash('message-type', 'success');
+ return redirect()->route('admin.workshop.index');
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ */
+ public function admin_destroy(Workshop $workshop)
+ {
+ $workshop->delete();
+ session()->flash('message', 'Workshop has been deleted');
+ session()->flash('message-title', 'Workshop deleted');
+ session()->flash('message-type', 'danger');
+
+ return redirect()->route('admin.workshop.index');
+ }
+}
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
deleted file mode 100644
index 7b83b74..0000000
--- a/app/Http/Kernel.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- */
- protected $middleware = [
- // \App\Http\Middleware\TrustHosts::class,
- \App\Http\Middleware\TrustProxies::class,
- \Illuminate\Http\Middleware\HandleCors::class,
- \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
- \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
- // \App\Http\Middleware\TrimStrings::class,
- // \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
- ];
-
- /**
- * The application's route middleware groups.
- *
- * @var array>
- */
- protected $middlewareGroups = [
- 'web' => [
- \App\Http\Middleware\EncryptCookies::class,
- \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
- \Illuminate\Session\Middleware\StartSession::class,
- \Illuminate\View\Middleware\ShareErrorsFromSession::class,
- \App\Http\Middleware\VerifyCsrfToken::class,
- \Illuminate\Routing\Middleware\SubstituteBindings::class,
- ],
-
- 'api' => [
- // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
- \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api',
- \Illuminate\Routing\Middleware\SubstituteBindings::class,
- // \App\Http\Middleware\ForceJsonResponse::class,
- \App\Http\Middleware\UnmangleRequest::class,
- 'useSanctumGuard',
- \App\Http\Middleware\LogRequest::class,
- ],
- ];
-
- /**
- * The application's middleware aliases.
- *
- * Aliases may be used to conveniently assign middleware to routes and groups.
- *
- * @var array
- */
- protected $middlewareAliases = [
- 'auth' => \App\Http\Middleware\Authenticate::class,
- 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
- 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
- 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
- 'can' => \Illuminate\Auth\Middleware\Authorize::class,
- 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
- 'unmangle' => \App\Http\Middleware\UnmangleRequest::class,
- 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
- 'signed' => \App\Http\Middleware\ValidateSignature::class,
- 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
- 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
- 'useSanctumGuard' => \App\Http\Middleware\UseSanctumGuard::class
- ];
-}
diff --git a/app/Http/Middleware/Admin.php b/app/Http/Middleware/Admin.php
new file mode 100644
index 0000000..faed0f1
--- /dev/null
+++ b/app/Http/Middleware/Admin.php
@@ -0,0 +1,34 @@
+admin == 1) {
+ return $next($request);
+ }
+
+ abort(403, 'Forbidden');
+ }
+
+ session()->put('url.intended', url()->current());
+ return redirect()->route('login');
+ }
+}
diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php
deleted file mode 100644
index 9515a4a..0000000
--- a/app/Http/Middleware/Authenticate.php
+++ /dev/null
@@ -1,23 +0,0 @@
-expectsJson() === false) {
- return route('login');
- }
-
- return null;
- }
-}
diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php
deleted file mode 100644
index 867695b..0000000
--- a/app/Http/Middleware/EncryptCookies.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- */
- protected $except = [
- //
- ];
-}
diff --git a/app/Http/Middleware/ForceJsonResponse.php b/app/Http/Middleware/ForceJsonResponse.php
deleted file mode 100644
index cdfa47e..0000000
--- a/app/Http/Middleware/ForceJsonResponse.php
+++ /dev/null
@@ -1,21 +0,0 @@
-headers->set('Accept', 'application/json');
- return $next($request);
- }
-}
diff --git a/app/Http/Middleware/LogRequest.php b/app/Http/Middleware/LogRequest.php
deleted file mode 100644
index 07e984c..0000000
--- a/app/Http/Middleware/LogRequest.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 'apirequest',
- 'path' => $request->path(),
- ]);
-
- return $response;
- } catch (\Error $e) {
- report($e);
- return $response;
- }
- }
-}
diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php
deleted file mode 100644
index 74cbd9a..0000000
--- a/app/Http/Middleware/PreventRequestsDuringMaintenance.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- */
- protected $except = [
- //
- ];
-}
diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php
deleted file mode 100644
index 5ee6f4b..0000000
--- a/app/Http/Middleware/RedirectIfAuthenticated.php
+++ /dev/null
@@ -1,33 +0,0 @@
-check() === true) {
- return redirect(RouteServiceProvider::HOME);
- }
- }
-
- return $next($request);
- }
-}
diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php
deleted file mode 100644
index 88cadca..0000000
--- a/app/Http/Middleware/TrimStrings.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
- */
- protected $except = [
- 'current_password',
- 'password',
- 'password_confirmation',
- ];
-}
diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php
deleted file mode 100644
index c9c58bd..0000000
--- a/app/Http/Middleware/TrustHosts.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- */
- public function hosts(): array
- {
- return [
- $this->allSubdomainsOfApplicationUrl(),
- ];
- }
-}
diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php
deleted file mode 100644
index 3123f50..0000000
--- a/app/Http/Middleware/TrustProxies.php
+++ /dev/null
@@ -1,25 +0,0 @@
-|string|null
- */
- protected $proxies;
-
- /**
- * The headers that should be used to detect proxies.
- *
- * @var integer
- */
- // @codingStandardsIgnoreStart
- protected $headers = (Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB);
- // @codingStandardsIgnoreEnd
-}
diff --git a/app/Http/Middleware/UnmangleRequest.php b/app/Http/Middleware/UnmangleRequest.php
deleted file mode 100644
index a903651..0000000
--- a/app/Http/Middleware/UnmangleRequest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-all();
-
- $string = $_SERVER['QUERY_STRING'];
- $parts = explode('&', $string);
- foreach ($parts as $part) {
- $key = $part;
- $splitPos = strpos($key, '=');
- if ($splitPos !== false) {
- $key = urldecode(substr($key, 0, $splitPos));
- }
-
- $replace_key = str_replace('.', '_', $key);
- if (strpos($key, '.') !== false && array_key_exists($replace_key, $params) === true) {
- $params[$key] = $params[$replace_key];
- unset($params[$replace_key]);
- }
- }
-
- $request->replace($params);
- }//end if
-
- return $next($request);
- }
-}
diff --git a/app/Http/Middleware/UseSanctumGuard.php b/app/Http/Middleware/UseSanctumGuard.php
deleted file mode 100644
index 24a6c21..0000000
--- a/app/Http/Middleware/UseSanctumGuard.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- */
- protected $except = [
- // 'fbclid',
- // 'utm_campaign',
- // 'utm_content',
- // 'utm_medium',
- // 'utm_source',
- // 'utm_term',
- ];
-}
diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php
deleted file mode 100644
index 9e86521..0000000
--- a/app/Http/Middleware/VerifyCsrfToken.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- */
- protected $except = [
- //
- ];
-}
diff --git a/app/Http/Requests/AnalyticsRequest.php b/app/Http/Requests/AnalyticsRequest.php
deleted file mode 100644
index 25ee6eb..0000000
--- a/app/Http/Requests/AnalyticsRequest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
- */
- public function postRules(): array
- {
- return [
- 'type' => 'required|string',
- ];
- }
-
- /**
- * Get the validation rules that apply to PUT request.
- *
- * @return array
- */
- public function putRules(): array
- {
- return [
- 'type' => 'string',
- 'useragent' => 'string',
- 'ip' => 'ipv4|ipv6',
- 'session' => 'number',
- ];
- }
-}
diff --git a/app/Http/Requests/ArticleRequest.php b/app/Http/Requests/ArticleRequest.php
deleted file mode 100644
index 2ad76d7..0000000
--- a/app/Http/Requests/ArticleRequest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- */
- public function postRules(): array
- {
- return [
- 'slug' => 'required|string|min:6|unique:articles',
- 'title' => 'required|string|min:6|max:255',
- 'publish_at' => 'required|date',
- 'user_id' => 'required|uuid|exists:users,id',
- 'content' => 'required|string|min:6',
- 'hero' => 'required|uuid|exists:media,id',
- ];
- }
-
- /**
- * Get the validation rules that apply to PUT request.
- *
- * @return array
- */
- public function putRules(): array
- {
- return [
- 'slug' => [
- 'string',
- 'min:6',
- Rule::unique('articles')->ignoreModel($this->article),
- ],
- 'title' => 'string|min:6|max:255',
- 'publish_at' => 'date',
- 'user_id' => 'uuid|exists:users,id',
- 'content' => 'string|min:6',
- 'hero' => 'uuid|exists:media,id',
- ];
- }
-}
diff --git a/app/Http/Requests/AuthLoginRequest.php b/app/Http/Requests/AuthLoginRequest.php
deleted file mode 100644
index f450276..0000000
--- a/app/Http/Requests/AuthLoginRequest.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
- */
- public function rules(): array
- {
- return [
- 'email' => 'required|string|min:6|max:255',
- 'password' => 'required|string|min:6',
- ];
- }
-}
diff --git a/app/Http/Requests/BaseRequest.php b/app/Http/Requests/BaseRequest.php
deleted file mode 100644
index ac1e009..0000000
--- a/app/Http/Requests/BaseRequest.php
+++ /dev/null
@@ -1,107 +0,0 @@
-isMethod('post') === true && method_exists($this, 'postAuthorize') === true) {
- return $this->postAuthorize();
- } elseif (
- (
- request()->isMethod('put') === true || request()->isMethod('patch') === true
- ) && method_exists($this, 'putAuthorize') === true
- ) {
- return $this->putAuthorize();
- } elseif (request()->isMethod('delete') === true && method_exists($this, 'destroyAuthorize') === true) {
- return $this->deleteAuthorize();
- }
-
- return true;
- }
-
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules(): array
- {
- $rules = [];
-
- if (method_exists($this, 'baseRules') === true) {
- $rules = $this->baseRules();
- }
-
- if (method_exists($this, 'postRules') === true && request()->isMethod('post') === true) {
- $rules = $this->mergeRules($rules, $this->postRules());
- } elseif (
- method_exists($this, 'putRules') === true && (
- request()->isMethod('put') === true || request()->isMethod('patch') === true
- )
- ) {
- $rules = $this->mergeRules($rules, $this->putRules());
- } elseif (method_exists($this, 'destroyRules') === true && request()->isMethod('delete') === true) {
- $rules = $this->mergeRules($rules, $this->destroyRules());
- }
-
- return $rules;
- }
-
- /**
- * Merge two collections of rules.
- *
- * @param array $collection1 The first collection of rules.
- * @param array $collection2 The second collection of rules to merge.
- * @return array
- */
- private function mergeRules(array $collection1, array $collection2): array
- {
- $rules = [];
-
- foreach ($collection1 as $key => $ruleset) {
- if (array_key_exists($key, $collection2) === true) {
- if (is_string($collection1[$key]) === true && is_string($collection2[$key]) === true) {
- $rules[$key] = $collection1[$key] . '|' . $collection2[$key];
- } else {
- $key_ruleset = [];
-
- if (is_array($collection1[$key]) === true) {
- $key_ruleset = $collection1[$key];
- } elseif (is_string($collection1[$key]) === true) {
- $key_ruleset = explode('|', $collection1[$key]);
- }
-
- if (is_array($collection2[$key]) === true) {
- $key_ruleset = array_merge($key_ruleset, $collection2[$key]);
- } elseif (is_string($collection2[$key]) === true) {
- $key_ruleset = array_merge($key_ruleset, explode('|', $collection2[$key]));
- }
-
- if (count($key_ruleset) > 0) {
- $rules[$key] = $key_ruleset;
- }
- }//end if
- } else {
- $rules[$key] = $ruleset;
- }//end if
- }//end foreach
-
- foreach ($collection2 as $key => $ruleset) {
- if (array_key_exists($key, $rules) === false) {
- $rules[$key] = $collection2[$key];
- }
- }
-
- return $rules;
- }
-}
diff --git a/app/Http/Requests/ContactSendRequest.php b/app/Http/Requests/ContactSendRequest.php
deleted file mode 100644
index fc9881e..0000000
--- a/app/Http/Requests/ContactSendRequest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- */
- public function rules(): array
- {
- return [
- 'name' => 'required|max:255',
- 'email' => 'required|email|max:255',
- 'content' => 'required|max:2000',
- // 'captcha_token' => [new Recaptcha()],
- ];
- }
-}
diff --git a/app/Http/Requests/EventRequest.php b/app/Http/Requests/EventRequest.php
deleted file mode 100644
index e6eeb99..0000000
--- a/app/Http/Requests/EventRequest.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
- */
- public function baseRules(): array
- {
- return [
- 'title' => 'min:6',
- 'location' => [
- Rule::in(['online', 'physical']),
- ],
- 'address' => 'string|nullable',
- 'start_at' => 'date',
- 'end_at' => 'date|after:start_date',
- 'publish_at' => 'date|nullable',
- 'status' => [
- Rule::in(['draft', 'soon', 'open', 'closed', 'cancelled', 'scheduled', 'full']),
- ],
- 'registration_type' => [
- Rule::in(['none', 'email', 'link', 'message']),
- ],
- 'registration_data' => [
- Rule::when(strcasecmp('email', $this->attributes->get('registration_type')) == 0, 'required|email'),
- Rule::when(strcasecmp('link', $this->attributes->get('registration_type')) == 0, 'required|url'),
- Rule::when(strcasecmp('message', $this->attributes->get('registration_type')) == 0, 'required|message'),
- ],
- 'hero' => 'uuid|exists:media,id',
- 'location_url' => 'sometimes|string|max:255',
- ];
- }
-
- /**
- * Apply the additional POST base rules to this request
- *
- * @return array
- */
- protected function postRules(): array
- {
- return [
- 'title' => 'required',
- 'location' => 'required',
- 'address' => 'required_if:location,physical',
- 'start_at' => 'required',
- 'end_at' => 'required',
- 'status' => 'required',
- 'registration_type' => 'required',
- 'hero' => 'required',
- ];
- }
-}
diff --git a/app/Http/Requests/MediaRequest.php b/app/Http/Requests/MediaRequest.php
deleted file mode 100644
index 5becd25..0000000
--- a/app/Http/Requests/MediaRequest.php
+++ /dev/null
@@ -1,33 +0,0 @@
- [
- Rule::requiredIf(function () {
- return request()->has('chunk') && request('chunk') != 1;
- }),
- 'string',
- ],
- 'name' => [
- Rule::requiredIf(function () {
- return request()->has('chunk') && request('chunk') == 1;
- }),
- 'string',
- ],
- 'chunk' => 'required_with:chunk_count|integer|min:1|max:999|lte:chunk_count',
- 'chunk_count' => 'required_with:chunk|integer|min:1',
- ];
- }
-}
diff --git a/app/Http/Requests/ShortlinkRequest.php b/app/Http/Requests/ShortlinkRequest.php
deleted file mode 100644
index 2a3b67c..0000000
--- a/app/Http/Requests/ShortlinkRequest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- */
- public function postRules(): array
- {
- return [
- 'code' => 'required|string|max:255|min:2|unique:shortlinks',
- 'url' => 'required|string|max:255|min:2',
- ];
- }
-
- /**
- * Get the validation rules that apply to PUT request.
- *
- * @return array
- */
- public function putRules(): array
- {
- $shortlink = $this->route('shortlink');
-
- return [
- 'code' => ['required', 'string', 'max:255', 'min:2', Rule::unique('shortlinks')->ignore($shortlink->id)],
- 'url' => 'required|string|max:255|min:2',
- ];
- }
-}
diff --git a/app/Http/Requests/SubscriptionRequest.php b/app/Http/Requests/SubscriptionRequest.php
deleted file mode 100644
index 7395fe8..0000000
--- a/app/Http/Requests/SubscriptionRequest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- */
- public function postRules(): array
- {
- return [
- 'email' => 'required|email|unique:subscriptions',
- // 'captcha_token' => [new Recaptcha()],
- ];
- }
-
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function destroyRules(): array
- {
- return [
- 'email' => 'required|email',
- // 'captcha_token' => [new Recaptcha()],
- ];
- }
-
- /**
- * Get the custom error messages.
- *
- * @return array
- */
- public function messages(): array
- {
- return [
- 'email.unique' => 'This email address has already subscribed',
- ];
- }
-}
diff --git a/app/Http/Requests/UserForgotPasswordRequest.php b/app/Http/Requests/UserForgotPasswordRequest.php
deleted file mode 100644
index c45d56f..0000000
--- a/app/Http/Requests/UserForgotPasswordRequest.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- */
- public function rules(): array
- {
- return [
- 'email' => 'required|exists:users,email',
- // 'captcha_token' => [new Recaptcha()],
- ];
- }
-}
diff --git a/app/Http/Requests/UserRegisterRequest.php b/app/Http/Requests/UserRegisterRequest.php
deleted file mode 100644
index 5557663..0000000
--- a/app/Http/Requests/UserRegisterRequest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- */
- public function rules(): array
- {
- return [
- 'display_name' => ['required','string','max:255', new Uniqueish('users')],
- 'email' => 'required|string|email|max:255|unique:users',
- 'password' => 'required|string|min:8',
- ];
- }
-}
diff --git a/app/Http/Requests/UserRequest.php b/app/Http/Requests/UserRequest.php
deleted file mode 100644
index bcaf651..0000000
--- a/app/Http/Requests/UserRequest.php
+++ /dev/null
@@ -1,111 +0,0 @@
-
- */
- public function postRules(): array
- {
- $user = auth()->user();
- $isAdminUser = $user->hasPermission('admin/users');
-
- return [
- 'first_name' => (
- $isAdminUser === true ? 'required_with:last_name,display_name,phone' : 'required'
- ) . '|string|max:255|min:2',
- 'last_name' => (
- $isAdminUser === true ? 'required_with:first_name,display_name,phone' : 'required'
- ) . '|string|max:255|min:2',
- 'display_name' => [
- $isAdminUser === true ? 'required_with:first_name,last_name,phone' : 'required',
- 'string',
- 'max:255',
- new Uniqueish('users')
- ],
- 'email' => 'required|string|email|max:255|unique:users',
- 'phone' => ['string', 'regex:/^(\+|00)?[0-9][0-9 \-\(\)\.]{7,32}$/'],
- 'email_verified_at' => 'date'
- ];
- }
-
- /**
- * Get the validation rules that apply to PUT request.
- *
- * @return array
- */
- public function putRules(): array
- {
- $user = auth()->user();
- $ruleUser = $this->route('user');
- $isAdminUser = $user->hasPermission('admin/users');
-
- $requiredIfFieldsPresent = function (array $fields) use ($ruleUser): RequiredIf {
- return new RequiredIf(function () use ($fields, $ruleUser) {
- $input = $this->all();
- $values = Arr::only($input, $fields);
-
- foreach ($values as $key => $value) {
- if ($value !== null && $value !== '') {
- return true;
- }
- }
-
- $fields = array_diff($fields, array_keys($values));
-
- foreach ($fields as $field) {
- if ($ruleUser->$field !== '') {
- return true;
- }
- }
-
- return false;
- });
- };
-
- return [
- 'first_name' => [
- 'sometimes',
- $isAdminUser === true ? $requiredIfFieldsPresent(['last_name', 'display_name', 'phone']) : 'required',
- 'string',
- 'between:2,255',
- ],
- 'last_name' => [
- 'sometimes',
- $isAdminUser === true ? $requiredIfFieldsPresent(['first_name', 'last_name', 'phone']) : 'required',
- 'string',
- 'between:2,255',
- ],
- 'display_name' => [
- 'sometimes',
- $isAdminUser === true ? $requiredIfFieldsPresent(['first_name', 'display_name', 'phone']) : 'required',
- 'string',
- 'between:2,255',
- (new Uniqueish('users', 'display_name'))->ignore($ruleUser->id)
- ],
- 'email' => [
- 'string',
- 'email',
- 'max:255',
- Rule::unique('users')->ignore($ruleUser->id)->when(
- $this->email !== $ruleUser->email,
- function ($query) {
- return $query->where('email', $this->email);
- }
- ),
- ],
- 'phone' => ['nullable', 'regex:/^(\+|00)?[0-9][0-9 \-\(\)\.]{7,32}$/'],
- 'password' => "nullable|string|min:8"
- ];
- }
-}
diff --git a/app/Http/Requests/UserResendVerifyEmailRequest.php b/app/Http/Requests/UserResendVerifyEmailRequest.php
deleted file mode 100644
index 09e6442..0000000
--- a/app/Http/Requests/UserResendVerifyEmailRequest.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- */
- public function rules(): array
- {
- return [
- 'email' => 'required|exists:users,email',
- // 'captcha_token' => [new Recaptcha()],
- ];
- }
-}
diff --git a/app/Http/Requests/UserResetPasswordRequest.php b/app/Http/Requests/UserResetPasswordRequest.php
deleted file mode 100644
index 55141e5..0000000
--- a/app/Http/Requests/UserResetPasswordRequest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- */
- public function rules(): array
- {
- return [
- 'code' => 'required|digits:6',
- 'password' => 'required|string|min:8',
- // 'captcha_token' => [new Recaptcha()],
- ];
- }
-}
diff --git a/app/Http/Requests/UserVerifyEmailRequest.php b/app/Http/Requests/UserVerifyEmailRequest.php
deleted file mode 100644
index 29c017e..0000000
--- a/app/Http/Requests/UserVerifyEmailRequest.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- */
- public function rules(): array
- {
- return [
- 'code' => 'required|digits:6',
- // 'captcha_token' => [new Recaptcha()],
- ];
- }
-}
diff --git a/app/Jobs/Media/GenerateVariants.php b/app/Jobs/Media/GenerateVariants.php
new file mode 100644
index 0000000..4c70c5c
--- /dev/null
+++ b/app/Jobs/Media/GenerateVariants.php
@@ -0,0 +1,113 @@
+media_name = $media->name;
+ $this->overwrite = $overwrite;
+ }
+
+ /**
+ * Get the middleware the job should pass through.
+ *
+ * @return array
+ */
+ public function middleware(): array
+ {
+ return [new WithoutOverlapping($this->media_name)];
+ }
+
+ /**
+ * Execute the job.
+ */
+ public function handle(): void
+ {
+ $media = Media::find($this->media_name);
+ if ($media === null) {
+ return;
+ }
+
+ if(Storage::disk('media')->exists($media->hash) === false) {
+ return;
+ }
+
+ $variantData = $media->getVariantTypes($matchingMimeType);
+ if(count($variantData) === 0) {
+ return;
+ }
+
+ $temp = $media->getAsTempFile();
+ if($temp === null) {
+ return;
+ }
+
+ $tempDir = pathinfo($temp, PATHINFO_DIRNAME);
+ $media->deleteAllVariants();
+
+ /* Images */
+ if($matchingMimeType === 'image/*') {
+ $manager = new ImageManager(new Driver());
+ $image = $manager->read($temp);
+
+ $isPortrait = $image->height() > $image->width();
+
+ foreach ($variantData as $variantName => $size) {
+ $image = $manager->read($temp);
+
+ if($isPortrait === true) {
+ $width = $size['height'];
+ $height = $size['width'];
+ } else {
+ $width = $size['width'];
+ $height = $size['height'];
+ }
+
+ if($variantName !== 'scaled' && ($image->height() < $height || $image->width() < $width)) {
+ continue;
+ }
+
+ $image->scaleDown($width, $height);
+ $variantFile = $tempDir . '/' . $media->hash . '-' . $variantName . '.webp';
+ $image->save($variantFile, quality: 75);
+
+ $media->addVariant($variantName, 'image/webp', 'webp', $variantFile);
+ }//end foreach
+ }
+ }
+}
diff --git a/app/Jobs/MediaWorkerJob.php b/app/Jobs/MediaWorkerJob.php
deleted file mode 100644
index 69e1c8a..0000000
--- a/app/Jobs/MediaWorkerJob.php
+++ /dev/null
@@ -1,393 +0,0 @@
-mediaJob = $mediaJob;
- }
-
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle(): void
- {
- $media = $this->mediaJob->media()->first();
- $newMedia = false;
- $data = json_decode($this->mediaJob->data, true);
-
- try {
- // FILE
- if (array_key_exists('file', $data) === true) {
- if (file_exists($data['file']) === false) {
- $this->throwMediaJobFailure('temporary upload file no longer exists');
- }
-
- // convert HEIC files to JPG
- $fileExtension = File::extension($data['file']);
- if ($fileExtension === 'heic') {
- $this->mediaJob->setStatusProcessing(0, 0, 'converting image');
-
- // Get the path without the file name
- $uploadedFileDirectory = dirname($data['file']);
-
- // Convert the HEIC file to JPG
- $jpgFileName = pathinfo($data['file'], PATHINFO_FILENAME) . '.jpg';
- $jpgFilePath = $uploadedFileDirectory . '/' . $jpgFileName;
- if (file_exists($jpgFilePath) === true) {
- $this->throwMediaJobFailure('file already exists on server');
- }
-
- Image::make($data['file'])->save($jpgFilePath);
-
- // Update the uploaded file path and file name
- unlink($data['file']);
- $data['file'] = $jpgFileName;
- }//end if
-
- // get security
- $security = [];
- if ($media === null) {
- if (array_key_exists('security', $data) === true) {
- $security = $data['security'];
- }
- } else {
- $security['type'] = $media->security_type;
- $security['data'] = $media->security_data;
- }
-
- // get storage
- $storage = '';
- if ($media === null) {
- if (array_key_exists('storage', $data) === true) {
- $storage = $data['storage'];
- }
- } else {
- $storage = $media->storage;
- }
-
- if ($storage === '') {
- if (count($security) === 0 || $security['type'] === '') {
- if (strpos($data['mime_type'], 'image/') === 0) {
- $storage = 'local';
- } else {
- $storage = 'cdn';
- }
- } else {
- $storage = 'private';
- }
- }
-
- // Check if file already exists
- $exists = Storage::disk($storage)->exists($data['name']);
- if ($exists === true) {
- if (array_key_exists('noreplace', $data) === true && isTrue($data['noreplace']) === true) {
- $this->throwMediaJobFailure('file already exists on server');
- }
- }
-
- if ($exists === true) {
- $pathInfo = pathinfo($data['name']);
- $basename = $pathInfo['filename'];
- $extension = $pathInfo['extension'];
- $index = 0;
-
- do {
- $index++;
- $data['name'] = $basename . '-' . $index . '.' . $extension;
- } while (Storage::disk($storage)->exists($data['name']) === true);
- }
-
- if ($media === null) {
- $newMedia = true;
- $media = new Media([
- 'user_id' => $this->mediaJob->user_id,
- 'title' => $data['title'],
- 'name' => $data['name'],
- 'mime_type' => $data['mime_type'],
- 'size' => $data['size'],
- 'security_type' => $data['security']['type'],
- 'security_data' => $data['security']['data'],
- 'storage' => $storage,
- ]);
- }//end if
-
- $media->setStagingFile($data['file']);
- } else {
- if ($media === null) {
- $this->throwMediaJobFailure('The media item no longer exists');
- }
- }//end if
-
- if (array_key_exists('transform', $data) === true) {
- $media->createStagingFile();
-
- // Modifications
- if (strpos($media->mime_type, 'image/') === 0) {
- $modified = false;
- $image = Image::make($media->getStagingFilePath());
-
- // ROTATE
- if (array_key_exists("rotate", $data['transform']) === true) {
- $rotate = intval($data['transform']['rotate']);
- if ($rotate !== 0) {
- $this->mediaJob->setStatusProcessing(0, 0, 'rotating image');
- $image = $image->rotate($rotate);
- $modified = true;
- }
- }
-
- // FLIP-H/V
- if (array_key_exists('flip', $data['transform']) === true) {
- if (stripos($data['transform']['flip'], 'h') !== false) {
- $this->mediaJob->setStatusProcessing(0, 0, 'flipping image');
- $image = $image->flip('h');
- $modified = true;
- }
-
- if (stripos($data['transform']['flip'], 'v') !== false) {
- $this->mediaJob->setStatusProcessing(0, 0, 'flipping image');
- $image = $image->flip('v');
- $modified = true;
- }
- }
-
- // CROP
- if (array_key_exists("crop", $data['transform']) === true) {
- $cropData = $data['transform']['crop'];
- $width = intval(arrayDefaultValue("width", $cropData, $image->getWidth()));
- $height = intval(arrayDefaultValue("height", $cropData, $image->getHeight()));
- $x = intval(arrayDefaultValue("x", $cropData, 0));
- $y = intval(arrayDefaultValue("y", $cropData, 0));
-
- $this->mediaJob->setStatusProcessing(0, 0, 'cropping image');
- $image = $image->crop($width, $height, $x, $y);
- $modified = true;
- }//end if
-
- if ($modified === true) {
- $image->save();
- }
- } elseif (strpos($data['mime_type'], 'video/') === 0) {
- $stagingFilePath = $media->getStagingFilePath();
- $ffmpeg = FFMpeg\FFMpeg::create();
- $video = $ffmpeg->open($stagingFilePath);
- $format = $this->detectVideoFormat($stagingFilePath);
- $modified = false;
-
- if ($format === null) {
- $this->mediaJob->setStatusFailed('Unsupported video format');
- return;
- }
-
- /** @var FFMpeg\Media\Video::filters */
- $filters = $video->filters();
-
- // ROTATE
- if (array_key_exists("rotate", $data['transform']) === true) {
- $rotate = intval($data['transform']['rotate']);
- $rotate = (($rotate % 360 + 360) % 360); // remove excess rotations
- $rotate = intval(round($rotate / 90) * 90); // round to nearest 90%
-
- if ($rotate > 0) {
- $this->mediaJob->setStatusProcessing(0, 0, 'rotating video');
-
- if ($rotate === 90) {
- $filters->rotate(FFMpeg\Filters\Video\RotateFilter::ROTATE_270);
- $modified = true;
- } elseif ($rotate === 180) {
- $filters->rotate(FFMpeg\Filters\Video\RotateFilter::ROTATE_180);
- $modified = true;
- } elseif ($rotate === 270) {
- $filters->rotate(FFMpeg\Filters\Video\RotateFilter::ROTATE_90);
- $modified = true;
- }
- }
- }
-
- // FLIP-H/V
- if (array_key_exists('flip', $data['transform']) === true) {
- if (stripos($data['transform']['flip'], 'h') !== false) {
- $this->mediaJob->setStatusProcessing(0, 0, 'flipping video');
- $filters->hflip()->synchronize();
- $modified = true;
- }
-
- if (stripos($data['transform']['flip'], 'v') !== false) {
- $this->mediaJob->setStatusProcessing(0, 0, 'flipping video');
- $filters->vflip()->synchronize();
- $modified = true;
- }
- }
-
- // CROP
- if (array_key_exists("crop", $data['transform']) === true) {
- $cropData = $data['transform']['crop'];
- $videoStream = $video->getStreams()->videos()->first();
-
- $width = intval(arrayDefaultValue("width", $cropData, $videoStream->get('width')));
- $height = intval(arrayDefaultValue("height", $cropData, $videoStream->get('height')));
- $x = intval(arrayDefaultValue("x", $cropData, 0));
- $y = intval(arrayDefaultValue("y", $cropData, 0));
-
- $cropDimension = new Dimension($width, $height);
-
- $this->mediaJob->setStatusProcessing(0, 0, 'cropping video');
- $filters->crop($cropDimension, $x, $y)->synchronize();
- $modified = true;
- }//end if
-
- $tempFilePath = generateTempFilePath(pathinfo($stagingFilePath, PATHINFO_EXTENSION));
- if (method_exists($format, 'on') === true) {
- $mediaJob = $this->mediaJob;
- $format->on('progress', function ($video, $format, $percentage) use ($mediaJob) {
- $mediaJob->setStatusProcessing($percentage, 100, 'transcoded');
- });
- }
-
- if ($modified === true) {
- $video->save($format, $tempFilePath);
- $media->changeStagingFile($tempFilePath);
- }
- }//end if
- }//end if
-
- // Update attributes
- if (array_key_exists('title', $data) === true) {
- $media->title = $data['title'];
- }
-
- // Relocate file (if requested)
- if (array_key_exists('security', $data) === true && array_key_exists('type', $data['security']) === true) {
- $media->security_type = $data['security']['type'];
- $media->security_data = $data['security']['data'];
- }
-
- if (array_key_exists('storage', $data) === true) {
- if ($media->storage !== $data['storage']) {
- $media->createStagingFile();
- Storage::disk($media->storage)->delete($media->name);
- $media->storage = $data['storage'];
- }
- }
-
- // Finish media object
- if ($media->hasStagingFile() === true) {
- $this->mediaJob->setStatusProcessing(0, 0, 'transferring to cdn');
- $media->deleteFile();
- $media->saveStagingFile(true);
- }
-
- $media->save();
- $this->mediaJob->media_id = $media->id;
- $this->mediaJob->setStatusComplete();
- } catch (\Exception $e) {
- if ($this->mediaJob->status !== 'failed') {
- $this->mediaJob->setStatusFailed('Unexpected server error occurred');
- }
-
- if ($media !== null) {
- $media->deleteStagingFile();
- if ($newMedia === true) {
- $media->delete();
- }
- }
-
- Log::error($e->getMessage() . "\n" . $e->getFile() . " - " . $e->getLine() . "\n" . $e->getTraceAsString());
- $this->fail($e);
- }//end try
- }
-
- /**
- * Detects the format of a video using FFProbe
- *
- * @param string $videoPath The video file path.
- * @return VideoInterface | null
- */
- public function detectVideoFormat(string $videoPath): VideoInterface | null
- {
- $ffprobe = FFProbe::create();
-
- $videoStream = $ffprobe
- ->streams($videoPath) // Provide the path to the video file
- ->videos() // Filter video streams
- ->first();
-
- $codecName = $videoStream->get('codec_name');
-
- $codecToFormatClass = [
- 'h264' => 'FFMpeg\Format\Video\X264',
- 'wmv2' => 'FFMpeg\Format\Video\WMV',
- 'vp9' => 'FFMpeg\Format\Video\WebM',
- 'theora' => 'FFMpeg\Format\Video\Ogg',
- 'mpeg4' => 'FFMpeg\Format\Video\Mpeg4',
- // Add more mappings as needed
- ];
-
- if (isset($codecToFormatClass[$codecName]) === false) {
- Log::info("Unsupported codec: $codecName");
- return null;
- }
-
- $formatClassName = $codecToFormatClass[$codecName];
-
- if (class_exists($formatClassName) === false) {
- Log::info("Format class does not exist: $formatClassName");
- return null;
- }
-
- return new $formatClassName();
- }
-
- /**
- * Set failure status of MediaJob and throw exception.
- *
- * @param string $error The failure message.
- * @return void
- */
- private function throwMediaJobFailure(string $error): void
- {
- $this->mediaJob->setStatusFailed($error);
- throw new \Exception($error);
- }
-}
diff --git a/app/Jobs/ProcessMedia.php b/app/Jobs/ProcessMedia.php
new file mode 100644
index 0000000..d2cad1f
--- /dev/null
+++ b/app/Jobs/ProcessMedia.php
@@ -0,0 +1,43 @@
+file = $file;
+ }
+
+ /**
+ * Execute the job.
+ */
+ public function handle(): void
+ {
+ if(Storage::disk('temp')->exists($this->media->name)) {
+
+ }
+ }
+}
diff --git a/app/Jobs/SendEmailJob.php b/app/Jobs/SendEmail.php
similarity index 87%
rename from app/Jobs/SendEmailJob.php
rename to app/Jobs/SendEmail.php
index 89d7d1f..0044d95 100644
--- a/app/Jobs/SendEmailJob.php
+++ b/app/Jobs/SendEmail.php
@@ -10,12 +10,9 @@ use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Mail;
-class SendEmailJob implements ShouldQueue
+class SendEmail implements ShouldQueue
{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
+ use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Mail to receipt
@@ -31,7 +28,6 @@ class SendEmailJob implements ShouldQueue
*/
public $mailable;
-
/**
* Create a new job instance.
*
diff --git a/app/Mail/ChangeEmailVerify.php b/app/Mail/ChangeEmailVerify.php
deleted file mode 100644
index dc7618f..0000000
--- a/app/Mail/ChangeEmailVerify.php
+++ /dev/null
@@ -1,79 +0,0 @@
-user = $user;
- $this->code = $code;
- $this->new_email = $new_email;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: '👋🏻 Lets change your email!',
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.change_email_verify',
- text: 'emails.user.change_email_verify_plain',
- );
- }
-}
diff --git a/app/Mail/ChangedEmail.php b/app/Mail/ChangedEmail.php
deleted file mode 100644
index ded99d1..0000000
--- a/app/Mail/ChangedEmail.php
+++ /dev/null
@@ -1,79 +0,0 @@
-user = $user;
- $this->old_email = $old_email;
- $this->new_email = $new_email;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: '👍 Your email has been changed!',
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.changed_email',
- text: 'emails.user.changed_email_plain',
- );
- }
-}
diff --git a/app/Mail/ChangedPassword.php b/app/Mail/ChangedPassword.php
deleted file mode 100644
index ecc62c2..0000000
--- a/app/Mail/ChangedPassword.php
+++ /dev/null
@@ -1,61 +0,0 @@
-user = $user;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: '👍 Your password has been changed!',
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.changed_password',
- text: 'emails.user.changed_password_plain',
- );
- }
-}
diff --git a/app/Mail/Contact.php b/app/Mail/Contact.php
deleted file mode 100644
index db4924e..0000000
--- a/app/Mail/Contact.php
+++ /dev/null
@@ -1,78 +0,0 @@
-name = $name;
- $this->email = $email;
- $this->content = $content;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: config('contact.contact_subject'),
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.contact',
- text: 'emails.user.contact_plain',
- );
- }
-}
diff --git a/app/Mail/EmailUpdateLink.php b/app/Mail/EmailUpdateLink.php
new file mode 100644
index 0000000..6f41744
--- /dev/null
+++ b/app/Mail/EmailUpdateLink.php
@@ -0,0 +1,39 @@
+token = $token;
+ $this->username = $username;
+ $this->email = $email;
+ $this->newEmail = $newEmail;
+ }
+
+ public function build()
+ {
+ return $this
+ ->subject('Confirm new email address')
+ ->markdown('emails.change-email-link')
+ ->with([
+ 'token' => $this->token,
+ 'username' => $this->username,
+ 'email' => $this->email,
+ 'newEmail' => $this->newEmail,
+ ]);
+ }
+}
diff --git a/app/Mail/EmailVerify.php b/app/Mail/EmailVerify.php
deleted file mode 100644
index 4f23fd4..0000000
--- a/app/Mail/EmailVerify.php
+++ /dev/null
@@ -1,70 +0,0 @@
-user = $user;
- $this->code = $code;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: '👋🏻 Welcome to STEMMechanics!',
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.email_verify',
- text: 'emails.user.email_verify_plain',
- );
- }
-}
diff --git a/app/Mail/ExceptionMail.php b/app/Mail/ExceptionMail.php
deleted file mode 100644
index 1728ee2..0000000
--- a/app/Mail/ExceptionMail.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
- */
- public function attachments(): array
- {
- return [];
- }
-}
diff --git a/app/Mail/ForgotPassword.php b/app/Mail/ForgotPassword.php
deleted file mode 100644
index f182c43..0000000
--- a/app/Mail/ForgotPassword.php
+++ /dev/null
@@ -1,70 +0,0 @@
-user = $user;
- $this->code = $code;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: '🤦 Forgot your password?',
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.forgot_password',
- text: 'emails.user.forgot_password_plain',
- );
- }
-}
diff --git a/app/Mail/LoginLink.php b/app/Mail/LoginLink.php
new file mode 100644
index 0000000..38517c8
--- /dev/null
+++ b/app/Mail/LoginLink.php
@@ -0,0 +1,36 @@
+token = $token;
+ $this->username = $username;
+ $this->email = $email;
+ }
+
+ public function build()
+ {
+ return $this
+ ->subject('Here\'s your login link')
+ ->markdown('emails.login-link')
+ ->with([
+ 'token' => $this->token,
+ 'username' => $this->username,
+ 'email' => $this->email,
+ ]);
+ }
+}
diff --git a/app/Mail/RegisterLink.php b/app/Mail/RegisterLink.php
new file mode 100644
index 0000000..646f4b5
--- /dev/null
+++ b/app/Mail/RegisterLink.php
@@ -0,0 +1,36 @@
+token = $token;
+ $this->username = $username;
+ $this->email = $email;
+ }
+
+ public function build()
+ {
+ return $this
+ ->subject('Here\'s your registration link')
+ ->markdown('emails.register-link')
+ ->with([
+ 'token' => $this->token,
+ 'username' => $this->username,
+ 'email' => $this->email,
+ ]);
+ }
+}
diff --git a/app/Mail/SubscriptionConfirm.php b/app/Mail/SubscriptionConfirm.php
deleted file mode 100644
index 3eca6dd..0000000
--- a/app/Mail/SubscriptionConfirm.php
+++ /dev/null
@@ -1,61 +0,0 @@
-email = $email;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: '🗞️ You\'re on the mailing list!',
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.subscription_confirm',
- text: 'emails.user.subscription_confirm_plain',
- );
- }
-}
diff --git a/app/Mail/SubscriptionUnsubscribed.php b/app/Mail/SubscriptionUnsubscribed.php
deleted file mode 100644
index 552c4a4..0000000
--- a/app/Mail/SubscriptionUnsubscribed.php
+++ /dev/null
@@ -1,61 +0,0 @@
-email = $email;
- }
-
- /**
- * Get the message envelope.
- *
- * @return Illuminate\Mail\Mailables\Envelope
- */
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: 'You have been unsubscribed',
- );
- }
-
- /**
- * Get the message content definition.
- *
- * @return Illuminate\Mail\Mailables\Content
- */
- public function content(): Content
- {
- return new Content(
- view: 'emails.user.subscription_unsubscribed',
- text: 'emails.user.subscription_unsubscribed_plain',
- );
- }
-}
diff --git a/app/MediaServices/Converters/HEICToJPEG.php b/app/MediaServices/Converters/HEICToJPEG.php
new file mode 100644
index 0000000..3543126
--- /dev/null
+++ b/app/MediaServices/Converters/HEICToJPEG.php
@@ -0,0 +1,97 @@
+getData(ImageInterface::class, function() use ($data) {
+ $manager = new ImageManager(new Driver());
+ $image = $manager->read($data->file());
+ if($image === null) {
+ throw new MediaServiceException('Could not read file.');
+ }
+
+ return $image;
+ });
+
+ $quality = $data->option('heictojpeg', 'quality', 90);
+ $encoded = $image->toJpeg($quality);
+ $encoded->save($data->file()); // this needs to be renamed with the new extension
+
+ if(!$data->nextSupports(ImageInterface::class)) {
+ $image->save();
+ $data->removeData(ImageInterface::class);
+ }
+
+ Image::make($tempFile)
+ ->save($tempJpgFile);
+
+ $media->set
+ $media->mime_type = 'image/jpeg';
+
+
+
+ /*****/
+
+
+ $filePath = $file['dirname'] . '/' . $file['name'] . '.' . $file['extension'];
+ $jpgFileName = MediaController::makeNewFilename($file['name'], 'jpg');
+
+ Image::make($filePath)
+ ->save($file['dirname'] . '/' . $jpgFileName);
+
+ $file['name'] = pathinfo($jpgFileName, PATHINFO_FILENAME);
+ $file['extension'] = 'jpg';
+ $file['mime_type'] = 'image/jpeg';
+ $file['size'] = filesize($file['dirname'] . '/' . $jpgFileName);
+
+ unlink($filePath);
+
+ return true;
+ }
+}
diff --git a/app/MediaServices/MediaService.php b/app/MediaServices/MediaService.php
new file mode 100644
index 0000000..d1014c2
--- /dev/null
+++ b/app/MediaServices/MediaService.php
@@ -0,0 +1,37 @@
+data[$key] ?? $default;
+ }
+
+ /**
+ * Set the data in the data array.
+ *
+ * @param string $key The key to set.
+ * @param mixed $value The value to set.
+ * @return void
+ */
+ public function set(string $key, $value): void
+ {
+ $this->data[$key] = $value;
+ }
+
+ /**
+ * Get the data from the data array or create it if it does not exist.
+ *
+ * @param string $key The key to get.
+ * @param callable $default The default value to return if the key does not exist.
+ * @return mixed The value of the key.
+ */
+ public function getChainData(string $key, callable $default)
+ {
+ if (!isset($this->data[$key])) {
+ $this->data[$key] = $default();
+ }
+
+ return $this->data[$key];
+ }
+}
diff --git a/app/MediaServices/Transformers/ImageRotate.php b/app/MediaServices/Transformers/ImageRotate.php
new file mode 100644
index 0000000..cd94214
--- /dev/null
+++ b/app/MediaServices/Transformers/ImageRotate.php
@@ -0,0 +1,76 @@
+getData(ImageInterface::class, function() use ($data) {
+ $manager = new ImageManager(new Driver());
+ $image = $manager->read($data->file());
+ if($image === null) {
+ throw new MediaServiceException('Could not read file.');
+ }
+
+ return $image;
+ });
+
+ $degrees = $data->option('rotate', 'degrees', 90);
+ $image->rotate($degrees);
+
+ if(!$data->nextSupports(ImageInterface::class)) {
+ $image->save();
+ $data->removeData(ImageInterface::class);
+ }
+ }
+}
diff --git a/app/Models/AnalyticsItemRequest.php b/app/Models/AnalyticsItemRequest.php
deleted file mode 100644
index a130017..0000000
--- a/app/Models/AnalyticsItemRequest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- */
- protected $fillable = [
- 'type',
- 'path'
- ];
-
-
- /**
- * Model Boot.
- *
- * @return void
- */
- protected static function boot()
- {
- parent::boot();
-
- static::creating(function (AnalyticsItemRequest $analytics) {
- if (isset($analytics->session_id) !== true) {
- $request = request();
- if ($request !== null) {
- $session = AnalyticsSession::where('ip', $request->ip())
- ->where('useragent', $request->userAgent())
- ->where('ended_at', '>=', now()->subMinutes(30))
- ->first();
- if ($session === null) {
- $session = AnalyticsSession::create([
- 'ip' => $request->ip(),
- 'useragent' => $request->userAgent(),
- 'ended_at' => now()
- ]);
- } else {
- $session->update(['ended_at' => now()]);
- }
-
- $analytics->session_id = $session->id;
- }
- }//end if
- });
- }
-
- /**
- * Return the Analytics Session model.
- *
- * @return BelongsTo
- */
- public function session(): BelongsTo
- {
- return $this->belongsTo(AnalyticsSession::class, 'id', 'session_id');
- }
-}
diff --git a/app/Models/AnalyticsSession.php b/app/Models/AnalyticsSession.php
deleted file mode 100644
index 3e7b653..0000000
--- a/app/Models/AnalyticsSession.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- */
- protected $fillable = [
- 'ip',
- 'useragent',
- 'ended_at'
- ];
-
- /**
- * Set the "useragent" attribute.
- *
- * @param mixed $value
- * @return void
- */
- public function setUseragentAttribute($value)
- {
- $this->attributes['useragent'] = $value !== null ? $value : '';
- }
-
- /**
- * Returns the related requests for this session.
- *
- * @return Illuminate\Database\Eloquent\Relations\HasMany
- */
- public function requests(): HasMany {
- return $this->hasMany(AnalyticsItemRequest::class, 'session_id', 'id');
- }
-
-}
diff --git a/app/Models/Article.php b/app/Models/Article.php
deleted file mode 100644
index bf23035..0000000
--- a/app/Models/Article.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- */
- protected $fillable = [
- 'title',
- 'slug',
- 'publish_at',
- 'content',
- 'user_id',
- 'hero'
- ];
-
-
- /**
- * Get the article user
- *
- * @return Illuminate\Database\Eloquent\Relations\BelongsTo
- */
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
-}
diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php
deleted file mode 100644
index 37848f8..0000000
--- a/app/Models/Attachment.php
+++ /dev/null
@@ -1,86 +0,0 @@
-
- */
- protected $fillable = [
- 'media_id',
- 'private',
- ];
-
- /**
- * The default attributes.
- *
- * @var string[]
- */
- protected $attributes = [
- 'private' => false,
- ];
-
-
- /**
- * Get the media for this attachment.
- *
- * @return BelongsTo
- */
- public function media(): BelongsTo
- {
- return $this->belongsTo(Media::class);
- }
-
- /**
- * Get associated Media object.
- *
- * @return null|Media
- */
- public function getMediaAttribute(): ?Media
- {
- $mediaId = '0';
- $media = null;
-
- if (Cache::has("attachment:{$this->id}:media") === true) {
- $mediaId = Cache::get("attachment:{$this->id}:media");
- } else {
- $media = $this->media()->first();
- if ($media === null) {
- return null;
- }
-
- $mediaId = $media->id;
- Cache::put("attachment:{$this->id}:media", $mediaId, now()->addDays(28));
- }
-
- return Cache::remember("media:{$mediaId}", now()->addDays(28), function () use ($media) {
- if ($media !== null) {
- return $media;
- }
-
- return $this->media()->first();
- });
- }
-
- /**
- * Set the media for this item.
- *
- * @param Media $media The media model.
- * @return void
- */
- public function setMediaAttribute(Media $media): void
- {
- $this->media()->associate($media)->save();
- Cache::put("attachment:{$this->id}:media", $media->id, now()->addDays(28));
- }
-}
diff --git a/app/Models/Subscription.php b/app/Models/EmailSubscriptions.php
similarity index 73%
rename from app/Models/Subscription.php
rename to app/Models/EmailSubscriptions.php
index 73d94a8..66bcdaf 100644
--- a/app/Models/Subscription.php
+++ b/app/Models/EmailSubscriptions.php
@@ -2,21 +2,20 @@
namespace App\Models;
-use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
-class Subscription extends Model
+class EmailSubscriptions extends Model
{
use HasFactory;
- use Uuids;
/**
* The attributes that are mass assignable.
*
- * @var array
+ * @var array
*/
protected $fillable = [
'email',
+ 'confirmed'
];
}
diff --git a/app/Models/EmailUpdate.php b/app/Models/EmailUpdate.php
new file mode 100644
index 0000000..3f2501f
--- /dev/null
+++ b/app/Models/EmailUpdate.php
@@ -0,0 +1,30 @@
+belongsTo(User::class);
+ }
+}
diff --git a/app/Models/Event.php b/app/Models/Event.php
deleted file mode 100644
index 54c36e7..0000000
--- a/app/Models/Event.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- */
- protected $fillable = [
- 'title',
- 'location',
- 'location_url',
- 'address',
- 'start_at',
- 'end_at',
- 'publish_at',
- 'status',
- 'registration_type',
- 'registration_data',
- 'hero',
- 'content',
- 'price',
- 'ages',
- 'open_at',
- ];
-
-
- /**
- * Get all the associated users.
- *
- * @return BelongsToMany
- */
- public function users(): BelongsToMany
- {
- return $this->belongsToMany(User::class, 'event_user', 'event_id', 'user_id');
- }
-}
diff --git a/app/Models/EventUsers.php b/app/Models/EventUsers.php
deleted file mode 100644
index 5ba5daa..0000000
--- a/app/Models/EventUsers.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
- */
- protected $fillable = [
- 'event_id',
- 'user_id',
- ];
-
-
- /**
- * Get the event for this attachment.
- *
- * @return Illuminate\Database\Eloquent\Relations\BelongsTo
- */
- public function event(): BelongsTo
- {
- return $this->belongsTo(Event::class);
- }
-
- /**
- * Get the user for this attachment.
- *
- * @return Illuminate\Database\Eloquent\Relations\BelongsTo
- */
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
-}
diff --git a/app/Models/Gallery.php b/app/Models/Gallery.php
deleted file mode 100644
index c453af8..0000000
--- a/app/Models/Gallery.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
- */
- protected $fillable = [
- 'media_id',
- ];
-
-
- /**
- * Boot the model.
- *
- * @return void
- */
- protected static function boot(): void
- {
- parent::boot();
-
- $clearCache = function ($gallery) {
- Cache::forget("gallery:{$gallery->id}:media");
- };
-
- static::saving($clearCache);
- static::deleting($clearCache);
- }
-
- /**
- * Get gallery addendum model.
- *
- * @return Illuminate\Database\Eloquent\Relations\MorphTo Addenum model.
- */
- public function addendum(): MorphTo
- {
- return $this->morphTo();
- }
-
- /**
- * Get the media for this item.
- *
- * @return Illuminate\Database\Eloquent\Relations\BelongsTo The media model.
- */
- public function media(): BelongsTo
- {
- return $this->belongsTo(Media::class);
- }
-
- /**
- * Get the media for this item.
- *
- * @return null|Media The media model.
- */
- public function getMediaAttribute(): ?Media
- {
- $mediaId = '0';
- $media = null;
-
- if (Cache::has("gallery:{$this->id}:media") === true) {
- $mediaId = Cache::get("gallery:{$this->id}:media");
- } else {
- $media = $this->media()->first();
- if ($media === null) {
- return null;
- }
-
- $mediaId = $media->id;
- Cache::put("gallery:{$this->id}:media", $mediaId, now()->addDays(28));
- }
-
- return Cache::remember("media:{$mediaId}", now()->addDays(28), function () use ($media) {
- if ($media !== null) {
- return $media;
- }
-
- return $this->media()->first();
- });
- }
-
- /**
- * Set the media for this item.
- *
- * @param Media $media The media model.
- * @return void
- */
- public function setMediaAttribute(Media $media): void
- {
- $this->media()->associate($media)->save();
- Cache::put("gallery:{$this->id}:media", $media->id, now()->addDays(28));
- }
-}
diff --git a/app/Models/Location.php b/app/Models/Location.php
new file mode 100644
index 0000000..aa62ca9
--- /dev/null
+++ b/app/Models/Location.php
@@ -0,0 +1,14 @@
+
+ * @var array
*/
protected $fillable = [
- 'title',
- 'user_id',
- 'mime_type',
- 'security_type',
- 'security_data',
- 'storage',
- 'description',
'name',
+ 'title',
+ 'mime_type',
'size',
+ 'user_id',
+ 'hash'
];
/**
- * The attributes that are appended.
+ * The primary key for the model.
*
- * @var array
+ * @var string
*/
- protected $appends = [
- 'url',
- ];
+ protected $primaryKey = 'name';
/**
- * The default attributes.
+ * The key type for the model.
*
- * @var string[]
+ * @var string
*/
- protected $attributes = [
- 'storage' => 'cdn',
- 'variants' => '[]',
- 'description' => '',
- 'dimensions' => '',
- 'security_type' => '',
- 'security_data' => '',
- 'thumbnail' => '',
- ];
+ protected $keyType = 'string';
/**
- * The storage file list cache.
+ * Indicates if the IDs are auto-incrementing.
+ *
+ * @var bool
+ */
+ public $incrementing = false;
+
+ /**
+ * The attributes that should be cast.
*
* @var array
*/
- protected static $storageFileListCache = [];
+ protected $casts = [
+ 'variants' => 'array'
+ ];
/**
- * Object variant details.
+ * The "booted" method of the model.
+ *
+ * @return void
+ */
+ protected $appends = [
+ 'url',
+ 'thumbnail'
+ ];
+
+ /**
+ * Media variant details.
*
* @var int[][][]
*/
- protected static $objectVariants = [
- 'image' => [
- 'small' => ['width' => 300, 'height' => 225],
- 'medium' => ['width' => 768, 'height' => 576],
- 'large' => ['width' => 1024, 'height' => 768],
- 'xlarge' => ['width' => 1536, 'height' => 1152],
- 'xxlarge' => ['width' => 2048, 'height' => 1536],
+ protected static $variants = [
+ 'image/*' => [
+ 'thumbnail' => ['width' => 250, 'height' => 250],
+ 'sm' => ['width' => 300, 'height' => 225],
+ 'md' => ['width' => 768, 'height' => 576],
+ 'lg' => ['width' => 1024, 'height' => 768],
+ 'xl' => ['width' => 1536, 'height' => 1152],
+ '2xl' => ['width' => 2048, 'height' => 1536],
'scaled' => ['width' => 2560, 'height' => 1920]
]
];
- /**
- * Staging file path of asset for processing.
- *
- * @var string
- */
- private $stagingFilePath = "";
-
-
- /**
- * Model Boot
- *
- * @return void
- */
- protected static function boot(): void
+ public static function boot()
{
parent::boot();
- $clearCache = function ($media) {
- Cache::forget("media:{$media->id}");
- };
+ static::deleting(function($media) {
+ $hash = $media->hash;
+ if(Media::where('hash', $hash)->count() > 1) {
+ return;
+ }
- static::updating(function ($media) use ($clearCache) {
- $clearCache($media);
- });
+ $disk = Storage::disk('media');
+ if($disk->exists($hash)) {
+ $disk->delete($hash);
+ }
- static::deleting(function ($media) use ($clearCache) {
- $clearCache($media);
- $media->deleteFile();
+ $media->deleteAllVariants();
});
}
/**
- * Get Object Variants.
- *
- * @param string $type The variant object to get.
- * @return array The variant data.
- */
- public static function getObjectVariants(string $type): array
- {
- if (isset(self::$objectVariants[$type]) === true) {
- return self::$objectVariants[$type];
- }
-
- return [];
- }
-
- /**
- * Variants Get Mutator.
- *
- * @param mixed $value The value to mutate.
- * @param boolean $raw Values are not run through urlencode.
- * @return array|null The mutated value.
- */
- public function getVariantsAttribute(mixed $value, bool $raw = false): array|null
- {
- if (is_string($value) === true) {
- $decodedValue = json_decode($value, true);
-
- // Check if the decoded value is an array
- if ($raw === false && is_array($decodedValue) === true) {
- // Loop through the array and encode each value
- foreach ($decodedValue as &$item) {
- if (is_string($item) === true) {
- $item = rawurlencode($item);
- }
- }
- }
-
- return $decodedValue;
- }
-
- return [];
- }
-
- /**
- * Variants Set Mutator.
- *
- * @param mixed $value The value to mutate.
- * @return void
- */
- public function setVariantsAttribute(mixed $value): void
- {
- if (is_array($value) !== true) {
- $value = [];
- }
-
- $this->attributes['variants'] = json_encode(($value ?? []));
- }
-
- /**
- * Get previous variant.
- *
- * @param string $type The variant type.
- * @param string $variant The initial variant.
- * @return string The previous variant name (or '').
- */
- public function getPreviousVariant(string $type, string $variant): string
- {
- if (isset(self::$objectVariants[$type]) === false) {
- return '';
- }
-
- $variants = self::$objectVariants[$type];
- $keys = array_keys($variants);
-
- $currentIndex = array_search($variant, $keys);
- if ($currentIndex === false || $currentIndex === 0) {
- return '';
- }
-
- return $keys[($currentIndex - 1)];
- }
-
- /**
- * Get next variant.
- *
- * @param string $type The variant type.
- * @param string $variant The initial variant.
- * @return string The next variant name (or '').
- */
- public function getNextVariant(string $type, string $variant): string
- {
- if (isset(self::$objectVariants[$type]) === false) {
- return '';
- }
-
- $variants = self::$objectVariants[$type];
- $keys = array_keys($variants);
-
- $currentIndex = array_search($variant, $keys);
- if ($currentIndex === false || $currentIndex === (count($keys) - 1)) {
- return '';
- }
-
- return $keys[($currentIndex + 1)];
- }
-
- /**
- * Get variant URL.
- *
- * @param string $variant The variant to find.
- * @param boolean $returnNearest Return the nearest variant if request is not found.
- * @return string The URL.
- */
- public function getVariantURL(string $variant, bool $returnNearest = true): string
- {
- $variants = $this->variants;
- if (isset($variants[$variant]) === true) {
- return self::getUrlPath(['name' => $variants[$variant]]);
- }
-
- if ($returnNearest === true) {
- $variantType = explode('/', $this->mime_type)[0];
- $previousVariant = $variant;
- while (empty($previousVariant) === false) {
- $previousVariant = $this->getPreviousVariant($variantType, $previousVariant);
- if (empty($previousVariant) === false && isset($variants[$previousVariant]) === true) {
- return self::getUrlPath(['name' => $variants[$previousVariant]]);
- }
- }
- }
-
- return '';
- }
-
- /**
- * Delete file and associated files with the modal.
- *
- * @return void
- */
- public function deleteFile(): void
- {
- if (
- strlen($this->storage) > 0 && strlen($this->name) > 0 &&
- Storage::disk($this->storage)->exists($this->name) === true
- ) {
- Storage::disk($this->storage)->delete($this->name);
- }
-
- $this->deleteThumbnail();
- $this->deleteVariants();
- $this->invalidateCFCache();
- }
-
- /**
- * Invalidate Cloudflare Cache.
- *
- * @return void
- */
- private function invalidateCFCache(): void
- {
- $zone_id = env("CLOUDFLARE_ZONE_ID");
- $api_key = env("CLOUDFLARE_API_KEY");
- if ($zone_id !== null && $api_key !== null && $this->url !== "") {
- $urls = [$this->url];
-
- foreach ($this->variants as $variant => $name) {
- $urls[] = str_replace($this->name, $name, $this->url);
- }
-
- $curl = curl_init();
- curl_setopt_array($curl, [
- CURLOPT_URL => "https://api.cloudflare.com/client/v4/zones/" . $zone_id . "/purge_cache",
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_CUSTOMREQUEST => "DELETE",
- CURLOPT_POSTFIELDS => json_encode(["files" => $urls]),
- CURLOPT_HTTPHEADER => [
- "Content-Type: application/json",
- "Authorization: Bearer " . $api_key
- ],
- ]);
- curl_exec($curl);
- curl_close($curl);
- }//end if
- }
-
- /**
- * Get URL path
- *
- * @param array $replacements Replace variables in URL.
- * @return string
- */
- public function getUrlPath(array $replacements = []): string
- {
- $url = config("filesystems.disks.$this->storage.url");
-
- if (empty($replacements) !== true) {
- foreach ($replacements as $key => $value) {
- $placeholder = '{' . $key . '}';
- $url = str_replace($placeholder, $value, $url);
- }
- }
-
- // Remove any remaining {x} placeholders
- $url = preg_replace('/\{[^}]+\}/', '', $url);
-
- return "$url";
- }
-
- /**
- * Return the file URL
- *
- * @return string
+ * Get the URL of the media.
*/
public function getUrlAttribute(): string
{
- $url = self::getUrlPath([
- 'id' => rawurlencode($this->id),
- 'name' => rawurlencode($this->name)
- ]);
-
- return $url;
+ return Storage::disk('media')->url($this->name);
}
- /**
- * Return the file owner
- *
- * @return BelongsTo
- */
- public function user(): BelongsTo
+ public function url($variant, $strict = false): string
{
- return $this->belongsTo(User::class);
- }
-
- /**
- * Transform the media through the Media Job Queue
- *
- * @param array $transform The transform data.
- * @return MediaJob
- */
- public function transform(array $transform): MediaJob
- {
- $mediaJob = new MediaJob([
- 'media_id' => $this->media,
- 'user_id' => auth()->user()?->id,
- 'data' => json_encode(['transform' => $transform]),
- ]);
-
- try {
- MediaWorkerJob::dispatch($mediaJob)->onQueue('media');
- return $mediaJob;
- } catch (\Exception $e) {
- $this->error('Failed to transform media');
- throw $e;
- }//end try
-
- return null;
- }
-
- /**
- * Get the server maximum upload size
- *
- * @return integer
- */
- public static function getMaxUploadSize(): int
- {
- $sizes = [
- ini_get('upload_max_filesize'),
- ini_get('post_max_size'),
- ini_get('memory_limit')
- ];
-
- foreach ($sizes as &$size) {
- $size = trim($size);
- $last = strtolower($size[(strlen($size) - 1)]);
- switch ($last) {
- case 'g':
- $size = (intval($size) * 1024);
- // Size is in MB - fallthrough
- case 'm':
- $size = (intval($size) * 1024);
- // Size is in KB - fallthrough
- case 'k':
- $size = (intval($size) * 1024);
- // Size is in B - fallthrough
- }
- }
-
- return min($sizes);
- }
-
- /**
- * Generate a file name that is available within storage.
- *
- * @param string $fileName The proposed file name.
- * @return string|boolean The available file name or false if failed.
- */
- public static function generateUniqueFileName(string $fileName)
- {
- $index = 1;
- $maxTries = 100;
- $extension = pathinfo($fileName, PATHINFO_EXTENSION);
- $fileName = static::sanitizeFilename(pathinfo($fileName, PATHINFO_FILENAME));
-
- if (
- static::fileNameHasSuffix($fileName) === true ||
- static::fileExistsInStorage("$fileName.$extension") === true //||
- // Media::where('name', "$fileName.$extension")->where('status', 'not like', 'failed%')->exists() === true
- ) {
- $fileName .= '-';
- for ($i = 1; $i < $maxTries; $i++) {
- $fileNameIndex = $fileName . $index;
- if (
- static::fileExistsInStorage("$fileNameIndex.$extension") !== true &&
- Media::where('name', "$fileNameIndex.$extension")
- // ->where('status', 'not like', 'Failed%')
- ->exists() !== true
- ) {
- return "$fileNameIndex.$extension";
- }
-
- ++$index;
- }
-
- return false;
- }
-
- return "$fileName.$extension";
- }
-
- /**
- * Determines if the file name exists in any of the storage disks.
- *
- * @param string $fileName The file name to check.
- * @param boolean $ignoreCache Ignore the file list cache.
- * @return boolean If the file exists on any storage disks.
- */
- public static function fileExistsInStorage(string $fileName, bool $ignoreCache = false): bool
- {
- $disks = array_keys(Config::get('filesystems.disks'));
-
- if ($ignoreCache === false) {
- if (count(static::$storageFileListCache) === 0) {
- $disks = array_keys(Config::get('filesystems.disks'));
-
- foreach ($disks as $disk) {
- try {
- static::$storageFileListCache[$disk] = Storage::disk($disk)->allFiles();
- } catch (\Exception $e) {
- Log::error("Cannot get a file list for storage device '$disk'. Error: " . $e->getMessage());
- continue;
- }
- }
- }
-
- foreach (static::$storageFileListCache as $disk => $files) {
- if (in_array($fileName, $files) === true) {
- return true;
- }
- }
+ if(!$strict) {
+ $data = $this->getClosestVariant($variant);
} else {
- $disks = array_keys(Config::get('filesystems.disks'));
-
- foreach ($disks as $disk) {
- try {
- if (Storage::disk($disk)->exists($fileName) === true) {
- return true;
- }
- } catch (\Exception $e) {
- Log::error($e->getMessage());
- throw new \Exception("Cannot verify if file '$fileName' already exists in storage device '$disk'");
- }
+ if($this->variants === null || !array_key_exists($variant, $this->variants)) {
+ return '';
}
- }//end if
- return false;
- }
-
- /**
- * Test if the file name contains a special suffix.
- *
- * @param string $fileName The file name to test.
- * @return boolean If the file name contains the special suffix.
- */
- public static function fileNameHasSuffix(string $fileName): bool
- {
- $suffix = '/(-\d+x\d+|-scaled|-thumb)$/i';
- $fileNameWithoutExtension = pathinfo($fileName, PATHINFO_FILENAME);
-
- return preg_match($suffix, $fileNameWithoutExtension) === 1;
- }
-
- /**
- * Sanitize fileName for upload
- *
- * @param string $fileName Filename to sanitize.
- * @return string
- */
- private static function sanitizeFilename(string $fileName): string
- {
- /*
- # file system reserved https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
- [<>:"/\\\|?*]|
-
- # control characters http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
- [\x00-\x1F]|
-
- # non-printing characters DEL, NO-BREAK SPACE, SOFT HYPHEN
- [\x7F\xA0\xAD]|
-
- # URI reserved https://www.rfc-editor.org/rfc/rfc3986#section-2.2
- [#\[\]@!$&\'()+,;=]|
-
- # URL unsafe characters https://www.ietf.org/rfc/rfc1738.txt
- [{}^\~`]
- */
-
- $fileName = preg_replace(
- '~
- [<>:"/\\\|?*]|
- [\x00-\x1F]|
- [\x7F\xA0\xAD]|
- [#\[\]@!$&\'()+,;=]|
- [{}^\~`]
- ~x',
- '-',
- $fileName
- );
-
- $fileName = ltrim($fileName, '.-');
-
- $fileName = preg_replace([
- // "file name.zip" becomes "file-name.zip"
- '/ +/',
- // "file___name.zip" becomes "file-name.zip"
- '/_+/',
- // "file---name.zip" becomes "file-name.zip"
- '/-+/'
- ], '-', $fileName);
- $fileName = preg_replace([
- // "file--.--.-.--name.zip" becomes "file.name.zip"
- '/-*\.-*/',
- // "file...name..zip" becomes "file.name.zip"
- '/\.{2,}/'
- ], '.', $fileName);
- // lowercase for windows/unix interoperability http://support.microsoft.com/kb/100625
- $fileName = mb_strtolower($fileName, mb_detect_encoding($fileName));
- // ".file-name.-" becomes "file-name"
- $fileName = trim($fileName, '.-');
-
- $ext = pathinfo($fileName, PATHINFO_EXTENSION);
- $fileName = mb_strcut(
- pathinfo($fileName, PATHINFO_FILENAME),
- 0,
- (255 - ($ext !== '' ? strlen($ext) + 1 : 0)),
- mb_detect_encoding($fileName)
- ) . ($ext !== '' ? '.' . $ext : '');
- return $fileName;
- }
-
- /**
- * Get the Staging File path.
- *
- * @param boolean $create Create staging file if doesn't exist.
- * @return string
- */
- public function getStagingFilePath(bool $create = true): string
- {
- if ($this->stagingFilePath === "" && $create === true) {
- $this->createStagingFile();
+ $data = [
+ 'variant' => $variant,
+ 'name' => pathinfo($this->name, PATHINFO_FILENAME) . '-' . $variant . '.' . $this->variants[$variant]['extension'],
+ 'mime_type' => $this->variants[$variant]['mime_type'],
+ 'file' => $this->path() . '-' . $variant
+ ];
}
- return $this->stagingFilePath;
+
+ return Storage::disk('media')->url($this->name) . ($data['variant'] !== '' ? '?' . $data['variant'] : '');
}
/**
- * Set the Staging File for processing.
- *
- * @param string $path The path if the new staging file.
- * @param boolean $overwrite Overwrite existing file.
- * @return void
+ * Get the thumbnail of the media.
*/
- public function setStagingFile(string $path, bool $overwrite = false): void
+ public function getThumbnailAttribute(): string
{
- if ($this->stagingFilePath !== "") {
- if ($overwrite === true) {
- unlink($this->stagingFilePath);
- } else {
- // ignore request
- return;
- }
+ $url = $this->url('thumbnail', true);
+ if($url !== '') {
+ return $url;
}
- $this->stagingFilePath = $path;
- }
+ $thumbnail = '/thumbnails/' . pathinfo($this->name, PATHINFO_EXTENSION) . '.webp';
- /**
- * Download temporary copy of the storage file for staging.
- *
- * @return boolean If download was successful.
- */
- public function createStagingFile(): bool
- {
- if ($this->stagingFilePath === "") {
- $readStream = Storage::disk($this->storage)->readStream($this->name);
- $filePath = generateTempFilePath(pathinfo($this->name, PATHINFO_EXTENSION));
-
- $writeStream = fopen($filePath, 'w');
- while (feof($readStream) !== true) {
- fwrite($writeStream, fread($readStream, 8192));
- }
- fclose($readStream);
- fclose($writeStream);
-
- $this->stagingFilePath = $filePath;
- }//end if
-
- return $this->stagingFilePath !== "";
- }
-
- /**
- * Save the Staging File to storage
- *
- * @param boolean $delete Delete the existing staging file.
- * @param boolean $silent Update the status field with the progress.
- * @return void
- */
- public function saveStagingFile(bool $delete = true, bool $silent = false): void
- {
- if ($this->stagingFilePath !== '') {
- if (strlen($this->storage) > 0 && strlen($this->name) > 0) {
- if (Storage::disk($this->storage)->exists($this->name) === true) {
- Storage::disk($this->storage)->delete($this->name);
- }
-
- /** @var Illuminate\Filesystem\FilesystemAdapter */
- $fileSystem = Storage::disk($this->storage);
- $fileSystem->putFileAs('/', $this->stagingFilePath, $this->name);
- }
-
- $this->generateThumbnail();
- $this->generateVariants();
-
- if ($delete === true) {
- $this->deleteStagingFile();
- }
- }//end if
- }
-
- /**
- * Clean up temporary file.
- *
- * @return void
- */
- public function deleteStagingFile(): void
- {
- if ($this->stagingFilePath !== "") {
- unlink($this->stagingFilePath);
- $this->stagingFilePath = "";
- }
- }
-
- /**
- * Change staging file, removing the old file if present
- *
- * @param string $newFile The new staging file.
- * @return void
- */
- public function changeStagingFile(string $newFile): void
- {
- if ($this->stagingFilePath !== "") {
- unlink($this->stagingFilePath);
+ if(file_exists(public_path($thumbnail))) {
+ return asset($thumbnail);
}
- $this->stagingFilePath = $newFile;
+ return asset('/thumbnails/unknown.webp');
}
/**
- * Is a staging file present
- *
- * @return boolean
+ * Get the user that owns the media.
*/
- public function hasStagingFile(): bool
+ public function user()
{
- return $this->stagingFilePath !== "";
+ return $this->belongsTo(User::class, 'user_id');
}
/**
- * Generate a Thumbnail for this media.
- *
- * @return boolean If generation was successful.
+ * Get all the models attached to the media.
*/
- public function generateThumbnail(): bool
+ public function mediable()
{
- $thumbnailWidth = 200;
- $thumbnailHeight = 200;
-
- // delete existing thumbnail
- if (strlen($this->thumbnail) !== 0) {
- $path = pathinfo($this->thumbnail, PATHINFO_BASENAME);
- if (strlen($path) > 0 && Storage::disk($this->storage)->exists($path) === true) {
- Storage::disk($this->storage)->delete($path);
- }
- }
-
- $filePath = $this->getStagingFilePath();
-
- $fileExtension = File::extension($this->name);
- $tempImagePath = tempnam(sys_get_temp_dir(), 'thumb');
- $newFilename = pathinfo($this->name, PATHINFO_FILENAME) . "-" . uniqid() . "-thumb.webp";
- $success = false;
-
- if ($this->security_type === '') {
- if (strpos($this->mime_type, 'image/') === 0) {
- $image = Image::make($filePath);
- $image->orientate();
- $image->resize($thumbnailWidth, $thumbnailHeight, function ($constraint) {
- $constraint->aspectRatio();
- });
- $image->fit($thumbnailWidth, $thumbnailHeight);
- $image->encode('webp', 75)->save($tempImagePath);
- $success = true;
- } elseif ($this->mime_type === 'application/pdf' && extension_loaded('imagick') === true) {
- $pdfPreview = new \Imagick();
- $pdfPreview->setResolution(300, 300);
- $pdfPreview->readImage($filePath . '[0]');
- $pdfPreview->setImageFormat('webp');
- $pdfPreview->thumbnailImage($thumbnailWidth, $thumbnailHeight, true);
- file_put_contents($tempImagePath, $pdfPreview);
-
- $success = true;
- } elseif ($this->mime_type === 'text/plain') {
- $image = Image::canvas($thumbnailWidth, $thumbnailHeight, '#FFFFFF');
-
- // Read the first few lines of the text file
- $numLines = 5;
- $text = file_get_contents($filePath);
- $lines = explode("\n", $text);
- $previewText = implode("\n", array_slice($lines, 0, $numLines));
-
- // Center the text on the image
- $fontSize = 8;
- $textColor = '#000000'; // Black text color
-
- // Calculate the position to start drawing the text
- $x = 10; // Left padding
- $y = 10; // Top padding
-
- // Draw the text on the canvas with text wrapping
- $lines = explode("\n", wordwrap($previewText, 30, "\n", true));
- foreach ($lines as $line) {
- $image->text($line, $x, $y, function ($font) use ($fontSize, $textColor) {
- $font->file(1);
- $font->size($fontSize);
- $font->color($textColor);
- });
-
- // Move to the next line
- $y += ($fontSize + 4); // Add some vertical spacing between lines (adjust as needed)
- }
-
- $image->encode('webp', 75)->save($tempImagePath);
-
- $success = true;
- } elseif (strpos($this->mime_type, 'video/') === 0) {
- $tempImagePath .= '.webp';
-
- try {
- $ffmpeg = FFMpeg::create();
- $video = $ffmpeg->open($filePath);
- $frame = $video->frame(TimeCode::fromSeconds(5));
- $frame->save($tempImagePath);
- } catch (\Exception $e) {
- Log::error($e);
- }
-
- $success = true;
- }//end if
- }//end if
-
- if ($success === true && file_exists($tempImagePath) === true) {
- /** @var Illuminate\Filesystem\FilesystemAdapter */
- $fileSystem = Storage::disk($this->storage);
- $fileSystem->putFileAs('/', new SplFileInfo($tempImagePath), $newFilename);
- unlink($tempImagePath);
-
- $this->thumbnail = $this->getUrlPath(['name' => $newFilename]);
- } else {
- $iconExtension = 'unknown';
- if ($fileExtension !== '') {
- $iconPath = public_path('assets/fileicons/' . $fileExtension . '.webp');
- if (file_exists($iconPath) === true) {
- $iconExtension = $fileExtension;
- }
- }
-
- $this->thumbnail = asset('/assets/fileicons/' . $iconExtension . '.webp');
- }
-
- return $success;
+ return $this->morphTo();
}
/**
- * Delete Media Thumbnail from storage.
+ * Get the media as a temp file.
*
- * @return void
+ * @return string|null The temporary file path or null.
*/
- public function deleteThumbnail(): void
+ public function getAsTempFile(): string|null
{
- if (strlen($this->thumbnail) > 0) {
- $path = pathinfo($this->thumbnail, PATHINFO_BASENAME);
-
- if (strlen($path) > 0 && Storage::disk($this->storage)->exists($path) === true) {
- Storage::disk($this->storage)->delete($path);
- $this->thumbnail = ''; // Clear the thumbnail property
- }
+ if($this->hash === null) {
+ return null;
}
+
+ $file = tempnam(sys_get_temp_dir(), 'media_');
+ $disk = Storage::disk('media');
+ if($disk->exists($this->hash) === false) {
+ return null;
+ }
+
+ $stream = $disk->getDriver()->readStream($this->hash);
+ is_resource($stream) && file_put_contents($file, stream_get_contents($stream), FILE_APPEND);
+ return $file;
+ }
+
+ /**
+ * Set the media from a file.
+ *
+ * @param string $file The file to set.
+ */
+ public function storeFromTempFile(string $file): void
+ {
+ Storage::disk('media')->put($this->name, fopen($file, 'r+'));
}
/**
@@ -862,203 +203,159 @@ class Media extends Model
*
* @return void
*/
- public function generateVariants(): void
+ public function generateVariants(bool $overwrite = true): void
{
- // delete existing variants
- if (is_array($this->variants) === true) {
- foreach ($this->variants as $variantName => $variantFile) {
- if (Storage::disk($this->storage)->exists($variantFile) === true) {
- Storage::disk($this->storage)->delete($variantFile);
- }
- }
+ dispatch(new GenerateVariants($this, $overwrite))->onQueue('media');
+ }
+
+ public function path(): string|null
+ {
+ $disk = Storage::disk('media');
+ if(!$disk->exists($this->hash)) {
+ return null;
}
- $this->variants = [];
- if ($this->security_type === '') {
- if (strpos($this->mime_type, 'image/') === 0) {
- // Generate additional image sizes
- $sizes = Media::getObjectVariants('image');
-
- // download original from CDN if no local file
- $filePath = $this->getStagingFilePath();
-
- $originalImage = Image::make($filePath);
-
- $imageSize = $originalImage->getSize();
- $isPortrait = $imageSize->getHeight() > $imageSize->getWidth();
-
- // Swap width and height values for portrait images
- foreach ($sizes as $variantName => &$size) {
- if ($isPortrait === true) {
- $temp = $size['width'];
- $size['width'] = $size['height'];
- $size['height'] = $temp;
- }
- }
-
- $dimensions = [$originalImage->getWidth(), $originalImage->getHeight()];
- $this->dimensions = implode('x', $dimensions);
-
- foreach ($sizes as $variantName => $size) {
- $postfix = "{$size['width']}x{$size['height']}";
- if ($variantName === 'scaled') {
- $postfix = 'scaled';
- }
-
- $newFilename = pathinfo($this->name, PATHINFO_FILENAME) . "-" . uniqid() . "-$postfix.webp";
-
- // Get the largest available variant
- if ($dimensions[0] >= $size['width'] && $dimensions[1] >= $size['height']) {
- // Store the variant in the variants array
- $variants[$variantName] = $newFilename;
-
- // Resize the image to the variant size if its dimensions are greater than the
- // specified size
- $image = clone $originalImage;
-
- $imageSize = $image->getSize();
- if ($imageSize->getWidth() > $size['width'] || $imageSize->getHeight() > $size['height']) {
- $image->resize($size['width'], $size['height'], function ($constraint) {
- $constraint->aspectRatio();
- $constraint->upsize();
- });
- $image->resizeCanvas($size['width'], $size['height'], 'center', false, 'rgba(0,0,0,0)');
- }
-
- $image->orientate();
-
- // Optimize and store image
- $tempImagePath = tempnam(sys_get_temp_dir(), 'optimize');
- $image->encode('webp', 75)->save($tempImagePath);
- /** @var Illuminate\Filesystem\FilesystemAdapter */
- $fileSystem = Storage::disk($this->storage);
- $fileSystem->putFileAs('/', new SplFileInfo($tempImagePath), $newFilename);
- unlink($tempImagePath);
- }//end if
- }//end foreach
-
- // Set missing variants to the largest available variant
- foreach ($sizes as $variantName => $size) {
- if (isset($variants[$variantName]) === false) {
- $variants[$variantName] = $this->name;
- }
- }
-
- $this->variants = $variants;
- }//end if
- }//end if
+ return $disk->path($this->hash);
}
/**
- * Delete the Media variants from storage.
+ * Add a variant to the media.
+ *
+ * @param string $name The name of the variant.
+ * @param string $mime_type The mime type of the variant.
+ * @param string $file The file to store.
*
* @return void
*/
- public function deleteVariants(): void
+ public function addVariant(string $name, string $mime_type, string $extension, string $file): void
{
- if (strlen($this->name) > 0 && strlen($this->storage) > 0) {
- foreach ($this->variants as $variantName => $fileName) {
- Storage::disk($this->storage)->delete($fileName);
+ $name = strtolower($name);
+ $storage = Storage::disk('media');
+
+ if (isset($this->variants[$name])) {
+ if ($storage->exists($this->hash . '-' . $name)) {
+ $storage->delete($this->hash . '-_' . $name);
}
-
- $this->variants = [];
}
- }
- /**
- * Set Media status to OK
- *
- * @return void
- */
- public function ok(): void
- {
- // $this->status = "OK";
+ $storage->putFileAs('/', $file, $this->hash . '-' . $name);
+
+ $variants = $this->variants;
+ $variants[$name] = [
+ 'mime_type' => $mime_type,
+ 'extension' => $extension
+ ];
+ $this->variants = $variants;
+
$this->save();
}
/**
- * Set Media status to an error
- * @param string $error The error to set.
+ * Does a variant of the media exist.
+ *
+ * @param string $variant The variant to check.
+ *
+ * @return bool True if the variant exists, false otherwise.
+ */
+ public function hasVariant($variant): bool
+ {
+ $variant = strtolower($variant);
+ $storage = Storage::disk('media');
+
+ return $storage->exists($this->hash . '-' . $variant);
+ }
+
+ /**
+ * Delete a variant of the media.
+ *
+ * @param string $variant The variant to delete.
+ *
* @return void
*/
- public function error(string $error = ""): void
+ public function deleteVariant($variant): void
{
- // $this->status = "Error" . ($error !== "" ? ": {$error}" : "");
- $this->save();
- }
+ $variant = strtolower($variant);
+ $storage = Storage::disk('media');
- /**
- * Set Media status
- * @param string $status The status to set.
- * @return void
- */
- public function status(string $status = ""): void
- {
- // $this->status = "Info: " . $status;
- $this->save();
- }
-
- /**
- * Get the associated job models
- *
- * @return HasMany
- */
- public function jobs(): HasMany
- {
- return $this->hasMany(MediaJob::class, 'media_id');
- }
-
- /**
- * Get the recommended storage ID based on mime and security
- *
- * @param string $mime_type The file mime type.
- * @param string $security_type The security requested.
- * @return string
- */
- public static function recommendedStorage(string $mime_type, string $security_type): string
- {
- if ($security_type === '') {
- if (strpos($mime_type, 'image/') === 0) {
- return('local');
- } else {
- return('cdn');
+ if(isset($this->variants[$variant])) {
+ if($storage->exists($this->hash . '-' . $variant)) {
+ $storage->delete($this->hash . '-' . $variant);
}
}
- return('private');
+ unset($this->variants[$variant]);
+
+ $this->save();
}
/**
- * Verify the storage exists. May change the storage value.
+ * Delete all variants of the media.
*
- * @param mixed $mime_type File mime type.
- * @param mixed $security_type Requested security type.
- * @param mixed $storage Reference to the requested storage type.
- * @return integer Error code.
+ * @return void
*/
- public static function verifyStorage(mixed $mime_type, mixed $security_type, mixed &$storage): int
+ public function deleteAllVariants(): void
{
- if ($storage === '') {
- if ($security_type === '') {
- if (strpos($mime_type, 'image/') === 0) {
- $storage = 'local';
- } else {
- $storage = 'cdn';
+ $storage = Storage::disk('media');
+ if($this->variants === null) {
+ return;
+ }
+
+ foreach($this->variants as $variant => $file) {
+ if($storage->exists($this->hash . '-' . $variant)) {
+ $storage->delete($this->hash . '-' . $variant);
+ }
+ }
+
+ $this->variants = null;
+ $this->save();
+ }
+
+ /**
+ * Get the variant types for the media.
+ *
+ * @param string $matchingKey The matching key.
+ *
+ * @return array The variant types.
+ */
+ public function getVariantTypes(&$matchingKey = null)
+ {
+ $key = Helpers::findMatchingMimeTypeKey($this->mime_type, Media::$variants);
+ if($key === false) {
+ $matchingKey = null;
+ return [];
+ }
+
+ $matchingKey = $key;
+ return Media::$variants[$key];
+ }
+
+ public function getClosestVariant($key)
+ {
+ $variants = $this->getVariantTypes();
+
+ if($this->variants && count($variants) > 0) {
+ $found = false;
+ foreach ($variants as $variant => $data) {
+ if($variant === $key) {
+ $found = true;
}
- } else {
- $storage = 'private';
- }
- } else {
- $disks = config('filesystems.disks');
- if (array_key_exists($storage, $disks) === false) {
- return Media::STORAGE_NOT_FOUND;
- }
- if ($security_type !== '' && strcasecmp($storage, 'private') !== 0) {
- return Media::STORAGE_INVALID_SECURITY;
+ if($found && array_key_exists($variant, $this->variants)) {
+ return [
+ 'variant' => $variant,
+ 'name' => pathinfo($this->name, PATHINFO_FILENAME) . '-' . $variant . '.' . $this->variants[$variant]['extension'],
+ 'mime_type' => $this->variants[$variant]['mime_type'],
+ 'file' => $this->path() . '-' . $variant
+ ];
+ }
}
}
- return Media::STORAGE_VALID;
+ return [
+ 'variant' => null,
+ 'name' => $this->name,
+ 'mime_type' => $this->mime_type,
+ 'file' => $this->path()
+ ];
}
}
diff --git a/app/Models/MediaJob.php b/app/Models/MediaJob.php
deleted file mode 100644
index 5ff16b0..0000000
--- a/app/Models/MediaJob.php
+++ /dev/null
@@ -1,239 +0,0 @@
- null,
- 'media_id' => null,
- 'status' => '',
- 'status_text' => '',
- 'progress' => 0,
- 'progress_max' => 0,
- 'data' => '',
- ];
-
-
- /**
- * Set MediaJob status to failed.
- *
- * @param string $statusText The failed reason.
- * @return void
- */
- public function setStatusFailed(string $statusText = ''): void
- {
- $this->setStatus('failed', $statusText, 0);
- }
-
- /**
- * Set MediaJob status to queued.
- *
- * @return void
- */
- public function setStatusQueued(): void
- {
- $this->setStatus('queued', '', 0);
- }
-
- /**
- * Set MediaJob status to waiting.
- *
- * @return void
- */
- public function setStatusWaiting(): void
- {
- $this->setStatus('waiting', '', 0);
- }
-
- /**
- * Set MediaJob status to processing.
- *
- * @param integer $progress The processing progress value.
- * @param integer $progressMax The processing progress maximum value.
- * @param string $statusText The processing status text.
- * @return void
- */
- public function setStatusProcessing(int $progress = 0, int $progressMax = 0, string $statusText = ''): void
- {
- if ($statusText === '') {
- $statusText = $this->status_text;
- }
-
- $this->setStatus('processing', $statusText, $progress, $progressMax);
- }
-
- /**
- * Set MediaJob status to complete.
- *
- * @return void
- */
- public function setStatusComplete(): void
- {
- $this->setStatus('complete');
- }
-
- /**
- * Set MediaJon status to invalid.
- *
- * @param string $text The status text.
- * @return void
- */
- public function setStatusInvalid(string $text = ''): void
- {
- $this->setStatus('invalid', $text);
- }
-
- /**
- * Set MediaJob status details.
- *
- * @param string $status The status string.
- * @param string $text The status text.
- * @param integer $progress The status progress value.
- * @param integer $progress_max The status progress maximum value.
- * @return void
- */
- protected function setStatus(string $status, string $text = '', int $progress = 0, int $progress_max = 0): void
- {
- $this->status = $status;
- $this->status_text = $text;
- $this->progress = $progress;
- $this->progress_max = $progress_max;
- $this->save();
- }
-
- /**
- * Process the MediaJob.
- *
- * @return void
- */
- public function process(): void
- {
- $data = json_decode($this->data, true);
- if ($data !== null) {
- if (array_key_exists('chunks', $data) === true) {
- if (array_key_exists('chunk_count', $data) === false) {
- $this->setStatusInvalid('chunk_count is missing');
- return;
- }
-
- if (array_key_exists('name', $data) === false) {
- $this->setStatusInvalid('name is missing');
- return;
- }
-
- $numChunks = count($data['chunks']);
- $maxChunks = intval($data['chunk_count']);
- if ($numChunks >= $maxChunks) {
- // merge file and dispatch
- $this->setStatusProcessing(0, $maxChunks, 'combining chunks');
-
- $newFile = generateTempFilePath(pathinfo($data['name'], PATHINFO_EXTENSION));
- $failed = false;
-
- for ($index = 1; $index <= $maxChunks; $index++) {
- if (array_key_exists($index, $data['chunks']) === false) {
- $failed = `{$index} chunk is missing`;
- } else {
- $tempFileName = $data['chunks'][$index];
-
- if ($failed === false) {
- $chunkContents = file_get_contents($tempFileName);
- if ($chunkContents === false) {
- $failed = `{$index} chunk is empty`;
- } else {
- file_put_contents($newFile, $chunkContents, FILE_APPEND);
- }
- }
-
- unlink($tempFileName);
- $this->setStatusProcessing($index, $maxChunks);
- }
- }
-
- unset($data['chunks']);
- $this->data = json_encode($data);
-
- if ($failed !== false) {
- $this->setStatusInvalid($failed);
- } else {
- $finfo = finfo_open(FILEINFO_MIME_TYPE);
- $mime = finfo_file($finfo, $newFile);
- finfo_close($finfo);
-
- $data['file'] = $newFile;
- $data['size'] = filesize($newFile);
- $data['mime_type'] = $mime;
-
- if (
- array_key_exists('storage', $data) === true &&
- array_key_exists('security_type', $data) === true &&
- array_key_exists('mime_type', $data) === true &&
- $data['mime_type'] !== ""
- ) {
- $error = Media::verifyStorage($data['mime_type'], $data['security_type'], $data['storage']);
- switch ($error) {
- case Media::STORAGE_VALID:
- break;
- case Media::STORAGE_MIME_MISSING:
- $this->setStatusInvalid('The file type cannot be determined.');
- return;
- case Media::STORAGE_NOT_FOUND:
- $this->setStatusInvalid('Storage was not found.');
- return;
- case Media::STORAGE_INVALID_SECURITY:
- $this->setStatusInvalid('Storage invalid for security value.');
- return;
- default:
- $this->setStatusInvalid('Storage verification error occurred.');
- return;
- }
- }
-
- $this->data = json_encode($data);
- $this->setStatusQueued();
- MediaWorkerJob::dispatch($this)->onQueue('media');
- }//end if
- }//end if
- } else {
- $this->setStatusQueued();
- MediaWorkerJob::dispatch($this)->onQueue('media');
- }//end if
- }//end if
- }
-
- /**
- * Return the job owner
- *
- * @return BelongsTo
- */
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
-
- /**
- * Return the media item
- *
- * @return BelongsTo
- */
- public function media(): BelongsTo
- {
- return $this->belongsTo(Media::class);
- }
-}
diff --git a/app/Models/Permission.php b/app/Models/Permission.php
deleted file mode 100644
index 30321da..0000000
--- a/app/Models/Permission.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
- */
- protected $fillable = [
- 'permission',
- 'user',
- ];
-
-
- /**
- * Get the User associated with this model
- *
- * @return Illuminate\Database\Eloquent\Relations\BelongsTo
- */
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
-}
diff --git a/app/Models/Post.php b/app/Models/Post.php
new file mode 100644
index 0000000..1c5c2a0
--- /dev/null
+++ b/app/Models/Post.php
@@ -0,0 +1,26 @@
+belongsTo(User::class, 'user_id');
+ }
+
+ public function hero()
+ {
+ return $this->belongsTo(Media::class, 'hero_media_name');
+ }
+}
diff --git a/app/Models/Shortlink.php b/app/Models/Shortlink.php
deleted file mode 100644
index e154129..0000000
--- a/app/Models/Shortlink.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- */
- protected $fillable = [
- 'code',
- 'url',
- ];
-}
diff --git a/app/Models/Ticket.php b/app/Models/Ticket.php
new file mode 100644
index 0000000..98b2e12
--- /dev/null
+++ b/app/Models/Ticket.php
@@ -0,0 +1,11 @@
+
*/
protected $fillable = [
- 'first_name',
- 'last_name',
+ 'admin',
+ 'firstname',
+ 'surname',
'email',
'phone',
- 'password',
- 'display_name',
+ 'home_address',
+ 'home_address2',
+ 'home_city',
+ 'home_postcode',
+ 'home_state',
+ 'home_country',
+ 'billing_address',
+ 'billing_address2',
+ 'billing_city',
+ 'billing_postcode',
+ 'billing_state',
+ 'billing_country',
+ 'subscribed'
];
/**
@@ -45,202 +52,144 @@ class User extends Authenticatable implements Auditable
protected $hidden = [
'password',
'remember_token',
- 'permissions'
];
/**
* The attributes that should be cast.
*
- * @var array
+ * @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
- ];
-
- // protected $hidden = [
- // 'permissions'
- // ];
-
- /**
- * The attributes to append.
- *
- * @var string[]
- */
- protected $appends = [
- 'permissions'
+ 'password' => 'hashed',
];
/**
- * The default attributes.
- *
- * @var string[]
- */
- protected $attributes = [
- 'phone' => '',
- ];
-
-
- /**
- * Boot the model.
+ * The "booted" method of the model.
*
* @return void
*/
- protected static function boot(): void
+ protected $appends = [
+ 'subscribed',
+ 'email_update_pending'
+ ];
+
+ public static function boot()
{
parent::boot();
- $clearCache = function ($user) {
- Cache::forget(
- "user:{$user->id}",
- "user:{$user->id}:permissions"
- );
- };
+ static::updating(function ($user) {
+ if ($user->isDirty('email')) {
+ EmailSubscriptions::where('email', $user->getOriginal('email'))->update(['email' => $user->email]);
- static::saving($clearCache);
- static::deleting($clearCache);
- }
+ // remove duplicate email subscriptions, favoring those with confirmed dates
+ $subscriptions = EmailSubscriptions::where('email', $user->email)->orderBy('created_at', 'asc')->get();
+ $confirmed = EmailSubscriptions::where('email', $user->email)->whereNotNull('confirmed')->orderBy('confirmed', 'asc')->first();
+ if($subscriptions->count() > 1) {
+ // if there is a confirmed, then delete all the others
+ if($confirmed) {
+ $subscriptions->each(function($subscription) use ($confirmed) {
+ if($subscription->id !== $confirmed->id) {
+ $subscription->delete();
+ }
+ });
+ } else {
+ // if there is no confirmed, then delete all but the most recent
+ $subscriptions->each(function($subscription) use ($subscriptions) {
+ if($subscription->id !== $subscriptions->last()->id) {
+ $subscription->delete();
+ }
+ });
+ }
+ }
+ }
+ });
- /**
- * Get the list of permissions of the user
- *
- * @return Illuminate\Database\Eloquent\Relations\HasMany
- */
- public function permissions(): HasMany
- {
- return $this->hasMany(Permission::class);
- }
-
- /**
- * Get the permission attribute
- *
- * @return array
- */
- public function getPermissionsAttribute(): array
- {
- $cacheKey = "user:{$this->id}:permissions";
- return Cache::remember($cacheKey, now()->addDays(28), function () {
- return $this->permissions()->pluck('permission')->toArray();
+ static::deleting(function ($user) {
+ EmailSubscriptions::where('email', $user->email)->delete();
});
}
- /**
- * Set the permission attribute
- *
- * @param array $newPermissions The new permissions to set to the user.
- * @return void
- */
- public function setPermissionsAttribute(array $newPermissions): void
+ public function createLoginToken($redirect = null)
{
- $existingPermissions = $this->permissions->pluck('permission')->toArray();
+ // Generate a unique token
+ $token = Str::random(60);
- $this->revokePermission(array_diff($this->permissions, $newPermissions));
- $this->givePermission(array_diff($newPermissions, $this->permissions));
+ // Store the token in the database
+ DB::table('login_tokens')->insert([
+ 'email' => $this->email,
+ 'token' => $token,
+ 'intended_url' => $redirect,
+ ]);
- $cacheKey = "user:{$this->id}:permissions";
- Cache::delete($cacheKey);
+ return $token;
}
- /**
- * Test if user has permission
- *
- * @param string $permission Permission to test.
- * @return boolean
- */
- public function hasPermission(string $permission): bool
+ public function softDelete()
{
- return in_array($permission, $this->permissions);
- }
-
- /**
- * Give permissions to the user
- *
- * @param string|array $permissions The permission(s) to give.
- * @return Illuminate\Database\Eloquent\Collection
- */
- public function givePermission($permissions): Collection
- {
- if (is_array($permissions) === false) {
- $permissions = [$permissions];
+ foreach ($this->fillable as $field) {
+ if ($field === 'email_verified_at') {
+ $this->email_verified_at = null;
+ } else if ($field !== 'email') {
+ $this->{$field} = '';
+ }
}
- $newPermissions = array_map(function ($permission) {
- return ['permission' => $permission];
- }, array_diff($permissions, $this->permissions));
-
- $cacheKey = "user:{$this->id}:permissions";
- Cache::forget($cacheKey);
-
- return $this->permissions()->createMany($newPermissions);
+ $this->save();
}
-
- /**
- * Revoke permissions from the user
- *
- * @param string|array $permissions The permission(s) to revoke.
- * @return integer
- */
- public function revokePermission($permissions): int
+ public function getName(): string
{
- if (is_array($permissions) === false) {
- $permissions = [$permissions];
+ $name = '';
+
+ if($this->firstname || $this->surname) {
+ $name = implode(' ', [$this->firstname, $this->surname]);
+ } else {
+ $name = substr($this->email, 0, strpos($this->email, '@'));
}
- $cacheKey = "user:{$this->id}:permissions";
- Cache::forget($cacheKey);
-
- return $this->permissions()
- ->whereIn('permission', $permissions)
- ->delete();
+ return $name;
}
- /**
- * Get the list of files of the user
- *
- * @return HasMany
- */
- public function media(): HasMany
+ public function tickets()
{
- return $this->hasMany(Media::class);
+ return $this->hasMany(Ticket::class);
}
- /**
- * Get the list of files of the user
- *
- * @return HasMany
- */
- public function articles(): HasMany
+ public function getSubscribedAttribute()
{
- return $this->hasMany(Article::class);
+ return EmailSubscriptions::where('email', $this->email)
+ ->whereNotNull('confirmed')
+ ->exists();
}
- /**
- * Get associated user codes
- *
- * @return HasMany
- */
- public function codes(): HasMany
+ public function setSubscribedAttribute($value)
{
- return $this->hasMany(UserCode::class);
+ if ($value) {
+ $subscription = EmailSubscriptions::where('email', $this->email)->first();
+ if ($subscription) {
+ if($subscription->confirmed === null) {
+ $subscription->update(['confirmed' => now()]);
+ $subscription->save();
+ }
+ } else {
+ EmailSubscriptions::Create([
+ 'email' => $this->email,
+ 'confirmed' => now()
+ ]);
+ }
+ } else {
+ EmailSubscriptions::where('email', $this->email)->delete();
+ }
}
- /**
- * Get the list of logins of the user
- *
- * @return HasMany
- */
- public function logins(): HasMany
+ public function emailUpdate()
{
- return $this->hasMany(UserLogins::class);
+ return $this->hasOne(EmailUpdate::class);
}
- /**
- * Get the events associated with the user.
- *
- * @return BelongsToMany
- */
- public function events(): BelongsToMany
+ public function getEmailUpdatePendingAttribute()
{
- return $this->belongsToMany(Event::class, 'event_user', 'user_id', 'event_id');
+ return $this->emailUpdate()->exists();
}
}
diff --git a/app/Models/UserCode.php b/app/Models/UserCode.php
deleted file mode 100644
index b5a48ba..0000000
--- a/app/Models/UserCode.php
+++ /dev/null
@@ -1,83 +0,0 @@
-
- */
- protected $fillable = [
- 'action',
- 'user_id',
- 'data',
- ];
-
-
- /**
- * Boot function from Laravel.
- *
- * @return void
- */
- protected static function boot(): void
- {
- parent::boot();
- static::creating(function ($model) {
- UserCode::clearExpired();
-
- if (empty($model->{'code'}) === true) {
- while (true) {
- $code = random_int(100000, 999999);
- if (UserCode::where('code', $code)->count() === 0) {
- $model->{'code'} = $code;
- break;
- }
- }
- }
- });
- }
-
- /**
- * Generate new code
- *
- * @return void
- */
- public function regenerate(): void
- {
- while (true) {
- $code = random_int(100000, 999999);
- if (UserCode::where('code', $code)->count() === 0) {
- $this->code = $code;
- break;
- }
- }
- }
-
- /**
- * Clear expired user codes
- *
- * @return void
- */
- public static function clearExpired(): void
- {
- UserCode::where('updated_at', '<=', now()->subDays(5))->delete();
- }
-
- /**
- * Get associated user
- *
- * @return Illuminate\Database\Eloquent\Relations\BelongsTo
- */
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
-}
diff --git a/app/Models/UserLogins.php b/app/Models/UserLogins.php
deleted file mode 100644
index 10efe16..0000000
--- a/app/Models/UserLogins.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
- */
- protected $fillable = [
- 'user_id',
- 'token',
- 'login',
- 'logout',
- 'ip_address',
- 'user_agent',
- ];
-
-
- /**
- * Get the file user
- *
- * @return Illuminate\Database\Eloquent\Relations\BelongsTo
- */
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
-}
diff --git a/app/Models/Workshop.php b/app/Models/Workshop.php
new file mode 100644
index 0000000..a289d9b
--- /dev/null
+++ b/app/Models/Workshop.php
@@ -0,0 +1,52 @@
+ 'datetime',
+ 'ends_at' => 'datetime',
+ 'publish_at' => 'datetime',
+ 'closes_at' => 'datetime',
+ ];
+
+ public function author()
+ {
+ return $this->belongsTo(User::class, 'user_id');
+ }
+
+ public function hero()
+ {
+ return $this->belongsTo(Media::class, 'hero_media_name');
+ }
+
+ public function location()
+ {
+ return $this->belongsTo(Location::class, 'location_id');
+ }
+}
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 30a0c2d..fd66410 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -2,16 +2,14 @@
namespace App\Providers;
-use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Blade;
+use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
-use Illuminate\Support\Facades\Storage;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
- *
- * @return void
*/
public function register(): void
{
@@ -20,34 +18,14 @@ class AppServiceProvider extends ServiceProvider
/**
* Bootstrap any application services.
- *
- * @return void
*/
public function boot(): void
{
- Request::macro('rename', function ($param, $newParam = null) {
- if (is_array($param) === false) {
- if ($newParam === null) {
- return;
- }
-
- $param = [$param => $newParam];
- }
-
- $paramArray = $this->all();
- foreach ($param as $oldParam => $newParam) {
- if (isset($paramArray[$oldParam]) === true) {
- $paramArray[$newParam] = $paramArray[$oldParam];
- unset($paramArray[$oldParam]);
- }
- }
-
- $this->replace($paramArray);
- });
-
- Storage::macro('public', function ($diskName) {
- $public = config("filesystems.disks.{$diskName}.public", false);
- return $public;
+ Blade::directive('includeSVG', function ($arguments) {
+ list($path, $styles) = array_pad(explode(',', str_replace(['(', ')', ' ', "'"], '', $arguments), 2), 2, '');
+ $svgContent = file_get_contents(public_path($path));
+ $svgContent = str_replace('
-
-
-
-
Select or Upload Media
-
-
- Drop files to upload
- or
-
-
- Maximum upload file size: {{ max_upload_size }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No media found
-
-
-
- -
-
-
-
- {{ item.title }}
-
-
- {{
- getMediaStatusText(item)
- }}
-
-
-
-
-
-
- Showing {{ mediaItems.length }} of
- {{ totalItems }}
- media item{{
- totalItems == 1 ? "" : "s"
- }}
-
-
-
-
-
-
-
-
- {{ computedUploadMediaTitle }}
-
-
-
- {{ computedUploadMediaStatus }}
-
-
-
-
- {{ computedProcessingMediaTitle }}
-
-
-
- {{ computedProcessingMediaStatus }}
-
-
-
-
-
-
-
-
-
-
- {{ lastSelected.title }}
-
-
- {{
- formatDate(
- lastSelected.created_at,
- )
- }}
-
-
- {{
- bytesReadable(
- lastSelected.size,
- 0,
- )
- }}
-
-
- {{
- getMediaStatusText(
- lastSelected,
- )
- }}
-
-
-
-
-
-
- |
- File
- |
- {{ lastSelected.name }} |
-
-
- |
- Type
- |
-
- {{ lastSelected.mime_type }}
- |
-
-
- |
-
- This file has a security
- policy applied and may
- not be viewable by
- everyone
-
- |
-
-
-
-
-
- Rotate Left
-
-
-
- Rotate Right
-
-
-
- Delete Permanently
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Insert image from URL
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/components/dialogs/SMDialogProgress.vue b/resources/js/components/dialogs/SMDialogProgress.vue
deleted file mode 100644
index 1681ad8..0000000
--- a/resources/js/components/dialogs/SMDialogProgress.vue
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
diff --git a/resources/js/editor/Box.js b/resources/js/editor/Box.js
new file mode 100644
index 0000000..c6ddd51
--- /dev/null
+++ b/resources/js/editor/Box.js
@@ -0,0 +1,73 @@
+import {mergeAttributes, Node} from '@tiptap/core'
+
+
+export const Box = Node.create({
+ name: 'box',
+
+ addOptions() {
+ return {
+ types: ['info', 'warning', 'danger', 'success', 'bug'],
+ HTMLAttributes: {
+ class: 'box',
+ },
+ }
+ },
+
+ addAttributes() {
+ return {
+ type: {
+ default: 'info',
+ rendered: false,
+ },
+ }
+ },
+
+ group: 'block',
+
+ content: 'inline*',
+
+ defining: true,
+
+ parseHTML() {
+ return this.options.types.map((type) => ({
+ tag: 'div',
+ getAttrs: (node) => {
+ // Extract the class attribute and find the type based on the class
+ const classList = node.getAttribute('class')?.split(' ') || [];
+ const boxType = classList.find(cls => this.options.types.includes(cls));
+ return {
+ type: boxType || this.options.types[0], // Default to 'info' if no matching type is found
+ };
+ },
+ }));
+ },
+
+ renderHTML({ node, HTMLAttributes }) {
+ const hasType = this.options.types.includes(node.attrs.type);
+ const type = hasType
+ ? node.attrs.type
+ : this.options.types[0]
+
+ let classes = 'box ' + type;
+ return ['div', mergeAttributes({ class: classes }, HTMLAttributes), 0]
+ },
+
+ addCommands() {
+ return {
+ setBox: attributes => ({ commands }) => {
+ if (!this.options.types.includes(attributes.type)) {
+ return false
+ }
+
+ return commands.setNode(this.name, attributes)
+ },
+ toggleBox: attributes => ({ commands }) => {
+ if (!this.options.types.includes(attributes.type)) {
+ return false
+ }
+
+ return commands.toggleNode(this.name, 'paragraph', attributes)
+ },
+ }
+ },
+})
diff --git a/resources/js/editor/ColourHighter.js b/resources/js/editor/ColourHighter.js
new file mode 100644
index 0000000..ab6c9d6
--- /dev/null
+++ b/resources/js/editor/ColourHighter.js
@@ -0,0 +1,28 @@
+import { Extension } from '@tiptap/core'
+import { Plugin } from '@tiptap/pm/state'
+
+import findColors from './FindColors.js'
+
+export const ColorHighlighter = Extension.create({
+ name: 'colorHighlighter',
+
+ addProseMirrorPlugins() {
+ return [
+ new Plugin({
+ state: {
+ init(_, { doc }) {
+ return findColors(doc)
+ },
+ apply(transaction, oldState) {
+ return transaction.docChanged ? findColors(transaction.doc) : oldState
+ },
+ },
+ props: {
+ decorations(state) {
+ return this.getState(state)
+ },
+ },
+ }),
+ ]
+ },
+})
diff --git a/resources/js/editor/ExtraSmall.js b/resources/js/editor/ExtraSmall.js
new file mode 100644
index 0000000..54f05d3
--- /dev/null
+++ b/resources/js/editor/ExtraSmall.js
@@ -0,0 +1,36 @@
+import {mergeAttributes, Node} from '@tiptap/core'
+
+
+export const ExtraSmall = Node.create({
+ name: 'extraSmall',
+
+ priority: 1000,
+
+ addOptions() {
+ return {
+ HTMLAttributes: {
+ class: 'text-xs',
+ },
+ }
+ },
+
+ group: 'block',
+
+ content: 'inline*',
+
+ parseHTML() {
+ return [{ tag: 'p.text-xs' }]
+ },
+
+ renderHTML({ HTMLAttributes }) {
+ return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]
+ },
+
+ addCommands() {
+ return {
+ setExtraSmall: () => ({ commands }) => {
+ return commands.setNode(this.name)
+ },
+ }
+ },
+})
diff --git a/resources/js/editor/FindColors.js b/resources/js/editor/FindColors.js
new file mode 100644
index 0000000..9051ccc
--- /dev/null
+++ b/resources/js/editor/FindColors.js
@@ -0,0 +1,27 @@
+import { Decoration, DecorationSet } from "@tiptap/pm/view"
+
+export default function(doc) {
+ const hexColor = /(#[0-9a-f]{3,6})\b/gi
+ const decorations = []
+
+ doc.descendants((node, position) => {
+ if (!node.text) {
+ return
+ }
+
+ Array.from(node.text.matchAll(hexColor)).forEach(match => {
+ const color = match[0]
+ const index = match.index || 0
+ const from = position + index
+ const to = from + color.length
+ const decoration = Decoration.inline(from, to, {
+ class: "color",
+ style: `--color: ${color}`
+ })
+
+ decorations.push(decoration)
+ })
+ })
+
+ return DecorationSet.create(doc, decorations)
+}
diff --git a/resources/js/editor/Small.js b/resources/js/editor/Small.js
new file mode 100644
index 0000000..3d3adca
--- /dev/null
+++ b/resources/js/editor/Small.js
@@ -0,0 +1,38 @@
+import {mergeAttributes, Node} from '@tiptap/core'
+
+
+export const Small = Node.create({
+ name: 'small',
+
+ priority: 2000,
+
+ addOptions() {
+ return {
+ HTMLAttributes: {
+ class: 'text-sm',
+ },
+ }
+ },
+
+ group: 'block',
+
+ content: 'inline*',
+
+ parseHTML() {
+ return [{
+ tag: 'p.text-sm',
+ }]
+ },
+
+ renderHTML({ HTMLAttributes }) {
+ return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]
+ },
+
+ addCommands() {
+ return {
+ setSmall: () => ({ commands }) => {
+ return commands.setNode(this.name)
+ },
+ }
+ },
+})
diff --git a/resources/js/editor/SmileyReplacer.js b/resources/js/editor/SmileyReplacer.js
new file mode 100644
index 0000000..552901c
--- /dev/null
+++ b/resources/js/editor/SmileyReplacer.js
@@ -0,0 +1,133 @@
+import { Extension, textInputRule } from '@tiptap/core'
+
+export const SmileyReplacer = Extension.create({
+ name: 'smileyReplacer',
+
+ addInputRules() {
+ return [
+ textInputRule({ find: /-___- $/, replace: '😑 ' }),
+ textInputRule({ find: /:'-\) $/, replace: '😂 ' }),
+ textInputRule({ find: /':-\) $/, replace: '😅 ' }),
+ textInputRule({ find: /':-D $/, replace: '😅 ' }),
+ textInputRule({ find: />:-\) $/, replace: '😆 ' }),
+ textInputRule({ find: /-__- $/, replace: '😑 ' }),
+ textInputRule({ find: /':-\( $/, replace: '😓 ' }),
+ textInputRule({ find: /:'-\( $/, replace: '😢 ' }),
+ textInputRule({ find: />:-\( $/, replace: '😠 ' }),
+ textInputRule({ find: /O:-\) $/, replace: '😇 ' }),
+ textInputRule({ find: /0:-3 $/, replace: '😇 ' }),
+ textInputRule({ find: /0:-\) $/, replace: '😇 ' }),
+ textInputRule({ find: /0;\^\) $/, replace: '😇 ' }),
+ textInputRule({ find: /O;-\) $/, replace: '😇 ' }),
+ textInputRule({ find: /0;-\) $/, replace: '😇 ' }),
+ textInputRule({ find: /O:-3 $/, replace: '😇 ' }),
+ textInputRule({ find: /:'\) $/, replace: '😂 ' }),
+ textInputRule({ find: /:-D $/, replace: '😃 ' }),
+ textInputRule({ find: /':\) $/, replace: '😅 ' }),
+ textInputRule({ find: /'=\) $/, replace: '😅 ' }),
+ textInputRule({ find: /':D $/, replace: '😅 ' }),
+ textInputRule({ find: /'=D $/, replace: '😅 ' }),
+ textInputRule({ find: />:\) $/, replace: '😆 ' }),
+ textInputRule({ find: />;\) $/, replace: '😆 ' }),
+ textInputRule({ find: />=\) $/, replace: '😆 ' }),
+ textInputRule({ find: /;-\) $/, replace: '😉 ' }),
+ textInputRule({ find: /\*-\) $/, replace: '😉 ' }),
+ textInputRule({ find: /;-\] $/, replace: '😉 ' }),
+ textInputRule({ find: /;\^\) $/, replace: '😉 ' }),
+ textInputRule({ find: /B-\) $/, replace: '😎 ' }),
+ textInputRule({ find: /8-\) $/, replace: '😎 ' }),
+ textInputRule({ find: /B-D $/, replace: '😎 ' }),
+ textInputRule({ find: /8-D $/, replace: '😎 ' }),
+ textInputRule({ find: /:-\* $/, replace: '😘 ' }),
+ textInputRule({ find: /:\^\* $/, replace: '😘 ' }),
+ textInputRule({ find: /:-\) $/, replace: '🙂 ' }),
+ textInputRule({ find: /-_- $/, replace: '😑 ' }),
+ textInputRule({ find: /:-X $/, replace: '😶 ' }),
+ textInputRule({ find: /:-# $/, replace: '😶 ' }),
+ textInputRule({ find: /:-x $/, replace: '😶 ' }),
+ textInputRule({ find: />.< $/, replace: '😣 ' }),
+ textInputRule({ find: /:-O $/, replace: '😮 ' }),
+ textInputRule({ find: /:-o $/, replace: '😮 ' }),
+ textInputRule({ find: /O_O $/, replace: '😮 ' }),
+ textInputRule({ find: />:O $/, replace: '😮 ' }),
+ textInputRule({ find: /:-P $/, replace: '😛 ' }),
+ textInputRule({ find: /:-p $/, replace: '😛 ' }),
+ textInputRule({ find: /:-Þ $/, replace: '😛 ' }),
+ textInputRule({ find: /:-þ $/, replace: '😛 ' }),
+ textInputRule({ find: /:-b $/, replace: '😛 ' }),
+ textInputRule({ find: />:P $/, replace: '😜 ' }),
+ textInputRule({ find: /X-P $/, replace: '😜 ' }),
+ textInputRule({ find: /x-p $/, replace: '😜 ' }),
+ textInputRule({ find: /':\( $/, replace: '😓 ' }),
+ textInputRule({ find: /'=\( $/, replace: '😓 ' }),
+ textInputRule({ find: />:\\ $/, replace: '😕 ' }),
+ textInputRule({ find: />:\/ $/, replace: '😕 ' }),
+ textInputRule({ find: /:-\/ $/, replace: '😕 ' }),
+ textInputRule({ find: /:-. $/, replace: '😕 ' }),
+ textInputRule({ find: />:\[ $/, replace: '😞 ' }),
+ textInputRule({ find: /:-\( $/, replace: '😞 ' }),
+ textInputRule({ find: /:-\[ $/, replace: '😞 ' }),
+ textInputRule({ find: /:'\( $/, replace: '😢 ' }),
+ textInputRule({ find: /;-\( $/, replace: '😢 ' }),
+ textInputRule({ find: /#-\) $/, replace: '😵 ' }),
+ textInputRule({ find: /%-\) $/, replace: '😵 ' }),
+ textInputRule({ find: /X-\) $/, replace: '😵 ' }),
+ textInputRule({ find: />:\( $/, replace: '😠 ' }),
+ textInputRule({ find: /0:3 $/, replace: '😇 ' }),
+ textInputRule({ find: /0:\) $/, replace: '😇 ' }),
+ textInputRule({ find: /O:\) $/, replace: '😇 ' }),
+ textInputRule({ find: /O=\) $/, replace: '😇 ' }),
+ textInputRule({ find: /O:3 $/, replace: '😇 ' }),
+ textInputRule({ find: /<\/3 $/, replace: '💔 ' }),
+ textInputRule({ find: /:D $/, replace: '😃 ' }),
+ textInputRule({ find: /=D $/, replace: '😃 ' }),
+ textInputRule({ find: /;\) $/, replace: '😉 ' }),
+ textInputRule({ find: /\*\) $/, replace: '😉 ' }),
+ textInputRule({ find: /;\] $/, replace: '😉 ' }),
+ textInputRule({ find: /;D $/, replace: '😉 ' }),
+ textInputRule({ find: /B\) $/, replace: '😎 ' }),
+ textInputRule({ find: /8\) $/, replace: '😎 ' }),
+ textInputRule({ find: /:\* $/, replace: '😘 ' }),
+ textInputRule({ find: /=\* $/, replace: '😘 ' }),
+ textInputRule({ find: /:\) $/, replace: '🙂 ' }),
+ textInputRule({ find: /=\] $/, replace: '🙂 ' }),
+ textInputRule({ find: /=\) $/, replace: '🙂 ' }),
+ textInputRule({ find: /:\] $/, replace: '🙂 ' }),
+ textInputRule({ find: /:X $/, replace: '😶 ' }),
+ textInputRule({ find: /:# $/, replace: '😶 ' }),
+ textInputRule({ find: /=X $/, replace: '😶 ' }),
+ textInputRule({ find: /=x $/, replace: '😶 ' }),
+ textInputRule({ find: /:x $/, replace: '😶 ' }),
+ textInputRule({ find: /=# $/, replace: '😶 ' }),
+ textInputRule({ find: /:O $/, replace: '😮 ' }),
+ textInputRule({ find: /:o $/, replace: '😮 ' }),
+ textInputRule({ find: /:P $/, replace: '😛 ' }),
+ textInputRule({ find: /=P $/, replace: '😛 ' }),
+ textInputRule({ find: /:p $/, replace: '😛 ' }),
+ textInputRule({ find: /=p $/, replace: '😛 ' }),
+ textInputRule({ find: /:Þ $/, replace: '😛 ' }),
+ textInputRule({ find: /:þ $/, replace: '😛 ' }),
+ textInputRule({ find: /:b $/, replace: '😛 ' }),
+ textInputRule({ find: /d: $/, replace: '😛 ' }),
+ textInputRule({ find: /:\/ $/, replace: '😕 ' }),
+ textInputRule({ find: /:\\ $/, replace: '😕 ' }),
+ textInputRule({ find: /=\/ $/, replace: '😕 ' }),
+ textInputRule({ find: /=\\ $/, replace: '😕 ' }),
+ textInputRule({ find: /:L $/, replace: '😕 ' }),
+ textInputRule({ find: /=L $/, replace: '😕 ' }),
+ textInputRule({ find: /:\( $/, replace: '😞 ' }),
+ textInputRule({ find: /:\[ $/, replace: '😞 ' }),
+ textInputRule({ find: /=\( $/, replace: '😞 ' }),
+ textInputRule({ find: /;\( $/, replace: '😢 ' }),
+ textInputRule({ find: /D: $/, replace: '😨 ' }),
+ textInputRule({ find: /:\$ $/, replace: '😳 ' }),
+ textInputRule({ find: /=\$ $/, replace: '😳 ' }),
+ textInputRule({ find: /#\) $/, replace: '😵 ' }),
+ textInputRule({ find: /%\) $/, replace: '😵 ' }),
+ textInputRule({ find: /X\) $/, replace: '😵 ' }),
+ textInputRule({ find: /:@ $/, replace: '😠 ' }),
+ textInputRule({ find: /<3 $/, replace: '❤️ ' }),
+ textInputRule({ find: /\/shrug $/, replace: '¯\\_(ツ)_/¯' }),
+ ]
+ },
+})
diff --git a/resources/js/editor/TipTap.js b/resources/js/editor/TipTap.js
new file mode 100644
index 0000000..2f61d47
--- /dev/null
+++ b/resources/js/editor/TipTap.js
@@ -0,0 +1,159 @@
+import Link from "@tiptap/extension-link";
+import {Editor} from "@tiptap/core";
+import StarterKit from "@tiptap/starter-kit";
+import Highlight from "@tiptap/extension-highlight";
+import TextAlign from "@tiptap/extension-text-align";
+import Typography from "@tiptap/extension-typography";
+import {ColorHighlighter} from "./ColourHighter.js";
+import {SmileyReplacer} from "./SmileyReplacer.js";
+import {Small} from "./Small.js";
+import {ExtraSmall} from "./ExtraSmall.js";
+import {Box} from "./Box.js";
+
+const editorToggleLink = (editor) => {
+ const previousUrl = editor.getAttributes('link').href
+ const url = window.prompt('URL', previousUrl)
+
+ if (url === null) {
+ return
+ }
+
+ if (url === '') {
+ editor.chain().focus().extendMarkRange('link').unsetLink().run()
+ return
+ }
+
+ editor.chain().focus().extendMarkRange('link').setLink({ href: url }).run()
+}
+
+const CustomLink = Link.extend({
+ addKeyboardShortcuts() {
+ return {
+ 'Mod-k': () => editorToggleLink(this.editor)
+ }
+ }
+});
+
+document.addEventListener('alpine:init', () => {
+ Alpine.data('editor', (content) => {
+ let editor // Alpine's reactive engine automatically wraps component properties in proxy objects. Attempting to use a proxied editor instance to apply a transaction will cause a "Range Error: Applying a mismatched transaction", so be sure to unwrap it using Alpine.raw(), or simply avoid storing your editor as a component property, as shown in this example.
+
+ return {
+ updatedAt: Date.now(), // force Alpine to rerender on selection change
+ content: SM.decodeHtml(content),
+ init() {
+ const _this = this
+
+ editor = new Editor({
+ element: this.$refs.element,
+ extensions: [
+ StarterKit,
+ Highlight,
+ CustomLink.configure({
+ rel: 'noopener noreferrer',
+ openOnClick: 'whenNotEditable',
+ }),
+ TextAlign.configure({
+ types: ['heading', 'paragraph', 'small', 'extraSmall'],
+ }),
+ Typography,
+ ColorHighlighter,
+ SmileyReplacer,
+ Small,
+ ExtraSmall,
+ Box
+ ],
+ content: content,
+ onCreate({editor}) {
+ _this.updatedAt = Date.now()
+ },
+ onUpdate({editor}) {
+ _this.updatedAt = Date.now()
+ _this.content = editor.getHTML()
+ },
+ onSelectionUpdate({editor}) {
+ _this.updatedAt = Date.now()
+ }
+ })
+ },
+ isLoaded() {
+ return editor
+ },
+ isActive(type, opts = {}) {
+ return editor.isActive(type, opts)
+ },
+ toggleHeading(opts) {
+ editor.chain().toggleHeading(opts).focus().run()
+ },
+ toggleBold() {
+ editor.chain().toggleBold().focus().run()
+ },
+ toggleItalic() {
+ editor.chain().toggleItalic().focus().run()
+ },
+ toggleUnderline() {
+ editor.chain().toggleUnderline().focus().run()
+ },
+ toggleStrike() {
+ editor.chain().toggleStrike().focus().run()
+ },
+ setParagraph() {
+ editor.chain().setParagraph().focus().run()
+ },
+ toggleCode() {
+ editor.chain().toggleCode().focus().run()
+ },
+ toggleBulletList() {
+ editor.chain().toggleBulletList().focus().run()
+ },
+ toggleOrderedList() {
+ editor.chain().toggleOrderedList().focus().run()
+ },
+ toggleBlockquote() {
+ editor.chain().toggleBlockquote().focus().run()
+ },
+ toggleCodeBlock() {
+ editor.chain().toggleCodeBlock().focus().run()
+ },
+ toggleLink() {
+ editorToggleLink(editor)
+ },
+ clearLink() {
+ editor.chain().focus().extendMarkRange('link').unsetLink().run()
+ },
+ toggleHighlight() {
+ editor.chain().toggleHighlight().focus().run()
+ },
+ toggleSubscript() {
+ editor.chain().toggleSubscript().focus().run()
+ },
+ toggleSuperscript() {
+ editor.chain().toggleSuperscript().focus().run()
+ },
+ undo() {
+ editor.chain().undo().focus().run()
+ },
+ redo() {
+ editor.chain().redo().focus().run()
+ },
+ unsetAllMarks() {
+ editor.chain().focus().unsetAllMarks().run()
+ },
+ clearNotes() {
+ editor.chain().focus().clearNodes().run()
+ },
+ setTextAlign(value) {
+ editor.chain().setTextAlign(value).focus().run()
+ },
+ setSmall() {
+ editor.chain().focus().setSmall().run()
+ },
+ setExtraSmall() {
+ editor.chain().focus().setExtraSmall().run()
+ },
+ toggleBox(opts) {
+ editor.chain().toggleBox(opts).focus().run()
+ },
+ }
+ })
+})
diff --git a/resources/js/extensions/danger.ts b/resources/js/extensions/danger.ts
deleted file mode 100644
index 921ad9e..0000000
--- a/resources/js/extensions/danger.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { mergeAttributes, Node } from "@tiptap/core";
-
-export interface DangerOptions {
- HTMLAttributes: Record;
-}
-
-declare module "@tiptap/core" {
- interface Commands {
- danger: {
- /**
- * Toggle a paragraph
- */
- setDanger: () => ReturnType;
- toggleDanger: () => ReturnType;
- };
- }
-}
-
-export const Danger = Node.create({
- name: "danger",
-
- priority: 1000,
-
- addOptions() {
- return {
- HTMLAttributes: { class: "danger" },
- };
- },
-
- group: "block",
-
- content: "inline*",
-
- parseHTML() {
- return [{ tag: "p", class: "danger" }];
- },
-
- renderHTML({ HTMLAttributes }) {
- return [
- "p",
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
- 0,
- ];
- },
-
- addCommands() {
- return {
- setDanger:
- () =>
- ({ commands }) => {
- return commands.setNode(this.name);
- },
- toggleDanger:
- () =>
- ({ commands }) => {
- return commands.toggleNode(this.name, "paragraph");
- },
- };
- },
-});
diff --git a/resources/js/extensions/info.ts b/resources/js/extensions/info.ts
deleted file mode 100644
index 80868dc..0000000
--- a/resources/js/extensions/info.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { mergeAttributes, Node } from "@tiptap/core";
-
-export interface InfoOptions {
- HTMLAttributes: Record;
-}
-
-declare module "@tiptap/core" {
- interface Commands {
- info: {
- /**
- * Toggle a paragraph
- */
- setInfo: () => ReturnType;
- toggleInfo: () => ReturnType;
- };
- }
-}
-
-export const Info = Node.create({
- name: "info",
-
- priority: 1000,
-
- addOptions() {
- return {
- HTMLAttributes: { class: "info" },
- };
- },
-
- group: "block",
-
- content: "inline*",
-
- parseHTML() {
- return [{ tag: "p", class: "info" }];
- },
-
- renderHTML({ HTMLAttributes }) {
- return [
- "p",
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
- 0,
- ];
- },
-
- addCommands() {
- return {
- setInfo:
- () =>
- ({ commands }) => {
- return commands.setNode(this.name);
- },
- toggleInfo:
- () =>
- ({ commands }) => {
- return commands.toggleNode(this.name, "paragraph");
- },
- };
- },
-});
diff --git a/resources/js/extensions/small.ts b/resources/js/extensions/small.ts
deleted file mode 100644
index 29ccd37..0000000
--- a/resources/js/extensions/small.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import { mergeAttributes, Node } from "@tiptap/core";
-
-export interface SmallOptions {
- HTMLAttributes: Record;
-}
-
-declare module "@tiptap/core" {
- interface Commands {
- small: {
- /**
- * Set a small mark
- */
- setSmall: () => ReturnType;
- /**
- * Toggle a small mark
- */
- toggleSmall: () => ReturnType;
- };
- }
-}
-
-export const Small = Node.create({
- name: "small",
- group: "block",
- content: "inline*",
-
- addOptions() {
- return {
- HTMLAttributes: { class: "small" },
- };
- },
-
- parseHTML() {
- return [{ tag: "p.small", priority: 100 }];
- },
-
- renderHTML({ HTMLAttributes }) {
- return [
- "p",
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
- 0,
- ];
- },
-
- addCommands() {
- return {
- setSmall:
- () =>
- ({ commands }) => {
- return commands.setNode(this.name);
- },
- toggleSmall:
- () =>
- ({ commands }) => {
- return commands.toggleNode(this.name, "paragraph");
- },
- };
- },
-});
diff --git a/resources/js/extensions/success.ts b/resources/js/extensions/success.ts
deleted file mode 100644
index a7997fe..0000000
--- a/resources/js/extensions/success.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { mergeAttributes, Node } from "@tiptap/core";
-
-export interface SuccessOptions {
- HTMLAttributes: Record;
-}
-
-declare module "@tiptap/core" {
- interface Commands {
- success: {
- /**
- * Toggle a paragraph
- */
- setSuccess: () => ReturnType;
- toggleSuccess: () => ReturnType;
- };
- }
-}
-
-export const Success = Node.create({
- name: "success",
-
- priority: 1000,
-
- addOptions() {
- return {
- HTMLAttributes: { class: "success" },
- };
- },
-
- group: "block",
-
- content: "inline*",
-
- parseHTML() {
- return [{ tag: "p", class: "success" }];
- },
-
- renderHTML({ HTMLAttributes }) {
- return [
- "p",
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
- 0,
- ];
- },
-
- addCommands() {
- return {
- setSuccess:
- () =>
- ({ commands }) => {
- return commands.setNode(this.name);
- },
- toggleSuccess:
- () =>
- ({ commands }) => {
- return commands.toggleNode(this.name, "paragraph");
- },
- };
- },
-});
diff --git a/resources/js/extensions/warning.ts b/resources/js/extensions/warning.ts
deleted file mode 100644
index 58e9d6c..0000000
--- a/resources/js/extensions/warning.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { mergeAttributes, Node } from "@tiptap/core";
-
-export interface WarningOptions {
- HTMLAttributes: Record;
-}
-
-declare module "@tiptap/core" {
- interface Commands {
- warning: {
- /**
- * Toggle a paragraph
- */
- setWarning: () => ReturnType;
- toggleWarning: () => ReturnType;
- };
- }
-}
-
-export const Warning = Node.create({
- name: "warning",
-
- priority: 1000,
-
- addOptions() {
- return {
- HTMLAttributes: { class: "warning" },
- };
- },
-
- group: "block",
-
- content: "inline*",
-
- parseHTML() {
- return [{ tag: "p", class: "warning" }];
- },
-
- renderHTML({ HTMLAttributes }) {
- return [
- "p",
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
- 0,
- ];
- },
-
- addCommands() {
- return {
- setWarning:
- () =>
- ({ commands }) => {
- return commands.setNode(this.name);
- },
- toggleWarning:
- () =>
- ({ commands }) => {
- return commands.toggleNode(this.name, "paragraph");
- },
- };
- },
-});
diff --git a/resources/js/helpers/api.ts b/resources/js/helpers/api.ts
deleted file mode 100644
index e2f6ffa..0000000
--- a/resources/js/helpers/api.ts
+++ /dev/null
@@ -1,476 +0,0 @@
-import { useUserStore } from "../store/UserStore";
-import { useApplicationStore } from "../store/ApplicationStore";
-import { useCacheStore } from "../store/CacheStore";
-import { ImportMetaExtras } from "../../../import-meta";
-
-interface ApiProgressData {
- loaded: number;
- total: number;
-}
-
-interface ApiCallbackData {
- status: number;
- statusText: string;
- url: string;
- headers: unknown;
- data: unknown;
-}
-
-type ApiProgressCallback = (progress: ApiProgressData) => void;
-type ApiResultCallback = (data: ApiCallbackData) => void;
-
-export interface ApiOptions {
- url: string;
- params?: object;
- method?: string;
- headers?: HeadersInit;
- body?: string | object | FormData | ArrayBuffer | Blob;
- signal?: AbortSignal | null;
- progress?: ApiProgressCallback;
- callback?: ApiResultCallback;
- chunk?: string;
-}
-
-export interface ApiResponse {
- status: number;
- message: string;
- data: unknown;
- json?: Record;
-}
-
-const apiDefaultHeaders = {
- Accept: "application/json",
- "Content-Type": "application/json;charset=UTF-8",
-};
-
-export const api = {
- timeout: 8000,
- baseUrl: (import.meta as ImportMetaExtras).env.APP_URL_API,
-
- send: function (options: ApiOptions) {
- return new Promise((resolve, reject) => {
- let url = this.baseUrl + options.url;
-
- if (options.params) {
- let params = "";
-
- for (const [key, value] of Object.entries(options.params)) {
- const placeholder = `{${key}}`;
- if (url.includes(placeholder)) {
- url = url.replace(
- placeholder,
- encodeURIComponent(value),
- );
- } else {
- params += `&${encodeURIComponent(
- key,
- )}=${encodeURIComponent(value)}`;
- }
- }
-
- url = url.replace(/{(.*?)}/g, "$1");
- if (params.length > 0) {
- url += (url.includes("?") ? "" : "?") + params.substring(1);
- }
- }
-
- options.headers = {
- ...apiDefaultHeaders,
- ...(options.headers || {}),
- };
-
- const userStore = useUserStore();
- if (userStore.id) {
- options.headers["Authorization"] = `Bearer ${userStore.token}`;
- }
-
- options.method = options.method.toUpperCase() || "GET";
-
- if (options.body && typeof options.body === "object") {
- if (options.body instanceof FormData) {
- if (
- Object.prototype.hasOwnProperty.call(
- options.headers,
- "Content-Type",
- )
- ) {
- // remove the "Content-Type" key from the headers object
- delete options.headers["Content-Type"];
- }
-
- if (options.method != "POST") {
- options.body.append("_method", options.method);
- options.method = "POST";
- }
- } else if (
- options.body instanceof Blob ||
- options.body instanceof ArrayBuffer
- ) {
- // do nothing, let XHR handle these types of bodies without a Content-Type header
- } else {
- options.body = JSON.stringify(options.body);
- options.headers["Content-Type"] = "application/json";
- }
- }
-
- if (
- (options.method == "POST" ||
- options.method == "PUT" ||
- options.method == "PATCH") &&
- options.progress
- ) {
- const xhr = new XMLHttpRequest();
-
- xhr.upload.onprogress = function (event) {
- if (event.lengthComputable) {
- options.progress({
- loaded: event.loaded,
- total: event.total,
- });
- }
- };
-
- xhr.open(options.method, url);
- for (const header in options.headers) {
- xhr.setRequestHeader(header, options.headers[header]);
- }
- xhr.onload = function () {
- const result = {
- status: xhr.status,
- statusText: xhr.statusText,
- url: url,
- headers: {},
- data: "",
- };
-
- const headersString = xhr.getAllResponseHeaders();
- const headersArray = headersString.trim().split("\n");
- headersArray.forEach((header) => {
- const [name, value] = header.trim().split(":");
- result.headers[name] = value.trim();
- });
-
- if (
- xhr.response &&
- result.headers["content-type"] == "application/json"
- ) {
- try {
- result.data = JSON.parse(xhr.response);
- } catch (error) {
- result.data = xhr.response;
- }
- } else {
- result.data = xhr.response;
- }
-
- useApplicationStore().unavailable = false;
- if (xhr.status < 300) {
- if (options.callback) {
- options.callback(result);
- } else {
- resolve(result);
- }
-
- return;
- } else {
- if (xhr.status == 503) {
- useApplicationStore().unavailable = true;
- }
-
- if (options.callback) {
- options.callback(result);
- } else {
- reject(result);
- }
-
- return;
- }
- };
-
- try {
- xhr.send(options.body as XMLHttpRequestBodyInit);
- } catch (e) {
- console.log(e);
- }
- } else {
- const fetchOptions: RequestInit = {
- method: options.method.toUpperCase() || "GET",
- headers: options.headers,
- signal: options.signal || null,
- };
-
- if (
- (typeof options.body == "string" &&
- options.body.length > 0) ||
- options.body instanceof FormData
- ) {
- fetchOptions.body = options.body;
- }
-
- if (fetchOptions.method == "GET" && options.callback) {
- const cache = useCacheStore().getCacheByUrl(url);
- if (cache != null) {
- options.callback(cache);
- }
- }
-
- fetch(url, fetchOptions)
- .then(async (response) => {
- let data: string | object = "";
- if (response.headers.get("content-length") !== "0") {
- if (
- response &&
- response.headers.get("content-type") == null
- ) {
- try {
- data = response.json
- ? await response.json()
- : {};
- } catch (error) {
- try {
- data = response.text
- ? await response.text()
- : "";
- } catch (error) {
- data = "";
- }
- }
- } else {
- data =
- response && response.json
- ? await response.json()
- : {};
- }
- }
-
- const result = {
- status: response.status,
- statusText: response.statusText,
- url: response.url,
- headers: response.headers,
- data: data,
- };
-
- useApplicationStore().unavailable = false;
- if (response.status >= 300) {
- if (response.status === 503) {
- useApplicationStore().unavailable = true;
- }
-
- if (options.callback) {
- options.callback(result);
- } else {
- reject(result);
- }
-
- return;
- }
-
- if (options.callback) {
- if (fetchOptions.method == "GET") {
- const modified = useCacheStore().updateCache(
- url,
- result,
- );
-
- if (modified == false) {
- return;
- }
- }
-
- options.callback(result);
- return;
- }
-
- resolve(result);
- })
- .catch((error) => {
- // Handle any errors thrown during the fetch process
- const { response, ...rest } = error;
- const result = {
- ...rest,
- response: response && response.json(),
- };
-
- if (options.callback) {
- options.callback(result);
- } else {
- reject(result);
- }
-
- return;
- });
- }
- });
- },
-
- get: async function (options: ApiOptions | string): Promise {
- let apiOptions = {} as ApiOptions;
-
- if (typeof options == "string") {
- apiOptions.url = options;
- } else {
- apiOptions = options;
- }
-
- apiOptions.method = "GET";
- return await this.send(apiOptions);
- },
-
- post: async function (options: ApiOptions | string): Promise {
- let apiOptions = {} as ApiOptions;
-
- if (typeof options == "string") {
- apiOptions.url = options;
- } else {
- apiOptions = options;
- }
-
- apiOptions.method = "POST";
- return await this.send(apiOptions);
- },
-
- put: async function (options: ApiOptions | string): Promise {
- let apiOptions = {} as ApiOptions;
-
- if (typeof options == "string") {
- apiOptions.url = options;
- } else {
- apiOptions = options;
- }
-
- apiOptions.method = "PUT";
- return await this.send(apiOptions);
- },
-
- delete: async function (
- options: ApiOptions | string,
- ): Promise {
- let apiOptions = {} as ApiOptions;
-
- if (typeof options == "string") {
- apiOptions.url = options;
- } else {
- apiOptions = options;
- }
-
- apiOptions.method = "DELETE";
- return await this.send(apiOptions);
- },
-
- chunk: async function (options: ApiOptions | string): Promise {
- let apiOptions = {} as ApiOptions;
-
- // setup api options
- if (typeof options == "string") {
- apiOptions.url = options;
- } else {
- apiOptions = options;
- }
-
- // set method to post by default
- if (!Object.prototype.hasOwnProperty.call(apiOptions, "method")) {
- apiOptions.method = "POST";
- }
-
- // check for chunk option
- if (
- Object.prototype.hasOwnProperty.call(apiOptions, "chunk") &&
- Object.prototype.hasOwnProperty.call(apiOptions, "body") &&
- apiOptions.body instanceof FormData
- ) {
- if (apiOptions.body.has(apiOptions.chunk)) {
- const file = apiOptions.body.get(apiOptions.chunk);
-
- if (file instanceof File) {
- const chunkSize = 2 * 1024 * 1024;
- let chunk = 0;
- let chunkCount = 1;
- let job_id = -1;
-
- if (file.size > chunkSize) {
- chunkCount = Math.ceil(file.size / chunkSize);
- }
-
- let result = null;
- for (chunk = 0; chunk < chunkCount; chunk++) {
- const offset = chunk * chunkSize;
- const fileChunk = file.slice(
- offset,
- offset + chunkSize,
- );
-
- const chunkFormData = new FormData();
- if (job_id == -1) {
- for (const [field, value] of apiOptions.body) {
- chunkFormData.append(field, value);
- }
-
- chunkFormData.append("name", file.name);
- chunkFormData.append("size", file.size.toString());
- chunkFormData.append("mime_type", file.type);
- } else {
- chunkFormData.append("job_id", job_id.toString());
- }
-
- chunkFormData.set(apiOptions.chunk, fileChunk);
- chunkFormData.append("chunk", (chunk + 1).toString());
- chunkFormData.append(
- "chunk_count",
- chunkCount.toString(),
- );
-
- const chunkOptions = {
- method: apiOptions.method,
- url: apiOptions.url,
- params: apiOptions.params || {},
- body: chunkFormData,
- headers: apiOptions.headers || {},
- progress: (progressEvent) => {
- if (
- Object.prototype.hasOwnProperty.call(
- apiOptions,
- "progress",
- )
- ) {
- apiOptions.progress({
- loaded:
- chunk * chunkSize +
- progressEvent.loaded,
- total: file.size,
- });
- }
- },
- };
-
- result = await this.send(chunkOptions);
- job_id = result.data.media_job.id;
- }
-
- return result;
- }
- }
- }
-
- return await this.send(apiOptions);
- },
-};
-
-/**
- * Get an api result data as type.
- * @param result The api result object.
- * @param defaultValue The default data to return if no result exists.
- * @returns Data object.
- */
-export function getApiResultData(
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- result: any,
- defaultValue: T | null = null,
-): T | null {
- if (!result || !Object.prototype.hasOwnProperty.call(result, "data")) {
- return defaultValue;
- }
-
- const data = result.data as T;
- return data instanceof Object ? data : defaultValue;
-}
diff --git a/resources/js/helpers/api.types.ts b/resources/js/helpers/api.types.ts
deleted file mode 100644
index c8c110c..0000000
--- a/resources/js/helpers/api.types.ts
+++ /dev/null
@@ -1,190 +0,0 @@
-export type Booleanish = boolean | "true" | "false";
-
-export type EmptyObject = { [key: string]: never };
-
-export interface SessionRequest {
- id: number;
- session_id: number;
- type: string;
- path: string;
- created_at: string;
- updated_at: string;
-}
-
-export interface Session {
- id: number;
- ip: string;
- useragent: string;
- created_at: string;
- updated_at: string;
- ended_at: string;
- requests?: SessionRequest[];
-}
-
-export interface SessionCollection {
- sessions: Session[];
- total: number;
-}
-
-export interface SessionRequestCollection {
- session: Session;
-}
-
-export interface Event {
- id: string;
- title: string;
- hero: Media;
- content: string;
- start_at: string;
- end_at: string;
- publish_at: string;
- location: string;
- location_url: string;
- address: string;
- status: string;
- registration_type: string;
- registration_data: string;
- price: string;
- ages: string;
- attachments: Array;
- created_at: string;
- updated_at: string;
-}
-
-export interface EventResponse {
- event: Event;
-}
-
-export interface EventCollection {
- events: Event[];
- total: number;
-}
-
-export interface Media {
- id: string;
- user_id: string;
- title: string;
- name: string;
- mime_type: string;
- security_type: string;
- size: number;
- storage: string;
- url: string;
- thumbnail: string;
- description: string;
- dimensions: string;
- variants: { [key: string]: string };
- created_at: string;
- updated_at: string;
- jobs: Array;
-}
-
-export interface MediaResponse {
- medium: Media;
-}
-
-export interface MediaCollection {
- media: Array;
- total: number;
-}
-
-export interface MediaJob {
- id: string;
- media_id: string;
- user_id: string;
- status: string;
- status_text: string;
- progress: number;
- progress_max: number;
-}
-
-export interface MediaJobResponse {
- media_job: MediaJob;
-}
-
-export interface Article {
- id: string;
- title: string;
- slug: string;
- user_id: string;
- user: User;
- content: string;
- publish_at: string;
- hero: Media;
- gallery: Array;
- attachments: Array;
-}
-
-export interface Article {
- id: string;
- title: string;
- slug: string;
- user: User;
- content: string;
- publish_at: string;
- hero: Media;
- attachments: Array;
- created_at: string;
- updated_at: string;
-}
-
-export interface ArticleResponse {
- article: Article;
-}
-
-export interface ArticleCollection {
- articles: Array;
- total: number;
-}
-
-export interface User {
- id: string;
- username: string;
- email: string;
- first_name: string;
- last_name: string;
- phone: string;
- display_name: string;
-}
-
-export interface UserResponse {
- user: User;
-}
-
-export interface UserCollection {
- users: Array;
- total: number;
-}
-
-export interface LoginResponse {
- user: User;
- token: string;
-}
-
-export interface LogsDiscordResponse {
- log: {
- output: string;
- error: string;
- };
-}
-
-export interface Shortlink {
- id: number;
- code: string;
- url: string;
- used: number;
-}
-
-export interface ShortlinkCollection {
- shortlinks: Array;
- total: number;
-}
-
-export interface ShortlinkResponse {
- shortlink: Shortlink;
-}
-
-export interface ApiInfo {
- version: string;
- max_upload_size: number;
-}
diff --git a/resources/js/helpers/array.ts b/resources/js/helpers/array.ts
deleted file mode 100644
index 10d1667..0000000
--- a/resources/js/helpers/array.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Test if array has a match using basic search (* means anything)
- *
- * @param {Array} arr The array to search.
- * @param {string} str The string to find.
- * @returns {boolean} if the array has the string.
- */
-export const arrayHasBasicMatch = (
- arr: Array,
- str: string
-): boolean => {
- let matches = false;
-
- arr.every((elem) => {
- elem = elem.replace(/[|\\{}()[\]^$+?.]/g, "\\$&");
- const regex = new RegExp("^" + elem.replace("*", ".*?") + "$", "i");
- if (str.match(regex)) {
- matches = true;
- }
- return !matches;
- });
-
- return matches;
-};
diff --git a/resources/js/helpers/datetime.ts b/resources/js/helpers/datetime.ts
deleted file mode 100644
index 7b6e9f7..0000000
--- a/resources/js/helpers/datetime.ts
+++ /dev/null
@@ -1,462 +0,0 @@
-export class SMDate {
- date: Date | null = null;
- dayString: string[] = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
-
- fullDayString: string[] = [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- ];
-
- monthString: string[] = [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- ];
-
- fullMonthString: string[] = [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
- ];
-
- constructor(
- dateOrString: string | Date = "",
- options: { format?: string; utc?: boolean } = {},
- ) {
- this.date = null;
-
- if (typeof dateOrString === "string") {
- if (dateOrString.length > 0) {
- this.parse(dateOrString, options);
- }
- } else if (
- dateOrString instanceof Date &&
- !Number.isNaN(dateOrString.getTime())
- ) {
- this.date = dateOrString;
- }
- }
-
- /**
- * Parse a string date into a Date object
- * @param {string} dateString The date string.
- * @param {object} options (optional) Options object.
- * @param {string} options.format (optional) The format of the date string.
- * @param {boolean} options.utc (optional) The date string is UTC.
- * @returns {SMDate} SMDate object.
- */
- public parse(
- dateString: string,
- { format = "dmy", utc = false } = {},
- ): SMDate {
- const now = new Date();
- let time = "";
-
- if (dateString.toLowerCase() === "now") {
- this.date = now;
- return this;
- }
-
- // Cache regular expressions
- const isoDateRegex =
- /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,10})?Z$/i;
- const timeRegex =
- /^(\d+)(?::(\d+))?(?::(\d+))? ?(am?|a\.m\.|pm?|p\.m\.)?$/i;
-
- // Test if the dateString is in ISO 8601
- if (isoDateRegex.test(dateString)) {
- format = "YMd";
- [dateString, time] = dateString.split("T");
- time = time.slice(0, -8);
- }
-
- // Split the date string into an array of components based on the length of each date component
- const components = dateString.split(/[ /-]/);
-
- const [day, month, year] =
- format === "dmy"
- ? components
- : format === "mdy"
- ? [components[1], components[0], components[2]]
- : [components[2], components[1], components[0]];
-
- if (year === undefined || year.length === 3 || year.length >= 5) {
- return this;
- }
-
- // numeric
- for (const component of [day, month, year]) {
- if (isNaN(parseInt(component))) {
- return this;
- }
- }
-
- const parsedDay = parseInt(day.padStart(2, "0"), 10);
- const parsedMonth = this.getMonthAsNumber(month);
- const parsedYear = parseInt(year.padStart(4, "20"), 10);
- let parsedHours: number = 0,
- parsedMinutes: number = 0,
- parsedSeconds: number = 0;
-
- if (time.length == 0 && components.length > 3) {
- time = components.slice(3).join(" ");
- }
- const parsedTime = timeRegex.exec(time);
- if (time && parsedTime) {
- const [_, hourStr, minuteStr, secondStr, ampm] = parsedTime;
- parsedHours = parseInt(hourStr);
- parsedMinutes = parseInt(minuteStr || "0");
- parsedSeconds = parseInt(secondStr || "0");
-
- if (parsedHours < 0 || parsedHours > 23) {
- return this;
- }
-
- if (ampm) {
- if (/pm/i.test(ampm) && parsedHours < 12) {
- parsedHours += 12;
- } else if (/am/i.test(ampm) && parsedHours === 12) {
- parsedHours = 0;
- }
- }
-
- if (
- parsedMinutes < 0 ||
- parsedMinutes > 59 ||
- parsedSeconds < 0 ||
- parsedSeconds > 59
- ) {
- return this;
- }
-
- time = `${parsedHours.toString().padStart(2, "0")}:${parsedMinutes
- .toString()
- .padStart(2, "0")}:${parsedSeconds
- .toString()
- .padStart(2, "0")}`;
- } else {
- time = "00:00:00";
- }
-
- const date = utc
- ? new Date(
- Date.UTC(
- parsedYear,
- parsedMonth - 1,
- parsedDay,
- parsedHours,
- parsedMinutes,
- parsedSeconds,
- ),
- )
- : new Date(
- parsedYear,
- parsedMonth - 1,
- parsedDay,
- parsedHours,
- parsedMinutes,
- parsedSeconds,
- );
-
- if (isNaN(date.getTime())) {
- return this;
- }
-
- if (utc) {
- const isoDate = date.toISOString();
- const checkYear = parseInt(isoDate.substring(0, 4), 10);
- const checkMonth = parseInt(isoDate.substring(5, 7), 10);
- const checkDay = new Date(isoDate).getUTCDate();
- const checkHours = parseInt(isoDate.substring(11, 13), 10);
- const checkMinutes = parseInt(isoDate.substring(14, 16), 10);
- const checkSeconds = parseInt(isoDate.substring(17, 19), 10);
- if (
- checkYear !== parsedYear ||
- checkMonth !== parsedMonth ||
- checkDay !== parsedDay ||
- checkHours !== parsedHours ||
- checkMinutes !== parsedMinutes ||
- checkSeconds !== parsedSeconds
- ) {
- return this;
- }
- } else {
- if (
- date.getFullYear() !== parsedYear ||
- date.getMonth() + 1 !== parsedMonth ||
- date.getDate() !== parsedDay ||
- date.getHours() !== parsedHours ||
- date.getMinutes() !== parsedMinutes ||
- date.getSeconds() !== parsedSeconds
- ) {
- return this;
- }
- }
-
- this.date = date;
- return this;
- }
-
- /**
- * Format the date to a string.
- * @param {string} format The format to return.
- * @param {object} options (optional) Function options.
- * @param {boolean} options.utc (optional) Format the date to be as UTC instead of local.
- * @returns {string} The formatted date.
- */
- public format(format: string, options: { utc?: boolean } = {}): string {
- if (this.date == null) {
- return "";
- }
-
- let result = format;
-
- let year: string,
- month: string,
- date: string,
- day: number,
- hour: string,
- min: string,
- sec: string;
- if (options.utc) {
- const isoDate = this.date.toISOString();
- year = isoDate.substring(0, 4);
- month = isoDate.substring(5, 7);
- date = isoDate.substring(8, 10);
- day = new Date(isoDate).getUTCDay();
- hour = isoDate.substring(11, 13);
- min = isoDate.substring(14, 16);
- sec = isoDate.substring(17, 19);
- } else {
- year = this.date.getFullYear().toString();
- month = (this.date.getMonth() + 1).toString();
- date = this.date.getDate().toString();
- day = this.date.getDay();
- hour = this.date.getHours().toString();
- min = this.date.getMinutes().toString();
- sec = this.date.getSeconds().toString();
- }
-
- const apm = parseInt(hour, 10) >= 12 ? "pm" : "am";
- /* eslint-disable indent */
- const apmhours = (
- parseInt(hour, 10) > 12
- ? parseInt(hour, 10) - 12
- : parseInt(hour, 10) == 0
- ? 12
- : parseInt(hour, 10)
- ).toString();
- /* eslint-enable indent */
-
- // year
- result = result.replace(/\byy\b/g, year.slice(-2));
- result = result.replace(/\byyyy\b/g, year);
-
- // month
- result = result.replace(/\bM\b/g, month);
- result = result.replace(/\bMM\b/g, (0 + month).slice(-2));
- result = result.replace(
- /\bMMM\b/g,
- this.monthString[parseInt(month) - 1],
- );
- result = result.replace(
- /\bMMMM\b/g,
- this.fullMonthString[parseInt(month) - 1],
- );
-
- // day
- result = result.replace(/\bd\b/g, date);
- result = result.replace(/\bdd\b/g, (0 + date).slice(-2));
- result = result.replace(/\bEEE\b/g, this.dayString[day]);
- result = result.replace(/\bEEEE\b/g, this.fullDayString[day]);
-
- // hour
- result = result.replace(/\bH\b/g, hour);
- result = result.replace(/\bHH\b/g, (0 + hour).slice(-2));
- result = result.replace(/\bh\b/g, apmhours);
- result = result.replace(/\bhh\b/g, (0 + apmhours).slice(-2));
-
- // min
- result = result.replace(/\bm\b/g, min);
- result = result.replace(/\bmm\b/g, (0 + min).slice(-2));
-
- // sec
- result = result.replace(/\bs\b/g, sec);
- result = result.replace(/\bss\b/g, (0 + sec).slice(-2));
-
- // am/pm
- result = result.replace(/\baa\b/g, apm);
- result = result.replace(/\bAA\b/g, apm.toUpperCase());
-
- return result;
- }
-
- /**
- * Return a relative date string from now.
- * @returns {string} A relative date string.
- */
- public relative(): string {
- if (this.date === null) {
- return "";
- }
-
- const now = new Date();
- let dif = Math.round((now.getTime() - this.date.getTime()) / 1000);
- const format = dif < 0 ? "in %" : "% ago";
- dif = Math.abs(dif);
-
- if (dif < 60) {
- return "Just now";
- } else if (dif < 3600) {
- const v = Math.round(dif / 60);
- return format.replace("%", `${v} min${v != 1 ? "s" : ""}`);
- } else if (dif < 86400) {
- const v = Math.round(dif / 3600);
- return format.replace("%", `${v} hour${v != 1 ? "s" : ""}`);
- } else if (dif < 604800) {
- const v = Math.round(dif / 86400);
- return format.replace("%", `${v} day${v != 1 ? "s" : ""}`);
- } else if (dif < 2419200) {
- const v = Math.round(dif / 604800);
- return format.replace("%", `${v} week${v != 1 ? "s" : ""}`);
- } else {
- return (
- this.monthString[this.date.getMonth()] +
- " " +
- this.date.getDate() +
- ", " +
- this.date.getFullYear()
- );
- }
- }
-
- /**
- * If the date is before the passed date.
- * @param {Date|SMDate} d (optional) The date to check. If none, use now
- * @returns {boolean} If the date is before the passed date.
- */
- public isBefore(d: Date | SMDate = new SMDate("now")): boolean {
- const otherDate = d instanceof SMDate ? d.date : d;
- if (otherDate == null) {
- return false;
- }
-
- if (this.date == null) {
- return true;
- }
-
- return otherDate > this.date;
- }
-
- /**
- * If the date is after the passed date.
- * @param {Date|SMDate} d (optional) The date to check. If none, use now
- * @returns {boolean} If the date is after the passed date.
- */
- public isAfter(d: Date | SMDate = new SMDate("now")): boolean {
- const otherDate = d instanceof SMDate ? d.date : d;
- if (otherDate == null) {
- return false;
- }
-
- if (this.date == null) {
- return true;
- }
-
- return otherDate < this.date;
- }
-
- /**
- * Return a month number from a string or a month number or month name
- * @param {string} monthString The month string as number or name
- * @returns {number} The month number
- */
- private getMonthAsNumber(monthString: string): number {
- const months = this.fullMonthString.map((month) => month.toLowerCase());
-
- const shortMonths = months.map((month) => month.slice(0, 3));
- const monthIndex = months.indexOf(monthString.toLowerCase());
- if (monthIndex !== -1) {
- return monthIndex + 1;
- }
- const shortMonthIndex = shortMonths.indexOf(monthString.toLowerCase());
- if (shortMonthIndex !== -1) {
- return shortMonthIndex + 1;
- }
- const monthNumber = parseInt(monthString, 10);
- if (!isNaN(monthNumber) && monthNumber >= 1 && monthNumber <= 12) {
- return monthNumber;
- }
-
- return 0;
- }
-
- /**
- * Test if the current date is valid.
- * @returns {boolean} If the current date is valid.
- */
- public isValid(): boolean {
- return this.date !== null;
- }
-
- /**
- * Return a string with only the first occurrence of characters
- * @param {string} str The string to modify.
- * @param {string} characters The characters to use to test.
- * @returns {string} A string that only contains the first occurrence of the characters.
- */
- private onlyFirstOccurrence(
- str: string,
- characters: string = "dMy",
- ): string {
- let findCharacters = characters.split("");
- const replaceRegex = new RegExp("[^" + characters + "]", "g");
- let result = "";
-
- str = str.replace(replaceRegex, "");
- if (str.length > 0) {
- str.split("").forEach((strChar) => {
- if (
- findCharacters.length > 0 &&
- findCharacters.includes(strChar)
- ) {
- result += strChar;
-
- const index = findCharacters.findIndex(
- (findChar) => findChar === strChar,
- );
- if (index !== -1) {
- findCharacters = findCharacters
- .slice(0, index)
- .concat(findCharacters.slice(index + 1));
- }
- }
- });
- }
-
- return result;
- }
-}
diff --git a/resources/js/helpers/debounce.ts b/resources/js/helpers/debounce.ts
deleted file mode 100644
index 3200e6e..0000000
--- a/resources/js/helpers/debounce.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-type DebounceCallback = (...args: unknown[]) => void;
-type DebounceResult = (...args: unknown[]) => void;
-
-/**
- * Call a function after a delay once.
- *
- * @param {Function} fn The function to call.
- * @param {number} delay The delay before calling function.
- * @returns {void}
- */
-export const debounce = (
- fn: DebounceCallback,
- delay: number
-): DebounceResult => {
- let timeoutID: NodeJS.Timeout | null = null;
- return (...args) => {
- if (timeoutID != null) {
- clearTimeout(timeoutID);
- }
-
- // eslint-disable-next-line @typescript-eslint/no-this-alias
- const that = this;
- timeoutID = setTimeout(function () {
- fn.apply(that, args);
- }, delay);
- };
-};
diff --git a/resources/js/helpers/form.ts b/resources/js/helpers/form.ts
deleted file mode 100644
index 3f132cb..0000000
--- a/resources/js/helpers/form.ts
+++ /dev/null
@@ -1,221 +0,0 @@
-import { ApiResponse } from "./api";
-import {
- createValidationResult,
- defaultValidationResult,
- ValidationObject,
- ValidationResult,
-} from "./validate";
-
-type FormObjectValidateFunction = (item?: string | null) => Promise;
-type FormObjectLoadingFunction = (state?: boolean) => boolean;
-type FormObjectMessageFunction = (
- message?: string,
- type?: string,
- icon?: string,
-) => void;
-type FormObjectErrorFunction = (message: string) => void;
-type FormObjectApiErrorsFunction = (
- apiErrors: ApiResponse,
- callback?: (error: string, status: number) => void,
-) => void;
-
-export interface FormObject {
- validate: FormObjectValidateFunction;
- loading: FormObjectLoadingFunction;
- message: FormObjectMessageFunction;
- error: FormObjectErrorFunction;
- apiErrors: FormObjectApiErrorsFunction;
- _loading: boolean;
- _message: string;
- _messageType: string;
- _messageIcon: string;
- controls: { [key: string]: FormControlObject };
-}
-
-const defaultFormObject: FormObject = {
- validate: async function (item = null) {
- const keys = item ? [item] : Object.keys(this.controls);
- let valid = true;
-
- await Promise.all(
- keys.map(async (key) => {
- if (
- typeof this.controls[key] == "object" &&
- Object.keys(this.controls[key]).includes("validation")
- ) {
- const validationResult = await this.controls[
- key
- ].validation.validator.validate(this.controls[key].value);
- this.controls[key].validation.result = validationResult;
-
- if (!validationResult.valid) {
- valid = false;
- }
- }
- }),
- );
-
- return valid;
- },
- loading: function (state = undefined) {
- if (state !== undefined) {
- this._loading = state;
- }
-
- return this._loading;
- },
- message: function (message = "", type = "", icon = "") {
- this._message = message;
-
- if (type.length > 0) {
- this._messageType = type;
- }
- if (icon.length > 0) {
- this._messageIcon = icon;
- }
- },
- error: function (message = "") {
- if (message == "") {
- this.message("");
- } else {
- this.message(message, "error", "alert-circle-outline");
- }
- },
- apiErrors: function (
- apiResponse: ApiResponse,
- callback?: (error: string, status: number) => void,
- ) {
- let foundKeys = false;
-
- if (
- apiResponse.data &&
- typeof apiResponse.data === "object" &&
- "errors" in apiResponse.data
- ) {
- const errors = apiResponse.data.errors as Record;
- Object.keys(errors).forEach((key) => {
- if (
- typeof this.controls[key] === "object" &&
- Object.keys(this.controls[key]).includes("validation")
- ) {
- foundKeys = true;
- this.controls[key].validation.result =
- createValidationResult(false, errors[key]);
- }
- });
- }
-
- if (foundKeys == false) {
- const errorMessage =
- (apiResponse?.json?.message as string) ||
- "An unknown server error occurred.\nPlease try again later.";
-
- if (callback) {
- callback(errorMessage, apiResponse.status);
- } else {
- this.error(errorMessage);
- }
- }
- },
- controls: {},
-
- _loading: false,
- _message: "",
- _messageType: "primary",
- _messageIcon: "",
-};
-
-/**
- * Create a new Form object.
- * @param {Record} controls The controls included in the form.
- * @returns {FormObject} Returns a form object.
- */
-export const Form = (
- controls: Record,
-): FormObject => {
- const form = { ...defaultFormObject };
- form.controls = controls;
-
- form._loading = false;
- form._message = "";
- form._messageType = "primary";
- form._messageIcon = "";
-
- return form;
-};
-
-interface FormControlValidation {
- validator: ValidationObject;
- result: ValidationResult;
-}
-
-const getDefaultFormControlValidation = (): FormControlValidation => {
- return {
- validator: {
- validate: async (): Promise => {
- return defaultValidationResult;
- },
- },
- result: defaultValidationResult,
- };
-};
-
-type FormControlClearValidations = () => void;
-type FormControlSetValidation = (
- valid: boolean,
- message?: string | Array,
-) => void;
-type FormControlIsValid = () => boolean;
-
-export interface FormControlObject {
- value: unknown;
- validate: () => Promise;
- validation: FormControlValidation;
- clearValidations: FormControlClearValidations;
- setValidationResult: FormControlSetValidation;
- isValid: FormControlIsValid;
-}
-
-/**
- * Create a new form control object.
- * @param {string} value The control name.
- * @param {ValidationObject | null} validator The control validation rules.
- * @returns {FormControlObject} The form control object.
- */
-export const FormControl = (
- value: unknown = "",
- validator: ValidationObject | null = null,
-): FormControlObject => {
- return {
- value: value,
- validation:
- validator == null
- ? getDefaultFormControlValidation()
- : {
- validator: validator,
- result: defaultValidationResult,
- },
- clearValidations: function () {
- this.validation.result = defaultValidationResult;
- },
- setValidationResult: function (
- valid: boolean,
- message?: string | Array,
- ) {
- this.validation.result = createValidationResult(valid, message);
- },
- validate: async function () {
- if (this.validation.validator) {
- this.validation.result =
- await this.validation.validator.validate(this.value);
-
- return this.validation.result;
- }
-
- return defaultValidationResult;
- },
- isValid: function () {
- return this.validation.result.valid;
- },
- };
-};
diff --git a/resources/js/helpers/image.ts b/resources/js/helpers/image.ts
deleted file mode 100644
index 48cee62..0000000
--- a/resources/js/helpers/image.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { ImportMetaExtras } from "../../../import-meta";
-import { urlStripAttributes } from "./url";
-
-type ImageLoadCallback = (url: string) => void;
-
-export const imageLoad = (
- url: string,
- callback: ImageLoadCallback,
- postfix = "size=thumb"
-) => {
- if (
- url.startsWith((import.meta as ImportMetaExtras).env.APP_URL) === true
- ) {
- callback(urlStripAttributes(url) + "?" + postfix);
- const tmp = new Image();
- tmp.onload = function () {
- callback(url);
- };
- tmp.src = url;
- } else {
- // Image is not one we control
- callback(url);
- }
-};
-
-export const imageSize = (size: string, url: string) => {
- const availableSizes = [
- "thumb",
- "small",
- "medium",
- "large",
- "xlarge",
- "xxlarge",
- ];
- if (availableSizes.includes(size)) {
- if (
- url.startsWith((import.meta as ImportMetaExtras).env.APP_URL) ===
- true ||
- url.startsWith("/") === true
- ) {
- return `${url}?size=${size}`;
- }
- }
-
- return url;
-};
-
-// Thumb 150 x 150
-export const imageThumb = (url: string) => {
- return imageSize("thumb", url);
-};
-
-// Small 300 x 300
-export const imageSmall = (url: string) => {
- return imageSize("small", url);
-};
-
-// Small 640 x 640
-export const imageMedium = (url: string) => {
- return imageSize("medium", url);
-};
-
-// Large 1024 x 1024
-export const imageLarge = (url: string) => {
- return imageSize("large", url);
-};
-
-// Large 1536 x 1536
-export const imageXLarge = (url: string) => {
- return imageSize("xlarge", url);
-};
-
-// Large 2560 x 2560
-export const imageXXLarge = (url: string) => {
- return imageSize("xxlarge", url);
-};
-
-// Full size
-export const imageFull = (url: string) => {
- return imageSize("full", url);
-};
diff --git a/resources/js/helpers/media.ts b/resources/js/helpers/media.ts
deleted file mode 100644
index bcca2c9..0000000
--- a/resources/js/helpers/media.ts
+++ /dev/null
@@ -1,309 +0,0 @@
-import { ImportMetaExtras } from "../../../import-meta";
-import { Media, MediaJob } from "./api.types";
-import { strCaseCmp, toTitleCase } from "./string";
-
-export const mediaGetVariantUrl = (
- media: Media,
- variant = "scaled",
-): string => {
- if (!media) {
- return "";
- }
-
- // If the variant is 'original', return the media url
- if (variant === "original") {
- return media.url;
- }
-
- // If the variant key exists in media.variants, return the corresponding variant URL
- if (media.variants && media.variants[variant]) {
- return media.url.replace(media.name, media.variants[variant]);
- }
-
- // If the variant key does not exist, return the 'scaled' variant
- return media.variants && media.variants["scaled"]
- ? media.url.replace(media.name, media.variants["scaled"])
- : media.url;
-};
-
-/**
- * Convert a Media URL to a user friendly URL
- * @param {Media|string} mediaOrString Media object or URL string
- * @returns {string} User friendly URL
- */
-export const mediaGetWebURL = (mediaOrString: Media | string): string => {
- const webUrl = (import.meta as ImportMetaExtras).env.APP_URL;
- const apiUrl = (import.meta as ImportMetaExtras).env.APP_URL_API;
-
- let url =
- typeof mediaOrString === "string"
- ? mediaOrString
- : (mediaOrString as Media).url;
-
- // If the input is a string, use it as the URL directly
- if (typeof mediaOrString === "string") {
- return url;
- }
-
- // Is the URL an API request?
- if (url.startsWith(apiUrl)) {
- const fileUrlPath = url.substring(apiUrl.length);
- const fileUrlParts = fileUrlPath.split("/");
-
- if (
- fileUrlParts.length >= 4 &&
- fileUrlParts[0].length === 0 &&
- strCaseCmp("media", fileUrlParts[1]) === true &&
- strCaseCmp("download", fileUrlParts[3]) === true
- ) {
- url = webUrl + "/file/" + fileUrlParts[2];
- }
- }
-
- return url;
-};
-
-/**
- * Check if a mime matches.
- * @param {string} mimeExpected The mime expected.
- * @param {string} mimeToCheck The mime to check.
- * @returns {boolean} The mimeToCheck matches mimeExpected.
- */
-export const mimeMatches = (
- mimeExpected: string,
- mimeToCheck: string,
-): boolean => {
- if (mimeExpected.length == 0) {
- mimeExpected = "*";
- }
-
- const escapedExpectation = mimeExpected.replace(
- /[.*+?^${}()|[\]\\]/g,
- "\\$&",
- );
- const pattern = escapedExpectation.replace(/\\\*/g, ".*");
- const regex = new RegExp(`^${pattern}$`);
-
- return regex.test(mimeToCheck);
-};
-
-/**
- * MediaGetThumbnailCallback Type
- */
-export type mediaGetThumbnailCallback = (url: string) => void;
-
-/**
- * Get Media/File Thumbnail.
- * @param {Media|File} media The Media/File object.
- * @param {string|null} useVariant The variable to use.
- * @param {mediaGetThumbnailCallback|null} callback Callback with the thumbnail. Required when passing File.
- * @returns {string} The thumbnail url.
- */
-export const mediaGetThumbnail = (
- media: Media | File,
- useVariant: string | null = "",
- callback: mediaGetThumbnailCallback | null = null,
-): string => {
- let url: string = "";
-
- if (media) {
- if (media instanceof File) {
- if (callback != null) {
- if (mimeMatches("image/*", media.type) == true) {
- const reader = new FileReader();
-
- reader.onload = function (e) {
- callback(e.target.result.toString());
- };
-
- reader.readAsDataURL(media);
- return "";
- }
- }
- } else {
- if (
- useVariant &&
- useVariant != "" &&
- useVariant != null &&
- media.variants &&
- media.variants[useVariant]
- ) {
- url = media.url.replace(media.name, media.variants[useVariant]);
- } else if (media.thumbnail && media.thumbnail.length > 0) {
- url = media.thumbnail;
- } else if (media.variants && media.variants["thumb"]) {
- url = media.url.replace(media.name, media.variants["thumb"]);
- }
- }
-
- if (url === "") {
- url = "/assets/fileicons/unknown.webp";
- }
- }
-
- if (callback != null) {
- callback(url);
- return "";
- }
-
- return url;
-};
-
-/**
- * Check if the media is currently busy.
- * @param {Media} media The media item to check.
- * @returns {boolean} If the media is busy.
- */
-export const mediaIsBusy = (media: Media): boolean => {
- let busy = false;
-
- if (media.jobs) {
- media.jobs.forEach((item) => {
- if (
- item.status != "invalid" &&
- item.status != "complete" &&
- item.status != "failed"
- ) {
- busy = true;
- }
- });
- }
-
- return busy;
-};
-
-interface MediaStatus {
- busy: boolean;
- status: string;
- status_text: string;
- progress: number;
-}
-
-/**
- * Get the current Media status
- * @param {Media} media The media item to check.
- * @returns {MediaStatus} The media status.
- */
-export const getMediaStatus = (media: Media): MediaStatus => {
- const status = {
- busy: false,
- status: "",
- status_text: "",
- progress: 0,
- };
-
- if (media.jobs) {
- for (const item of media.jobs) {
- if (
- item.status != "invalid" &&
- item.status != "complete" &&
- item.status != "failed"
- ) {
- status.busy = true;
- status.status = item.status;
- status.status_text = item.status_text;
- status.progress = item.progress;
- break;
- }
- }
- }
-
- return status;
-};
-
-/**
- * Get the current Media status Text
- * @param {Media} media The media item to check.
- * @returns {string} Human readable string.
- */
-export const getMediaStatusText = (media: Media): string => {
- let status = "";
-
- if (media.jobs.length > 0) {
- if (
- media.jobs[0].status != "invalid" &&
- media.jobs[0].status != "failed" &&
- media.jobs[0].status != "complete"
- ) {
- if (media.jobs[0].status_text != "") {
- status = toTitleCase(media.jobs[0].status_text);
- } else {
- status = toTitleCase(media.jobs[0].status);
- }
-
- if (media.jobs[0].progress_max != 0) {
- status += ` ${Math.floor(
- (media.jobs[0].progress / media.jobs[0].progress_max) * 100,
- )}%`;
- }
- }
- }
-
- return status;
-};
-
-export interface MediaParams {
- id?: string;
- user_id?: string;
- title?: string;
- name?: string;
- mime_type?: string;
- permission?: string;
- size?: number;
- storage?: string;
- url?: string;
- thumbnail?: string;
- description?: string;
- dimensions?: string;
- variants?: { [key: string]: string };
- created_at?: string;
- updated_at?: string;
- jobs?: Array;
-}
-
-export interface MediaJobParams {
- id?: string;
- media_id?: string;
- user_id?: string;
- status?: string;
- status_text?: string;
- progress?: number;
- progress_max?: number;
-}
-
-export const createMediaItem = (params?: MediaParams): Media => {
- const media = {
- id: params.id || "",
- user_id: params.user_id || "",
- title: params.title || "",
- name: params.name || "",
- mime_type: params.mime_type || "",
- permission: params.permission || "",
- size: params.size !== undefined ? params.size : 0,
- storage: params.storage || "",
- url: params.url || "",
- thumbnail: params.thumbnail || "",
- description: params.description || "",
- dimensions: params.dimensions || "",
- variants: params.variants || {},
- created_at: params.created_at || "",
- updated_at: params.updated_at || "",
- jobs: params.jobs || [],
- };
-
- return media;
-};
-
-export const createMediaJobItem = (params?: MediaJobParams): MediaJob => {
- const job = {
- id: params.id || "",
- media_id: params.media_id || "",
- user_id: params.user_id || "",
- status: params.status || "",
- status_text: params.status_text || "",
- progress: params.progress || 0,
- progress_max: params.progress_max || 0,
- };
-
- return job;
-};
diff --git a/resources/js/helpers/object.ts b/resources/js/helpers/object.ts
deleted file mode 100644
index efa73a2..0000000
--- a/resources/js/helpers/object.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Sort a objects properties alphabetically
- *
- * @param {Record} obj The object to sort
- * @returns {Record} The object sorted
- */
-export const sortProperties = (
- obj: Record
-): Record => {
- // convert object into array
- const sortable: [string, unknown][] = [];
- for (const key in obj)
- if (Object.prototype.hasOwnProperty.call(obj, key))
- sortable.push([key, obj[key]]); // each item is an array in format [key, value]
-
- // sort items by value
- sortable.sort(function (a, b) {
- const x = String(a[1]).toLowerCase(),
- y = String(b[1]).toLowerCase();
- return x < y ? -1 : x > y ? 1 : 0;
- });
-
- const sortedObj: Record = {};
- sortable.forEach((item) => {
- sortedObj[item[0]] = item[1];
- });
-
- return sortedObj; // array in format [ [ key1, val1 ], [ key2, val2 ], ... ]
-};
diff --git a/resources/js/helpers/seo.ts b/resources/js/helpers/seo.ts
deleted file mode 100644
index 38df10d..0000000
--- a/resources/js/helpers/seo.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-export interface SEOTags {
- title: string;
- description: string;
- keywords: string[];
- robots: {
- index: boolean;
- follow: boolean;
- };
- url: string;
- image: string;
-}
-
-export const updateSEOTags = (tags: SEOTags): void => {
- const updateTag = (
- tag: string,
- queryAttribName: string,
- queryAttribValue: string,
- updateAttribName: string,
- updateAttribValue: string
- ) => {
- const existingTag = document.querySelector(
- `${tag}[${queryAttribName}="${queryAttribValue}"]`
- );
- if (existingTag) {
- existingTag.setAttribute(updateAttribName, updateAttribValue);
- } else {
- const metaTag = document.createElement(tag);
- metaTag.setAttribute(queryAttribName, queryAttribValue);
- metaTag.setAttribute(updateAttribName, updateAttribValue);
- document.head.appendChild(metaTag);
- }
- };
-
- const robotsIndexValue = tags.robots.index ? "index" : "noindex";
- const robotsFollowValue = tags.robots.follow ? "follow" : "nofollow";
- const robotsValue = `${robotsIndexValue}, ${robotsFollowValue}`;
-
- document.title = `STEMMechanics | ${tags.title}`;
- updateTag("meta", "name", "description", "content", tags.description);
- updateTag("meta", "name", "keywords", "content", tags.keywords.join(", "));
- updateTag("meta", "name", "robots", "content", robotsValue);
- updateTag("link", "rel", "canonical", "href", tags.url);
- updateTag("meta", "property", "og:title", "content", tags.title);
- updateTag(
- "meta",
- "property",
- "og:description",
- "content",
- tags.description
- );
- updateTag("meta", "property", "og:image", "content", tags.image);
- updateTag("meta", "property", "og:url", "content", tags.url);
-};
diff --git a/resources/js/helpers/square.ts b/resources/js/helpers/square.ts
deleted file mode 100644
index 2897706..0000000
--- a/resources/js/helpers/square.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-const appId = "sandbox-sq0idb-FYI93DDPJk0wJvaU0ye4MQ";
-const locationId = "LQ0C6GMZEWVQ0";
-const square = null;
-
-export const initCard = (): Object => {
- const scriptSrc = "https://sandbox.web.squarecdn.com/v1/square.js";
- if (!document.querySelector(`script[src="${scriptSrc}"]`)) {
- const script = document.createElement("script");
- script.type = "text/javascript";
- script.src = scriptSrc;
- script.onload = async () => {
- if (!window.Square) {
- console.log("Square failed to load properly");
- }
-
- let payments;
- try {
- payments = window.Square.payments(appId, locationId);
- } catch (e) {
- console.log("Square: Missing credentials", e);
- return;
- }
-
- let card;
- try {
- card = await payments.card();
- await card.attach("#card-container");
- } catch (e) {
- console.error("Initializing Card failed", e);
- return;
- }
- };
-
- document.head.appendChild(script);
- }
-};
diff --git a/resources/js/helpers/string.ts b/resources/js/helpers/string.ts
deleted file mode 100644
index 282c9c4..0000000
--- a/resources/js/helpers/string.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Transforms a string to title case.
- * @param {string} str The string to transform.
- * @returns {string} A string transformed to title case.
- */
-export const toTitleCase = (str: string): string => {
- // Replace underscores and hyphens with spaces
- str = str.replace(/[_-]+/g, " ");
-
- // Capitalize the first letter of each word and make the rest lowercase
- str = str.replace(/\b\w+\b/g, (txt) => {
- return txt.charAt(0).toUpperCase() + txt.slice(1).toLowerCase();
- });
-
- // Replace "cdn" with "CDN"
- str = str.replace(/\bCdn\b/gi, "CDN");
-
- return str;
-};
-
-/**
- * Convert a string to a excerpt.
- * @param {string} txt The text to convert.
- * @param {number} maxLen (optional) The maximum length of the excerpt.
- * @param {boolean} strip (optional) Strip HTML tags from the text.
- * @param stripHtml
- * @returns {string} The excerpt.
- */
-export function excerpt(
- txt: string,
- maxLen: number = 150,
- stripHtml: boolean = true,
-): string {
- if (stripHtml) {
- txt = txt.replace(/<[^>]+>/g, "").replace(/ /g, " ");
- }
-
- const words = txt.trim().split(/\s+/);
- let curLen = 0;
- const excerptWords: string[] = [];
-
- for (const word of words) {
- if (curLen + word.length + 1 > maxLen) {
- break;
- }
- curLen += word.length + 1;
- excerptWords.push(word);
- }
-
- let excerpt = excerptWords.join(" ");
- if (curLen < txt.length) {
- excerpt += "...";
- }
-
- return excerpt;
-}
-
-/**
- * String HTML tags from text.
- * @param {string} txt The text to strip tags.
- * @returns {string} The stripped text.
- */
-export const stripHtmlTags = (txt: string): string => {
- return txt.replace(/<(p|br)([ /]*?>|[ /]+.*?>)|<[a-zA-Z/][^>]+(>|$)/g, " ");
-};
-
-/**
- * Replace HTML entities with real characters.
- * @param {string} txt The text to transform.
- * @returns {string} Transformed text
- */
-export const replaceHtmlEntities = (txt: string): string => {
- const translate_re = /&(nbsp|amp|quot|lt|gt);/g;
-
- return txt.replace(translate_re, function (match, entity) {
- switch (entity) {
- case "nbsp":
- return " ";
- case "amp":
- return "&";
- case "quot":
- return '"';
- case "lt":
- return "<";
- case "gt":
- return ">";
- default:
- return match;
- }
- });
-};
-
-/**
- * Convert a string to a number, ignoring items like dollar signs, etc.
- * @param {string} str The string to convert to a number
- * @returns {number} A number with the minimum amount of decimal places (or 0)
- */
-export const stringToNumber = (str: string): number => {
- str = str.replace(/[^\d.-]/g, "");
- const num = parseFloat(str);
- return isNaN(num) ? 0 : Number(num.toFixed(2));
-};
-
-/**
- * Convert a number or string to a price (0 or 0.00).
- * @param {number|string} numOrString The number of string to convert to a price.
- * @returns {string} The converted result.
- */
-export const toPrice = (numOrString: number | string): string => {
- const num =
- typeof numOrString === "string"
- ? stringToNumber(numOrString)
- : numOrString;
- return num.toFixed(num % 1 === 0 ? 0 : 2);
-};
-
-/**
- * Compare 2 strings case insensitive
- * @param {string} string1 The first string for comparison.
- * @param {string} string2 The second string for comparison.
- * @returns {boolean} If the strings match.
- */
-export const strCaseCmp = (string1: string, string2: string): boolean => {
- if (string1 !== undefined && string2 !== undefined) {
- return string1.toLowerCase() === string2.toLowerCase();
- }
-
- return false;
-};
diff --git a/resources/js/helpers/transition.ts b/resources/js/helpers/transition.ts
deleted file mode 100644
index 7230a89..0000000
--- a/resources/js/helpers/transition.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-import { Ref } from "vue";
-
-/**
- * Return the browser transiton end name.
- *
- * @returns {string} The browser transition end name.
- */
-const transitionEndEventName = (): string => {
- const el = document.createElement("div"),
- transitions: Record = {
- transition: "transitionend",
- OTransition: "otransitionend",
- MozTransition: "transitionend",
- WebkitTransition: "webkitTransitionEnd",
- };
-
- for (const i in transitions) {
- if (
- Object.prototype.hasOwnProperty.call(transitions, i) &&
- el.style[i] !== undefined
- ) {
- return transitions[i];
- }
- }
-
- return "";
-};
-
-/**
- * Wait for the element to render as Promise
- *
- * @param elem The
- * @returns
- */
-const waitForElementRender = (elem: Ref): Promise => {
- return new Promise((resolve) => {
- if (document.contains(elem.value)) {
- return resolve(elem.value as HTMLElement);
- }
-
- /* eslint-disable @typescript-eslint/no-explicit-any */
- const MutationObserver =
- window.MutationObserver ||
- (window as any).WebKitMutationObserver ||
- (window as any).MozMutationObserver;
- /* eslint-enable @typescript-eslint/no-explicit-any */
- const observer = new MutationObserver(() => {
- if (document.contains(elem.value)) {
- resolve(elem.value);
- observer.disconnect();
- }
- });
-
- observer.observe(document.body, {
- childList: true,
- subtree: true,
- });
- });
-};
-
-/**
- * Run the enter transition on a element.
- *
- * @param {Ref} elem The element to run the enter transition.
- * @param {string} transition The transition name.
- * @returns {void}
- */
-export const transitionEnter = (elem: Ref, transition: string): void => {
- waitForElementRender(elem)
- .then((e: HTMLElement) => {
- window.setTimeout(() => {
- e.classList.replace(
- transition + "-enter-from",
- transition + "-enter-active"
- );
- const transitionName = transitionEndEventName();
- e.addEventListener(
- transitionName,
- () => {
- e.classList.replace(
- transition + "-enter-active",
- transition + "-enter-to"
- );
- },
- false
- );
- }, 1);
- })
- .catch(() => {
- /* empty */
- });
-};
-
-/**
- * Run the exit transition on a element then call a callback.
- *
- * @param {Ref} elem The element to run the enter transition.
- * @param {string} transition The transition name.
- * @param {TransitionLeaveCallback|null} callback The callback to run after the transition finishes.
- * @returns {void}
- */
-type TransitionLeaveCallback = () => void;
-
-export const transitionLeave = (
- elem: Ref,
- transition: string,
- callback: TransitionLeaveCallback | null = null
-): void => {
- elem.value.classList.remove(transition + "-enter-to");
- elem.value.classList.add(transition + "-leave-from");
- window.setTimeout(() => {
- elem.value.classList.replace(
- transition + "-leave-from",
- transition + "-leave-active"
- );
- const transitionName = transitionEndEventName();
- elem.value.addEventListener(
- transitionName,
- () => {
- elem.value.classList.replace(
- transition + "-leave-active",
- transition + "-leave-to"
- );
- if (callback) {
- callback();
- }
- },
- false
- );
- }, 1);
-};
diff --git a/resources/js/helpers/types.ts b/resources/js/helpers/types.ts
deleted file mode 100644
index 940aa0e..0000000
--- a/resources/js/helpers/types.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Test if target is a boolean
- * @param {unknown} target The varible to test
- * @returns {boolean} If the varible is a boolean type
- */
-export function isBool(target: unknown): boolean {
- return typeof target === "boolean";
-}
-
-/**
- * Test if target is a number
- * @param {unknown} target The varible to test
- * @returns {boolean} If the varible is a number type
- */
-export function isNumber(target: unknown): boolean {
- return typeof target === "number";
-}
-
-/**
- * Test if target is an object
- * @param {unknown} target The varible to test
- * @returns {boolean} If the varible is a object type
- */
-export function isObject(target: unknown): boolean {
- return typeof target === "object" && target !== null;
-}
-
-/**
- * Test if target is a string
- * @param {unknown} target The varible to test
- * @returns {boolean} If the varible is a string type
- */
-export function isString(target: unknown): boolean {
- return typeof target === "string" && target !== null;
-}
-
-/**
- * Convert bytes to a human readable string.
- * @param {number} bytes The bytes to convert.
- * @param {number} decimalPlaces The number of places to force.
- * @returns {string} The bytes in human readable string.
- */
-export const bytesReadable = (
- bytes: number,
- decimalPlaces: number = undefined,
-): string => {
- if (Number.isNaN(bytes)) {
- return "0 Bytes";
- }
-
- if (Math.abs(bytes) < 1024) {
- return bytes + " Bytes";
- }
-
- const units = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
- let u = -1;
- const r = 10 ** 1;
- let tempBytes = bytes;
-
- while (
- Math.round(Math.abs(tempBytes) * r) / r >= 1024 &&
- u < units.length - 1
- ) {
- tempBytes /= 1024;
- ++u;
- }
-
- if (decimalPlaces === undefined) {
- return tempBytes.toFixed(2).replace(/\.?0+$/, "") + " " + units[u];
- }
-
- return tempBytes.toFixed(decimalPlaces) + " " + units[u];
-};
diff --git a/resources/js/helpers/url.ts b/resources/js/helpers/url.ts
deleted file mode 100644
index 2941407..0000000
--- a/resources/js/helpers/url.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-import { RouteLocationNormalizedLoaded, Router } from "vue-router";
-
-export const urlStripAttributes = (url: string): string => {
- const urlObject = new URL(url);
- urlObject.search = "";
- urlObject.hash = "";
- return urlObject.toString();
-};
-
-export const urlMatches = (
- fullUrl: string,
- testPath: string | string[],
-): boolean | number => {
- // Remove query string and fragment identifier from both URLs
- const urlWithoutParams = fullUrl.split(/[?#]/)[0];
-
- if (Array.isArray(testPath)) {
- // Iterate over the array of test paths and return the index of the first matching path
- for (let i = 0; i < testPath.length; i++) {
- const pathWithoutParams = testPath[i].split(/[?#]/)[0];
- // Remove trailing slashes from both URLs
- const trimmedUrl = urlWithoutParams.replace(/\/$/, "");
- const trimmedPath = pathWithoutParams.replace(/\/$/, "");
- // Check if both URLs contain a domain and port
- const hasDomainAndPort =
- /^https?:\/\/[^/]+\//.test(trimmedUrl) &&
- /^https?:\/\/[^/]+\//.test(trimmedPath);
-
- if (hasDomainAndPort) {
- // Do a full test with both URLs
- if (trimmedUrl === trimmedPath) {
- return i;
- }
- } else {
- // Remove the domain and test the paths
- const urlWithoutDomain = trimmedUrl.replace(
- /^https?:\/\/[^/]+/,
- "",
- );
- const pathWithoutDomain = trimmedPath.replace(
- /^https?:\/\/[^/]+/,
- "",
- );
- if (urlWithoutDomain === pathWithoutDomain) {
- return i;
- }
- }
- }
- // If no matching path is found, return false
- return false;
- } else {
- const pathWithoutParams = testPath.split(/[?#]/)[0];
- // Remove trailing slashes from both URLs
- const trimmedUrl = urlWithoutParams.replace(/\/$/, "");
- const trimmedPath = pathWithoutParams.replace(/\/$/, "");
- // Check if both URLs contain a domain and port
- const hasDomainAndPort =
- /^https?:\/\/[^/]+\//.test(trimmedUrl) &&
- /^https?:\/\/[^/]+\//.test(trimmedPath);
-
- if (hasDomainAndPort) {
- // Do a full test with both URLs
- return trimmedUrl === trimmedPath;
- } else {
- // Remove the domain and test the paths
- const urlWithoutDomain = trimmedUrl.replace(
- /^https?:\/\/[^/]+/,
- "",
- );
- const pathWithoutDomain = trimmedPath.replace(
- /^https?:\/\/[^/]+/,
- "",
- );
- return urlWithoutDomain === pathWithoutDomain;
- }
- }
-};
-
-interface Params {
- [key: string]: string;
-}
-
-export const updateRouterParams = (router: Router, params: Params): void => {
- const query = { ...router.currentRoute.value.query };
-
- Object.entries(params).forEach(([key, value]) => {
- if (value === "") {
- if (key in params) {
- delete query[key];
- }
- } else {
- query[key] = value;
- }
- });
-
- router.push({ query });
-};
-
-export const getRouterParam = (
- route: RouteLocationNormalizedLoaded,
- param: string,
- defaultValue: string = "",
-): string => {
- if (route.query[param] !== undefined) {
- const val = route.query[param];
-
- if (Array.isArray(val) == true) {
- if (val.length > 0) {
- return val[0];
- }
-
- return defaultValue;
- }
-
- return val.toString();
- }
-
- return defaultValue;
-};
-
-export const extractFileNameFromUrl = (url: string): string => {
- const matches = url.match(/\/([^/]+\.[^/]+)$/);
- if (!matches) {
- return "";
- }
- const fileName = matches[1];
- return fileName;
-};
-
-export const addQueryParam = (
- url: string,
- name: string,
- value: string,
-): string => {
- const urlObject = new URL(url);
- const queryParams = new URLSearchParams(urlObject.search);
-
- if (queryParams.has(name)) {
- queryParams.set(name, value);
- } else {
- // Add the new query parameter
- queryParams.append(name, value);
- }
-
- urlObject.search = queryParams.toString();
- return urlObject.toString();
-};
diff --git a/resources/js/helpers/utils.ts b/resources/js/helpers/utils.ts
deleted file mode 100644
index b2e7bd6..0000000
--- a/resources/js/helpers/utils.ts
+++ /dev/null
@@ -1,164 +0,0 @@
-import { useUserStore } from "../store/UserStore";
-import { extractFileNameFromUrl } from "./url";
-
-/**
- * Tests if an object or string is empty.
- * @param {unknown} value The object or string.
- * @returns {boolean} If the object or string is empty.
- */
-export const isEmpty = (value: unknown): boolean => {
- if (typeof value === "string") {
- return value.trim().length === 0;
- } else if (
- value instanceof File ||
- value instanceof Blob ||
- value instanceof Map ||
- value instanceof Set
- ) {
- return value.size === 0;
- } else if (value instanceof FormData) {
- return [...value.entries()].length === 0;
- } else if (typeof value === "object") {
- return !value || Object.keys(value).length === 0;
- }
-
- return false;
-};
-
-/**
- * Returns the file extension
- * @param {string} fileName The filename with extension.
- * @returns {string} The file extension.
- */
-export const getFileExtension = (fileName: string): string => {
- if (fileName.includes(".")) {
- return fileName.split(".").pop();
- }
-
- return "";
-};
-
-/**
- * Returns a url to a file type icon based on file name.
- * @param {string} fileName The filename with extension.
- * @returns {string} The url to the file type icon.
- */
-export const getFileIconImagePath = (fileName: string): string => {
- const ext = getFileExtension(fileName);
- if (ext.length > 0) {
- return `/assets/fileicons/${ext}.webp`;
- }
-
- return "/assets/fileicons/unknown.webp";
-};
-
-/**
- * Returns a url to a file preview icon based on file url.
- * @param {string} url The url of the file.
- * @returns {string} The url to the file preview icon.
- */
-export const getFilePreview = (url: string): string => {
- const ext = getFileExtension(extractFileNameFromUrl(url));
- if (ext.length > 0) {
- if (/(gif|jpe?g|png)/i.test(ext)) {
- return `${url}?size=thumb`;
- }
-
- return `/assets/fileicons/${ext}.webp`;
- }
-
- return "/assets/fileicons/unknown.webp";
-};
-
-/**
- * Clamps a number between 2 numbers.
- * @param {number} n The number to clamp.
- * @param {number} min The minimum allowable number.
- * @param {number} max The maximum allowable number.
- * @returns {number} The clamped number.
- */
-export const clamp = (n: number, min: number, max: number): number => {
- if (n < min) return min;
- if (n > max) return max;
- return n;
-};
-
-type RandomIDVerifyCallback = (id: string) => boolean;
-
-/**
- * Generate a random ID.
- * @param {string} prefix Any prefix to add to the ID.
- * @param {number} length The length of the ID string (default = 6).
- * @param {RandomIDVerifyCallback|null} callback Callback that if returns true generates a ID string.
- * @returns {string} A random string.
- */
-export const generateRandomId = (
- prefix: string = "",
- length: number = 6,
- callback: RandomIDVerifyCallback | null = null,
-): string => {
- let randomId = "";
- const letters =
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
-
- do {
- randomId = prefix;
- for (let i = 0; i < length; i++) {
- randomId += letters.charAt(
- Math.floor(Math.random() * letters.length),
- );
- }
- } while (callback != null ? callback(randomId) : false);
-
- return randomId;
-};
-
-/**
- * Generate a random element ID.
- * @param {string} prefix Any prefix to add to the ID.
- * @param {number} length The length of the ID string (default = 6).
- * @returns {string} A random string non-existent in the document.
- */
-export const generateRandomElementId = (
- prefix: string = "",
- length: number = 6,
-): string => {
- return generateRandomId(prefix, length, (s) => {
- return document.getElementById(s) != null;
- });
-};
-
-/**
- * Return if the current user has a permission.
- * @param {string} permission The permission to check.
- * @returns {boolean} If the user has the permission.
- */
-export const userHasPermission = (permission: string): boolean => {
- const userStore = useUserStore();
- return userStore.permissions && userStore.permissions.includes(permission);
-};
-
-/**
- * Convert File Name to Title
- * @param {string} fileName The filename with extension.
- * @returns {string} The title.
- */
-export const convertFileNameToTitle = (fileName: string): string => {
- // Remove file extension
- fileName = fileName.replace(/\.[^/.]+$/, "");
-
- // Replace underscores with space
- fileName = fileName.replace(/_/g, " ");
-
- // Replace dashes that are not surrounded by spaces with space
- fileName = fileName.replace(/(? {
- return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(
- uuid
- );
-};
-
-/**
- * Generates a random UUID.
- *
- * @returns {string} A random UUID.
- */
-export const randomUUID = (): string => {
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
- const r = (Math.random() * 16) | 0;
- const v = c === "x" ? r : (r & 0x3) | 0x8;
- return v.toString(16);
- });
-};
diff --git a/resources/js/helpers/validate.ts b/resources/js/helpers/validate.ts
deleted file mode 100644
index 5904830..0000000
--- a/resources/js/helpers/validate.ts
+++ /dev/null
@@ -1,978 +0,0 @@
-import { bytesReadable } from "../helpers/types";
-import { SMDate } from "./datetime";
-import { isEmpty } from "../helpers/utils";
-
-export interface ValidationObject {
- validate: (value: unknown) => Promise;
-}
-
-export interface ValidationResult {
- valid: boolean;
- invalidMessages: Array;
-}
-
-export const defaultValidationResult: ValidationResult = {
- valid: true,
- invalidMessages: [],
-};
-
-export const createValidationResult = (
- valid: boolean,
- message: string | Array = ""
-) => {
- if (typeof message == "string") {
- message = [message];
- }
-
- return {
- valid: valid,
- invalidMessages: message,
- };
-};
-
-/**
- * Validation Min
- */
-const VALIDATION_MIN_TYPE = ["String", "Number"];
-type ValidationMinType = (typeof VALIDATION_MIN_TYPE)[number];
-
-interface ValidationMinOptions {
- min: number;
- type?: ValidationMinType;
- invalidMessage?: string | ((options: ValidationMinOptions) => string);
-}
-
-interface ValidationMinObject extends ValidationMinOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationMinOptions: ValidationMinOptions = {
- min: 1,
- type: "String",
- invalidMessage: (options: ValidationMinOptions) => {
- return options.type == "String"
- ? `Required to be at least ${options.min} characters.`
- : `Required to be at least ${options.min}.`;
- },
-};
-
-export function Min(
- minOrOptions: number | ValidationMinOptions,
- options?: ValidationMinOptions
-);
-export function Min(options: ValidationMinOptions): ValidationMinObject;
-
-/**
- * Validate field length or number is at minimum or higher/larger
- *
- * @param minOrOptions minimum number or options data
- * @param options options data
- * @returns ValidationMinObject
- */
-export function Min(
- minOrOptions: number | ValidationMinOptions,
- options?: ValidationMinOptions
-): ValidationMinObject {
- if (typeof minOrOptions === "number") {
- options = { ...defaultValidationMinOptions, ...(options || {}) };
- options.min = minOrOptions;
- } else {
- options = { ...defaultValidationMinOptions, ...(minOrOptions || {}) };
- }
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid:
- this.type == "String"
- ? value.toString().length >= this.min
- : parseInt(value) >= this.min,
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * Validation Max
- */
-const VALIDATION_MAX_TYPE = ["String", "Number"];
-type ValidationMaxType = (typeof VALIDATION_MAX_TYPE)[number];
-
-interface ValidationMaxOptions {
- max: number;
- type?: ValidationMaxType;
- invalidMessage?: string | ((options: ValidationMaxOptions) => string);
-}
-
-interface ValidationMaxObject extends ValidationMaxOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationMaxOptions: ValidationMaxOptions = {
- max: 1,
- type: "String",
- invalidMessage: (options: ValidationMaxOptions) => {
- return options.type == "String"
- ? `Required to be less than ${options.max + 1} characters.`
- : `Required to be less than ${options.max + 1}.`;
- },
-};
-
-export function Max(
- maxOrOptions: number | ValidationMaxOptions,
- options?: ValidationMaxOptions
-): ValidationMaxObject;
-export function Max(options: ValidationMaxOptions): ValidationMaxObject;
-
-/**
- * Validate field length or number is at maximum or smaller
- *
- * @param maxOrOptions maximum number or options data
- * @param options options data
- * @returns ValidationMaxObject
- */
-export function Max(
- maxOrOptions: number | ValidationMaxOptions,
- options?: ValidationMaxOptions
-): ValidationMaxObject {
- if (typeof maxOrOptions === "number") {
- options = { ...defaultValidationMaxOptions, ...(options || {}) };
- options.max = maxOrOptions;
- } else {
- options = { ...defaultValidationMaxOptions, ...(maxOrOptions || {}) };
- }
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid:
- this.type == "String"
- ? value.toString().length <= this.max
- : parseInt(value) <= this.max,
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * Validation Length
- */
-interface ValidationLengthOptions {
- length: number;
- invalidMessage?: string | ((options: ValidationLengthOptions) => string);
-}
-
-interface ValidationLengthObject extends ValidationLengthOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationLengthOptions: ValidationLengthOptions = {
- length: 1,
- invalidMessage: (options: ValidationLengthOptions) => {
- return `Required to be ${options.length} characters.`;
- },
-};
-
-export function Length(
- lengthOrOptions: number | ValidationLengthOptions,
- options?: ValidationLengthOptions
-): ValidationLengthObject;
-export function Length(
- options: ValidationLengthOptions
-): ValidationLengthObject;
-
-/**
- * Validate field length
- *
- * @param lengthOrOptions string length or options data
- * @param options options data
- * @returns ValidationLengthObject
- */
-export function Length(
- lengthOrOptions: number | ValidationLengthOptions,
- options?: ValidationLengthOptions
-): ValidationLengthObject {
- if (typeof lengthOrOptions === "number") {
- options = { ...defaultValidationLengthOptions, ...(options || {}) };
- options.length = lengthOrOptions;
- } else {
- options = {
- ...defaultValidationLengthOptions,
- ...(lengthOrOptions || {}),
- };
- }
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid: value.toString().length == this.length,
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * PASSWORD
- */
-interface ValidationPasswordOptions {
- invalidMessage?: string | ((options: ValidationPasswordOptions) => string);
-}
-
-interface ValidationPasswordObject extends ValidationPasswordOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationPasswordOptions: ValidationPasswordOptions = {
- invalidMessage:
- "Your password needs to have at least a letter, a number and a special character.",
-};
-
-/**
- * Validate field is in a valid password format
- *
- * @param options options data
- * @returns ValidationPasswordObject
- */
-export function Password(
- options?: ValidationPasswordOptions
-): ValidationPasswordObject {
- options = { ...defaultValidationPasswordOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid: /(?=.*[A-Za-z])(?=.*\d)(?=.*[.@$!%*#?&])[A-Za-z\d.@$!%*#?&]{1,}$/.test(
- value
- ),
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * EMAIL
- */
-interface ValidationEmailOptions {
- invalidMessage?: string | ((options: ValidationEmailOptions) => string);
-}
-
-interface ValidationEmailObject extends ValidationEmailOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationEmailOptions: ValidationEmailOptions = {
- invalidMessage: "Your email is not in a supported format.",
-};
-
-/**
- * Validate field is in a valid Email format
- *
- * @param options options data
- * @returns ValidationEmailObject
- */
-export function Email(options?: ValidationEmailOptions): ValidationEmailObject {
- options = { ...defaultValidationEmailOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid:
- value.length == 0 ||
- /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(value),
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * PHONE
- */
-interface ValidationPhoneOptions {
- invalidMessage?: string | ((options: ValidationPhoneOptions) => string);
-}
-
-interface ValidationPhoneObject extends ValidationPhoneOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationPhoneOptions: ValidationPhoneOptions = {
- invalidMessage: "Your Phone number is not in a supported format.",
-};
-
-/**
- * Validate field is in a valid Phone format
- *
- * @param options options data
- * @returns ValidationPhoneObject
- */
-export function Phone(options?: ValidationPhoneOptions): ValidationPhoneObject {
- options = { ...defaultValidationPhoneOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid:
- value.length == 0 ||
- /^(\+|00)?[0-9][0-9 \-().]{7,32}$/.test(value),
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * NUMBER
- */
-interface ValidationNumberOptions {
- invalidMessage?: string | ((options: ValidationNumberOptions) => string);
-}
-
-interface ValidationNumberObject extends ValidationNumberOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationNumberOptions: ValidationNumberOptions = {
- invalidMessage: "Must be a number.",
-};
-
-/**
- * Validate field is in a valid Whole number format
- *
- * @param options options data
- * @returns ValidationNumberObject
- */
-export function Number(
- options?: ValidationNumberOptions
-): ValidationNumberObject {
- options = { ...defaultValidationNumberOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid: value.length == 0 || /^0?\d+$/.test(value),
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * DATE
- */
-interface ValidationDateOptions {
- before?: string | ((value: string) => string);
- after?: string | ((value: string) => string);
- invalidMessage?: string | ((options: ValidationDateOptions) => string);
- invalidBeforeMessage?:
- | string
- | ((options: ValidationDateOptions) => string);
- invalidAfterMessage?: string | ((options: ValidationDateOptions) => string);
-}
-
-interface ValidationDateObject extends ValidationDateOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationDateOptions: ValidationDateOptions = {
- before: "",
- after: "",
- invalidMessage: "Must be a valid date.",
- invalidBeforeMessage: (options: ValidationDateOptions) => {
- return `Must be a date before ${options.before}.`;
- },
- invalidAfterMessage: (options: ValidationDateOptions) => {
- return `Must be a date after ${options.after}.`;
- },
-};
-
-/**
- * Validate field is in a valid Date format
- *
- * @param options options data
- * @returns ValidationDateObject
- */
-export function Date(options?: ValidationDateOptions): ValidationDateObject {
- options = { ...defaultValidationDateOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- let valid = true;
- let invalidMessageType = "invalidMessage";
-
- const parsedDate = new SMDate(value);
-
- if (parsedDate.isValid() == true) {
- const beforeDate = new SMDate(
- typeof (options["before"] = options?.before || "") ===
- "function"
- ? options.before(value)
- : options.before
- );
- const afterDate = new SMDate(
- typeof (options["after"] = options?.after || "") ===
- "function"
- ? options.after(value)
- : options.after
- );
- if (
- beforeDate.isValid() == true &&
- parsedDate.isBefore(beforeDate) == false
- ) {
- valid = false;
- invalidMessageType = "invalidBeforeMessage";
- }
- if (
- afterDate.isValid() == true &&
- parsedDate.isAfter(afterDate) == false
- ) {
- valid = false;
- invalidMessageType = "invalidAfterMessage";
- }
- } else {
- valid = false;
- }
-
- return Promise.resolve({
- valid: valid,
- invalidMessages: [
- typeof this[invalidMessageType] === "string"
- ? this[invalidMessageType]
- : this[invalidMessageType](this),
- ],
- });
- },
- };
-}
-
-/**
- * TIME
- */
-interface ValidationTimeOptions {
- before?: string | ((value: string) => string);
- after?: string | ((value: string) => string);
- invalidMessage?: string | ((options: ValidationTimeOptions) => string);
- invalidBeforeMessage?:
- | string
- | ((options: ValidationTimeOptions) => string);
- invalidAfterMessage?: string | ((options: ValidationTimeOptions) => string);
-}
-
-interface ValidationTimeObject extends ValidationTimeOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationTimeOptions: ValidationTimeOptions = {
- before: "",
- after: "",
- invalidMessage: "Must be a valid time.",
- invalidBeforeMessage: (options: ValidationTimeOptions) => {
- return `Must be a time before ${options.before}.`;
- },
- invalidAfterMessage: (options: ValidationTimeOptions) => {
- return `Must be a time after ${options.after}.`;
- },
-};
-
-/**
- * Validate field is in a valid Time format
- *
- * @param options options data
- * @returns ValidationTimeObject
- */
-export function Time(options?: ValidationTimeOptions): ValidationTimeObject {
- options = { ...defaultValidationTimeOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- let valid = true;
- let invalidMessageType = "invalidMessage";
-
- const parsedTime = new SMDate(value);
- if (parsedTime.isValid() == true) {
- const beforeTime = new SMDate(
- typeof (options["before"] = options?.before || "") ===
- "function"
- ? options.before(value)
- : options.before
- );
- const afterTime = new SMDate(
- typeof (options["after"] = options?.after || "") ===
- "function"
- ? options.after(value)
- : options.after
- );
-
- if (
- beforeTime.isValid() == true &&
- parsedTime.isBefore(beforeTime) == false
- ) {
- valid = false;
- invalidMessageType = "invalidBeforeMessage";
- }
- if (
- afterTime.isValid() == true &&
- parsedTime.isAfter(afterTime) == false
- ) {
- valid = false;
- invalidMessageType = "invalidAfterMessage";
- }
- } else {
- valid = false;
- }
-
- return Promise.resolve({
- valid: valid,
- invalidMessages: [
- typeof this[invalidMessageType] === "string"
- ? this[invalidMessageType]
- : this[invalidMessageType](this),
- ],
- });
- },
- };
-}
-
-/**
- * DATETIME
- */
-interface ValidationDateTimeOptions {
- before?: string | ((value: string) => string);
- after?: string | ((value: string) => string);
- invalidMessage?: string | ((options: ValidationDateTimeOptions) => string);
- invalidBeforeMessage?:
- | string
- | ((options: ValidationDateTimeOptions) => string);
- invalidAfterMessage?:
- | string
- | ((options: ValidationDateTimeOptions) => string);
-}
-
-interface ValidationDateTimeObject extends ValidationDateTimeOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationDateTimeOptions: ValidationDateTimeOptions = {
- before: "",
- after: "",
- invalidMessage: "Must be a valid date and time.",
- invalidBeforeMessage: (options: ValidationDateTimeOptions) => {
- return `Must be a date/time before ${options.before}.`;
- },
- invalidAfterMessage: (options: ValidationDateTimeOptions) => {
- return `Must be a date/time after ${options.after}.`;
- },
-};
-
-/**
- * Validate field is in a valid Date format
- *
- * @param options options data
- * @returns ValidationDateObject
- */
-export function DateTime(
- options?: ValidationDateTimeOptions
-): ValidationDateTimeObject {
- options = { ...defaultValidationDateTimeOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- let valid = true;
- let invalidMessageType = "invalidMessage";
-
- const parsedDate = new SMDate(value);
-
- if (parsedDate.isValid() == true) {
- const beforeDate = new SMDate(
- typeof (options["before"] = options?.before || "") ===
- "function"
- ? options.before(value)
- : options.before
- );
- const afterDate = new SMDate(
- typeof (options["after"] = options?.after || "") ===
- "function"
- ? options.after(value)
- : options.after
- );
- if (
- beforeDate.isValid() == true &&
- parsedDate.isBefore(beforeDate) == false
- ) {
- valid = false;
- invalidMessageType = "invalidBeforeMessage";
- }
- if (
- afterDate.isValid() == true &&
- parsedDate.isAfter(afterDate) == false
- ) {
- valid = false;
- invalidMessageType = "invalidAfterMessage";
- }
- } else {
- valid = false;
- }
-
- return Promise.resolve({
- valid: valid,
- invalidMessages: [
- typeof this[invalidMessageType] === "string"
- ? this[invalidMessageType]
- : this[invalidMessageType](this),
- ],
- });
- },
- };
-}
-
-/**
- * CUSTOM
- */
-type ValidationCustomCallback = (value: string) => Promise;
-
-interface ValidationCustomOptions {
- callback: ValidationCustomCallback;
- invalidMessage?: string | ((options: ValidationCustomOptions) => string);
-}
-
-interface ValidationCustomObject extends ValidationCustomOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationCustomOptions: ValidationCustomOptions = {
- callback: async () => {
- return true;
- },
- invalidMessage: "This field is invalid.",
-};
-
-export function Custom(
- callbackOrOptions: ValidationCustomCallback | ValidationCustomOptions,
- options?: ValidationCustomOptions
-);
-export function Custom(
- options: ValidationCustomOptions
-): ValidationCustomObject;
-
-/**
- * Validate field is in a valid Custom format
- *
- * @param callbackOrOptions
- * @param options options data
- * @returns ValidationCustomObject
- */
-export function Custom(
- callbackOrOptions: ValidationCustomCallback | ValidationCustomOptions,
- options?: ValidationCustomOptions
-): ValidationCustomObject {
- if (typeof callbackOrOptions === "function") {
- options = { ...defaultValidationCustomOptions, ...(options || {}) };
- options.callback = callbackOrOptions;
- } else {
- options = {
- ...defaultValidationCustomOptions,
- ...(callbackOrOptions || {}),
- };
- }
-
- return {
- ...options,
- validate: async function (value: string): Promise {
- const validateResult = {
- valid: true,
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- };
-
- const callbackResult =
- typeof this.callback === "function"
- ? await this.callback(value)
- : true;
-
- if (typeof callbackResult === "string") {
- if (callbackResult.length > 0) {
- validateResult.valid = false;
- validateResult.invalidMessages = [callbackResult];
- }
- } else if (callbackResult !== true) {
- validateResult.valid = false;
- }
-
- return validateResult;
- },
- };
-}
-
-/**
- * And
- *
- * @param list
- */
-export const And = (list: Array) => {
- return {
- list: list,
- validate: async function (value: string) {
- const validationResult: ValidationResult = {
- valid: true,
- invalidMessages: [],
- };
-
- await Promise.all(
- this.list.map(async (item: ValidationObject) => {
- const validationItemResult = await item.validate(value);
- if (validationItemResult.valid == false) {
- validationResult.valid = false;
- validationResult.invalidMessages =
- validationResult.invalidMessages.concat(
- validationItemResult.invalidMessages
- );
- }
- })
- );
-
- return validationResult;
- },
- };
-};
-
-/**
- * Required
- */
-interface ValidationRequiredOptions {
- invalidMessage?: string | ((options: ValidationRequiredOptions) => string);
-}
-
-interface ValidationRequiredObject extends ValidationRequiredOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationRequiredOptions: ValidationRequiredOptions = {
- invalidMessage: "This field is required.",
-};
-
-/**
- * Validate field contains value
- *
- * @param options options data
- * @returns ValidationRequiredObject
- */
-export function Required(
- options?: ValidationRequiredOptions
-): ValidationRequiredObject {
- options = { ...defaultValidationRequiredOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: unknown): Promise {
- return Promise.resolve({
- valid: !isEmpty(value),
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * Required If
- */
-type ValidationRequiredIfCheck = boolean | Array;
-
-interface ValidationRequiredIfOptions {
- check: ValidationRequiredIfCheck;
- invalidMessage?:
- | string
- | ((options: ValidationRequiredIfOptions) => string);
-}
-
-interface ValidationRequiredIfObject extends ValidationRequiredIfOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationRequiredIfOptions: ValidationRequiredIfOptions = {
- check: true,
- invalidMessage: "This field is required.",
-};
-
-/**
- * Validate field contains value
- *
- * @param checkOrOptions
- * @param options options data
- * @returns ValidationRequiredIfObject
- */
-export function RequiredIf(
- checkOrOptions: boolean | Array | ValidationRequiredIfOptions,
- options?: ValidationRequiredIfOptions
-): ValidationRequiredIfObject {
- if (
- typeof checkOrOptions === "boolean" ||
- Array.isArray(checkOrOptions) === true
- ) {
- options = { ...defaultValidationRequiredIfOptions, ...(options || {}) };
- options.check = checkOrOptions;
- } else {
- options = {
- ...defaultValidationRequiredIfOptions,
- ...(checkOrOptions || {}),
- };
- }
-
- options = { ...defaultValidationRequiredIfOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: unknown): Promise {
- return Promise.resolve({
- valid: Array.isArray(value)
- ? value.every((item) => !!item)
- : value == true,
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * Url
- */
-interface ValidationUrlOptions {
- invalidMessage?: string | ((options: ValidationUrlOptions) => string);
-}
-
-interface ValidationUrlObject extends ValidationUrlOptions {
- validate: (value: string) => Promise;
-}
-
-const defaultValidationUrlOptions: ValidationUrlOptions = {
- invalidMessage: "Not a supported Url format.",
-};
-
-/**
- * Validate field is in a valid Email format
- *
- * @param options options data
- * @returns ValidationEmailObject
- */
-export function Url(options?: ValidationUrlOptions): ValidationUrlObject {
- options = { ...defaultValidationUrlOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: string): Promise {
- return Promise.resolve({
- valid:
- value.length > 0
- ? /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*(:\d+)?([/?#][^\s]*)?$/.test(
- value
- )
- : true,
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
-
-/**
- * FileSize
- */
-interface ValidationFileSizeOptions {
- size: number;
- invalidMessage?: string | ((options: ValidationFileSizeOptions) => string);
-}
-
-interface ValidationFileSizeObject extends ValidationFileSizeOptions {
- validate: (value: File) => Promise;
-}
-
-const defaultValidationFileSizeOptions: ValidationFileSizeOptions = {
- size: 1024 * 1024 * 1024, // 1 Mb
- invalidMessage: (options) => {
- return `The file size must be less than ${bytesReadable(options.size)}`;
- },
-};
-
-/**
- * Validate file is equal or less than size.
- *
- * @param options options data
- * @returns ValidationEmailObject
- */
-export function FileSize(
- options?: ValidationFileSizeOptions
-): ValidationFileSizeObject {
- options = { ...defaultValidationFileSizeOptions, ...(options || {}) };
-
- return {
- ...options,
- validate: function (value: File): Promise {
- const isValid =
- value instanceof File ? value.size < options.size : true;
-
- return Promise.resolve({
- valid: isValid,
- invalidMessages: [
- typeof this.invalidMessage === "string"
- ? this.invalidMessage
- : this.invalidMessage(this),
- ],
- });
- },
- };
-}
diff --git a/resources/js/lib/prism.js b/resources/js/lib/prism.js
deleted file mode 100644
index 1608998..0000000
--- a/resources/js/lib/prism.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* PrismJS 1.29.0
-https://prismjs.com/download.html#themes=prism&languages=markup+clike+javascript+bash+c+javadoclike+js-extras+json+json5+log+markup-templating+objectivec+perl+php+phpdoc+php-extras+python+regex+sql+swift+typoscript+yaml */
-var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(jg.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a"+i.content+""+i.tag+">"},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
-Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml;
-Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};
-Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),Prism.languages.js=Prism.languages.javascript;
-!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",a={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:a,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:a}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},a.inside=e.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,i=0;i>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean;
-!function(e){function n(e,n){return"___"+e.toUpperCase()+n+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(t,a,r,o){if(t.language===a){var c=t.tokenStack=[];t.code=t.code.replace(r,(function(e){if("function"==typeof o&&!o(e))return e;for(var r,i=c.length;-1!==t.code.indexOf(r=n(a,i));)++i;return c[i]=e,r})),t.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(t,a){if(t.language===a&&t.tokenStack){t.grammar=e.languages[a];var r=0,o=Object.keys(t.tokenStack);!function c(i){for(var u=0;u=o.length);u++){var g=i[u];if("string"==typeof g||g.content&&"string"==typeof g.content){var l=o[r],s=t.tokenStack[l],f="string"==typeof g?g:g.content,p=n(a,l),k=f.indexOf(p);if(k>-1){++r;var m=f.substring(0,k),d=new e.Token(a,e.tokenize(s,t.grammar),"language-"+a,s),h=f.substring(k+p.length),v=[];m&&v.push.apply(v,c([m])),v.push(d),h&&v.push.apply(v,c([h])),"string"==typeof g?i.splice.apply(i,[u,1].concat(v)):g.content=v}}else g.content&&c(g.content)}return i}(t.tokens)}}}})}(Prism);
-!function(e){var a=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:a,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];e.languages.insertBefore("php","variable",{string:r,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:a,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(a){/<\?/.test(a.code)&&e.languages["markup-templating"].buildPlaceholders(a,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"php")}))}(Prism);
-!function(a){var e=a.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(e,"addSupport",{value:function(e,n){"string"==typeof e&&(e=[e]),e.forEach((function(e){!function(e,n){var t="doc-comment",r=a.languages[e];if(r){var o=r[t];if(o||(o=(r=a.languages.insertBefore(e,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[t]),o instanceof RegExp&&(o=r[t]={pattern:o}),Array.isArray(o))for(var i=0,s=o.length;i/g,(function(){return"(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*"})),e)}a.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+a.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),a.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+a.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),a.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),a.languages.insertBefore("javascript","keyword",{imports:{pattern:e("(\\bimport\\b\\s*)(?:(?:\\s*,\\s*(?:\\*\\s*as\\s+|\\{[^{}]*\\}))?|\\*\\s*as\\s+|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)"),lookbehind:!0,inside:a.languages.javascript},exports:{pattern:e("(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})"),lookbehind:!0,inside:a.languages.javascript}}),a.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),a.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),a.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e("(\\.\\s*)#?"),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var t=["function","function-variable","method","method-variable","property-access"],r=0;r.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/};
-Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec;
-!function(e){var n="(?:\\((?:[^()\\\\]|\\\\[^])*\\)|\\{(?:[^{}\\\\]|\\\\[^])*\\}|\\[(?:[^[\\]\\\\]|\\\\[^])*\\]|<(?:[^<>\\\\]|\\\\[^])*>)";e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp("\\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\\s*(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1","([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[^])*\\2",n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp("\\b(?:m|qr)(?![a-zA-Z0-9])\\s*(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1","([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[^])*\\2",n].join("|")+")[msixpodualngc]*"),greedy:!0},{pattern:RegExp("(^|[^-])\\b(?:s|tr|y)(?![a-zA-Z0-9])\\s*(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\2)[^\\\\]|\\\\[^])*\\2(?:(?!\\2)[^\\\\]|\\\\[^])*\\2","([a-zA-Z0-9])(?:(?!\\3)[^\\\\]|\\\\[^])*\\3(?:(?!\\3)[^\\\\]|\\\\[^])*\\3",n+"\\s*"+n].join("|")+")[msixpodualngcer]*"),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}(Prism);
-!function(a){var e="(?:\\b[a-zA-Z]\\w*|[|\\\\[\\]])+";a.languages.phpdoc=a.languages.extend("javadoclike",{parameter:{pattern:RegExp("(@(?:global|param|property(?:-read|-write)?|var)\\s+(?:"+e+"\\s+)?)\\$\\w+"),lookbehind:!0}}),a.languages.insertBefore("phpdoc","keyword",{"class-name":[{pattern:RegExp("(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)"+e),lookbehind:!0,inside:{keyword:/\b(?:array|bool|boolean|callback|double|false|float|int|integer|mixed|null|object|resource|self|string|true|void)\b/,punctuation:/[|\\[\]()]/}}]}),a.languages.javadoclike.addSupport("php",a.languages.phpdoc)}(Prism);
-Prism.languages.insertBefore("php","variable",{this:{pattern:/\$this\b/,alias:"keyword"},global:/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/\b(?:parent|self|static)\b/,punctuation:/::|\\/}}});
-Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python;
-!function(a){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,t="(?:[^\\\\-]|"+n.source+")",s=RegExp(t+"-"+t),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(Prism);
-Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};
-Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp('(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\r\n|[^(])|[^\\\\\r\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])'),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp('(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\r\n|[^#])|[^\\\\\r\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2'),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp("#(?:(?:elseif|if)\\b(?:[ \t]*(?:![ \t]*)?(?:\\b\\w+\\b(?:[ \t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}));
-!function(E){var n=/\b(?:ACT|ACTIFSUB|CARRAY|CASE|CLEARGIF|COA|COA_INT|CONSTANTS|CONTENT|CUR|EDITPANEL|EFFECT|EXT|FILE|FLUIDTEMPLATE|FORM|FRAME|FRAMESET|GIFBUILDER|GMENU|GMENU_FOLDOUT|GMENU_LAYERS|GP|HMENU|HRULER|HTML|IENV|IFSUB|IMAGE|IMGMENU|IMGMENUITEM|IMGTEXT|IMG_RESOURCE|INCLUDE_TYPOSCRIPT|JSMENU|JSMENUITEM|LLL|LOAD_REGISTER|NO|PAGE|RECORDS|RESTORE_REGISTER|TEMPLATE|TEXT|TMENU|TMENUITEM|TMENU_LAYERS|USER|USER_INT|_GIFBUILDER|global|globalString|globalVar)\b/;E.languages.typoscript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:= \t]|(?:^|[^= \t])[ \t]+)\/\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^"'])#.*/,lookbehind:!0,greedy:!0}],function:[{pattern://,inside:{string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,inside:{keyword:n}},keyword:{pattern:/INCLUDE_TYPOSCRIPT/}}},{pattern:/@import\s*(?:"[^"\r\n]*"|'[^'\r\n]*')/,inside:{string:/"[^"\r\n]*"|'[^'\r\n]*'/}}],string:{pattern:/^([^=]*=[< ]?)(?:(?!\]\n).)*/,lookbehind:!0,inside:{function:/\{\$.*\}/,keyword:n,number:/^\d+$/,punctuation:/[,|:]/}},keyword:n,number:{pattern:/\b\d+\s*[.{=]/,inside:{operator:/[.{=]/}},tag:{pattern:/\.?[-\w\\]+\.?/,inside:{punctuation:/\./}},punctuation:/[{}[\];(),.:|]/,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/},E.languages.tsconfig=E.languages.typoscript}(Prism);
-!function(e){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,t="(?:"+r.source+"(?:[ \t]+"+n.source+")?|"+n.source+"(?:[ \t]+"+r.source+")?)",a="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*".replace(//g,(function(){return"[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"})),d="\"(?:[^\"\\\\\r\n]|\\\\.)*\"|'(?:[^'\\\\\r\n]|\\\\.)*'";function o(e,n){n=(n||"").replace(/m/g,"")+"m";var r="([:\\-,[{]\\s*(?:\\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\\]|\\}|(?:[\r\n]\\s*)?#))".replace(/<>/g,(function(){return t})).replace(/<>/g,(function(){return e}));return RegExp(r,n)}e.languages.yaml={scalar:{pattern:RegExp("([\\-:]\\s*(?:\\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\\S[^\r\n]*(?:\\2[^\r\n]+)*)".replace(/<>/g,(function(){return t}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp("((?:^|[:\\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\\s*:\\s)".replace(/<>/g,(function(){return t})).replace(/<>/g,(function(){return"(?:"+a+"|"+d+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:o("false|true","i"),lookbehind:!0,alias:"important"},null:{pattern:o("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:o(d),lookbehind:!0,greedy:!0},number:{pattern:o("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism);
diff --git a/resources/js/main.js b/resources/js/main.js
deleted file mode 100644
index f8497d1..0000000
--- a/resources/js/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import Router from "@/router";
-import { createPinia } from "pinia";
-import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
-import { createApp } from "vue";
-import App from "./views/App.vue";
-import "uno.css";
-import "../css/app.scss";
-
-const pinia = createPinia();
-pinia.use(piniaPluginPersistedstate);
-
-createApp(App).use(pinia).use(Router).mount("#app");
diff --git a/resources/js/media-picker.js b/resources/js/media-picker.js
new file mode 100644
index 0000000..7bcae47
--- /dev/null
+++ b/resources/js/media-picker.js
@@ -0,0 +1,238 @@
+const SMMediaPicker = {
+ upload: (files) => {
+ const validFiles = Array.from(files).filter((file) => {
+ return SM.mimeMatches(file.type, Alpine.store('media').require_mime_type);
+ });
+
+ const titles = Array.from(validFiles).map((file) => SM.toTitleCase(file.name));
+
+ SM.upload(validFiles, (response) => {
+ SMMediaPicker.open(
+ Alpine.store('media').selected,
+ {
+ require_mime_type: Alpine.store('media').require_mime_type,
+ allow_multiple: Alpine.store('media').allow_multiple,
+ allow_uploads: Alpine.store('media').allow_uploads
+ },
+ Alpine.store('media').callback
+ );
+ }, titles);
+ },
+
+ gotoLink: (url) => {
+ if(url !== null) {
+ const page = new URL(url).searchParams.get('page');
+ SMMediaPicker.query(page, document.querySelector('input[name="search"]').value);
+ }
+ },
+
+ updateSelection: (name) => {
+ if(Alpine.store('media').selected.some(i => i === name)) {
+ Alpine.store('media').selected = Alpine.store('media').selected.filter(i => i !== name);
+ } else {
+ if(!Alpine.store('media').allow_multiple) {
+ Alpine.store('media').selected = [name];
+ } else {
+ Alpine.store('media').selected.push(name);
+ }
+ }
+ },
+
+ search: () => {
+ SMMediaPicker.query(null, document.querySelector('input[name="search"]').value);
+ },
+
+ query: (page, search) => {
+ let params = {
+ mime_type: Alpine.store('media').require_mime_type,
+ per_page: Alpine.store('media').per_page,
+ search: search,
+ 'selected[]': Alpine.store('media').selected
+ };
+
+ if(page !== null) {
+ params.page = page;
+ }
+
+ axios.get('/media', {
+ params: params
+ })
+ .then(response => {
+ response.data.links[0].label = '';
+ response.data.links[response.data.links.length - 1].label = '';
+
+ response.data.data.forEach((file) => {
+ file.extension = file.name.split('.').pop();
+ });
+
+ Alpine.store('media').current_page = response.data.current_page;
+ Alpine.store('media').per_page = response.data.per_page;
+ Alpine.store('media').to = response.data.to;
+ Alpine.store('media').total = response.data.total;
+ Alpine.store('media').items = response.data.data;
+
+ Alpine.store('media').pagination = [];
+ Alpine.nextTick(() => {
+ Alpine.store('media').pagination = response.data.links;
+ });
+ })
+ .catch(error => {
+ console.error(error);
+ });
+ },
+
+ html: `
+
+
+
+
+
Drop files to upload
+
or
+
+
+
Maximum upload size: ${SM.bytesToString(SM.maxUploadSize())}
+
+
+
+
+
+
+ -
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+ Drop files to upload
+
+
+
+ `,
+
+ onOpen: () => {
+ SMMediaPicker.query(null, '');
+ },
+
+ preClose: () => {
+ /* empty */
+ },
+
+ open: (selected, options = {}, callback = null) => {
+ if(!options.hasOwnProperty('require_mime_type')) options.require_mime_type = '*';
+ if(!options.hasOwnProperty('allow_multiple')) options.allow_multiple = false;
+ if(!options.hasOwnProperty('allow_uploads')) options.allow_uploads = false;
+
+ if(selected === null || selected === '') selected = [];
+ if(!Array.isArray(selected)) selected = [selected];
+ Alpine.store('media').selected = selected;
+
+ Alpine.store('media').require_mime_type = options.require_mime_type;
+ Alpine.store('media').allow_multiple = options.allow_multiple;
+ Alpine.store('media').allow_uploads = options.allow_uploads;
+ Alpine.store('media').callback = callback;
+
+ Swal.fire({
+ title: options.allow_uploads ? 'Select or Upload Media' : 'Select Media',
+ html: SMMediaPicker.html,
+ confirmButtonText: 'Select',
+ confirmButtonColor: '#0284C7',
+ cancelButtonText: 'Cancel',
+ showCancelButton: true,
+ focusConfirm: false,
+ reverseButtons: true,
+ didOpen: SMMediaPicker.onOpen,
+ preConfirm: SMMediaPicker.preClose,
+ customClass: {
+ container: 'sm-media-picker-container',
+ popup: 'sm-media-picker',
+ }
+ }).then((result) => {
+ if(result.isConfirmed && callback) {
+ if(Alpine.store('media').allow_multiple) {
+ callback(Alpine.store('media').selected);
+ } else {
+ if(Alpine.store('media').selected.length > 0) {
+ callback(Alpine.store('media').selected[0]);
+ } else {
+ callback('');
+ }
+ }
+ }
+ })
+ },
+};
+
+window.SMMediaPicker = SMMediaPicker;
+
+document.addEventListener('DOMContentLoaded', () => {
+ Alpine.store('media', {
+ require_mime_type: '*',
+ allow_multiple: true,
+ allow_uploads: false,
+ current_page: 1,
+ per_page: 24,
+ to: 0,
+ total: 0,
+ items: [],
+ selected: [],
+ pagination: [],
+ });
+})
+
diff --git a/resources/js/router/index.js b/resources/js/router/index.js
deleted file mode 100644
index 19a54f3..0000000
--- a/resources/js/router/index.js
+++ /dev/null
@@ -1,619 +0,0 @@
-import { useUserStore } from "@/store/UserStore";
-import { createRouter, createWebHistory } from "vue-router";
-import { api } from "../helpers/api";
-import { useApplicationStore } from "../store/ApplicationStore";
-import { updateSEOTags } from "../helpers/seo";
-
-export const routes = [
- {
- path: "/",
- name: "home",
- meta: {
- title: "Home",
- description:
- "STEMMechanics, a family-run company based in Cairns, Queensland, creates fantastic STEM-focused programs and activities that are both entertaining and educational.",
- },
- component: () => import("@/views/Home.vue"),
- },
- {
- path: "/blog",
- name: "blog",
- meta: {
- title: "Blog",
- },
- component: () => import(/* webpackPrefetch: true */ "@/views/Blog.vue"),
- },
- {
- path: "/article",
- redirect: "/blog",
- children: [
- {
- path: ":slug",
- name: "article",
- component: () => import("@/views/Article.vue"),
- },
- ],
- },
- {
- path: "/workshops",
- name: "workshops",
- meta: {
- title: "Workshops",
- },
- component: () =>
- import(/* webpackPreload: true */ "@/views/Workshops.vue"),
- },
- {
- path: "/event",
- redirect: "/workshops",
- children: [
- {
- path: ":id",
- name: "event",
- component: () => import("@/views/Event.vue"),
- },
- ],
- },
- {
- path: "/verify-email",
- name: "verify-email",
- meta: {
- title: "Verify Email",
- },
- component: () => import("@/views/EmailVerify.vue"),
- },
- {
- path: "/resend-verify-email",
- name: "resend-verify-email",
- meta: {
- title: "Resend Verification Email",
- },
- component: () => import("@/views/ResendEmailVerify.vue"),
- },
- {
- path: "/reset-password",
- name: "reset-password",
- meta: {
- title: "Reset Password",
- },
- component: () => import("@/views/ResetPassword.vue"),
- },
- {
- path: "/privacy",
- name: "privacy",
- meta: {
- title: "Privacy Policy",
- },
- component: () => import("@/views/Privacy.vue"),
- },
- {
- path: "/rules",
- name: "rules",
- meta: {
- title: "Rules",
- },
- component: () => import("@/views/Rules.vue"),
- },
- {
- path: "/community",
- name: "community",
- meta: {
- title: "Community",
- },
- component: () => import("@/views/Community.vue"),
- },
- {
- path: "/minecraft",
- children: [
- {
- path: "",
- name: "minecraft",
- meta: {
- title: "Minecraft",
- },
- component: () => import("@/views/Minecraft.vue"),
- },
- {
- path: "curve",
- name: "minecraft-curve",
- meta: {
- title: "Minecraft Curve",
- },
- component: () => import("@/views/MinecraftCurve.vue"),
- },
- ],
- },
- {
- path: "/login",
- name: "login",
- meta: {
- title: "Login",
- middleware: "guest",
- },
- component: () =>
- import(/* webpackPrefetch: true */ "@/views/Login.vue"),
- },
- {
- path: "/logout",
- name: "logout",
- meta: {
- title: "Logout",
- },
- component: () => import("@/views/Logout.vue"),
- },
- {
- path: "/contact",
- name: "contact",
- meta: {
- title: "Contact",
- },
- component: () =>
- import(/* webpackPrefetch: true */ "@/views/Contact.vue"),
- },
- {
- path: "/conduct",
- redirect: { name: "code-of-conduct" },
- },
- {
- path: "/code-of-conduct",
- name: "code-of-conduct",
- meta: {
- title: "Code of Conduct",
- },
- component: () => import("@/views/CodeOfConduct.vue"),
- },
- {
- path: "/terms",
- redirect: { name: "terms-and-conditions" },
- },
- {
- path: "/terms-and-conditions",
- name: "terms-and-conditions",
- meta: {
- title: "Terms and Conditions",
- },
- component: () => import("@/views/TermsAndConditions.vue"),
- },
- {
- path: "/register",
- name: "register",
- meta: {
- title: "Register",
- },
- component: () =>
- import(/* webpackPrefetch: true */ "@/views/Register.vue"),
- },
- {
- path: "/dashboard",
- children: [
- {
- path: "",
- name: "dashboard",
- meta: {
- title: "Dashboard",
- middleware: "authenticated",
- },
- component: () =>
- import(
- /* webpackPrefetch: true */ "@/views/dashboard/Dashboard.vue"
- ),
- },
- {
- path: "analytics",
- children: [
- {
- path: "",
- name: "dashboard-analytics-list",
- meta: {
- title: "Analytics",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/AnalyticsList.vue"),
- },
- {
- path: ":id",
- name: "dashboard-analytics-item",
- meta: {
- title: "Analytics Session",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/AnalyticsItem.vue"),
- },
- ],
- },
- {
- path: "articles",
- children: [
- {
- path: "",
- name: "dashboard-article-list",
- meta: {
- title: "Articles",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/ArticleList.vue"),
- },
- {
- path: "create",
- name: "dashboard-article-create",
- meta: {
- title: "Create Article",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/ArticleEdit.vue"),
- },
- {
- path: ":id",
- name: "dashboard-article-edit",
- meta: {
- title: "Edit Article",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/ArticleEdit.vue"),
- },
- ],
- },
- {
- path: "events",
- children: [
- {
- path: "",
- name: "dashboard-event-list",
- meta: {
- title: "Events",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/EventList.vue"),
- },
- {
- path: "create",
- name: "dashboard-event-create",
- meta: {
- title: "Create Event",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/EventEdit.vue"),
- },
- {
- path: ":id",
- name: "dashboard-event-edit",
- meta: {
- title: "Event",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/EventEdit.vue"),
- },
- ],
- },
- {
- path: "details",
- name: "dashboard-account-details",
- meta: {
- title: "Account Details",
- middleware: "authenticated",
- },
- component: () => import("@/views/dashboard/UserEdit.vue"),
- },
- {
- path: "users",
- children: [
- {
- path: "",
- name: "dashboard-user-list",
- meta: {
- title: "Users",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/UserList.vue"),
- },
- {
- path: "create",
- name: "dashboard-user-create",
- meta: {
- title: "Create User",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/UserEdit.vue"),
- },
- {
- path: ":id",
- name: "dashboard-user-edit",
- meta: {
- title: "Edit User",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/UserEdit.vue"),
- },
- ],
- },
- {
- path: "media",
- children: [
- {
- path: "",
- name: "dashboard-media-list",
- meta: {
- title: "Media",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/MediaList.vue"),
- },
- {
- path: "create",
- name: "dashboard-media-create",
- meta: {
- title: "Upload Media",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/MediaEdit.vue"),
- },
- {
- path: ":id",
- name: "dashboard-media-edit",
- meta: {
- title: "Edit Media",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/MediaEdit.vue"),
- },
- ],
- },
- {
- path: "shortlinks",
- children: [
- {
- path: "",
- name: "dashboard-shortlink-list",
- meta: {
- title: "Shortlink",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/ShortlinkList.vue"),
- },
- {
- path: "create",
- name: "dashboard-shortlink-create",
- meta: {
- title: "Create Shortlink",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/ShortlinkEdit.vue"),
- },
- {
- path: ":id",
- name: "dashboard-shortlink-edit",
- meta: {
- title: "Edit Shortlink",
- middleware: "authenticated",
- },
- component: () =>
- import("@/views/dashboard/ShortlinkEdit.vue"),
- },
- ],
- },
- {
- path: "discord-bot-logs",
- name: "dashboard-discord-bot-logs",
- meta: {
- title: "Discord Bot Logs",
- middleware: "authenticated",
- },
- component: () => import("@/views/dashboard/DiscordBotLogs.vue"),
- },
- ],
- },
- {
- path: "/forgot-password",
- name: "forgot-password",
- meta: {
- title: "Forgot Password",
- },
- component: () => import("@/views/ForgotPassword.vue"),
- },
- {
- path: "/file/:id",
- name: "file",
- meta: {
- title: "File",
- },
- component: () => import("@/views/File.vue"),
- },
- {
- path: "/cart",
- name: "cart",
- meta: {
- title: "Cart",
- },
- component: () => import("@/views/Cart.vue"),
- },
- {
- path: "/:catchAll(.*)",
- name: "not-found",
- meta: {
- title: "Page not found",
- hideInEditor: true,
- },
- component: () => import("@/views/404.vue"),
- },
-];
-
-const router = createRouter({
- history: createWebHistory(),
- routes,
- scrollBehavior() {
- return { top: 0 };
- },
-});
-
-// export let activeRoutes = [];
-
-router.beforeEach(async (to, from, next) => {
- const userStore = useUserStore();
- const applicationStore = useApplicationStore();
-
- applicationStore.hydrated = false;
- applicationStore.clearDynamicTitle();
-
- if (applicationStore.pageLoaderTimeout !== 0) {
- window.clearTimeout(applicationStore.pageLoaderTimeout);
- applicationStore.pageLoaderTimeout = window.setTimeout(() => {
- const pageLoadingElem = document.getElementById("sm-page-loading");
- if (pageLoadingElem !== null) {
- pageLoadingElem.style.display = "flex";
- }
- }, 0);
- }
-
- if (to.meta.middleware == "authenticated") {
- if (userStore.id) {
- api.get({
- url: "/me",
- })
- .then((res) => {
- userStore.setUserDetails(res.data.user);
- })
- .catch((err) => {
- console.log(err);
- if (err.status == 401) {
- userStore.clearUser();
-
- window.location.href = `/login?redirect=${to.fullPath}`;
- }
- });
- }
-
- if (!userStore.id) {
- next({
- name: "login",
- query: { redirect: encodeURIComponent(to.fullPath) },
- });
-
- return;
- }
- }
-
- api.post({
- url: "/analytics",
- body: {
- type: "pageview",
- path: to.fullPath,
- },
- }).catch(() => {
- /* empty */
- });
-
- next();
-});
-
-router.afterEach((to, from) => {
- const applicationStore = useApplicationStore();
-
- if (from.name !== undefined) {
- document.body.classList.remove(`page-${from.name}`);
- }
- document.body.classList.add(`page-${to.name}`);
-
- window.setTimeout(() => {
- const getMetaValue = (tag, defaultValue = "") => {
- const getMeta = (obj, tag) => {
- const tagHierarchy = tag.split(".");
-
- const nearestWithMeta = obj.matched
- .slice()
- .reverse()
- .reduce(
- (acc, r) => acc || (r.meta && r.meta[tagHierarchy[0]]),
- null,
- );
- if (nearestWithMeta) {
- let result = nearestWithMeta;
- for (let i = 1; i < tagHierarchy.length; i++) {
- result = result[tagHierarchy[i]];
- if (!result) break;
- }
- if (result !== undefined) return result;
- }
-
- return null;
- };
-
- const nearestMeta = getMeta(to, tag);
- if (nearestMeta == null) {
- const previousMeta = getMeta(from, tag);
- if (previousMeta == null) {
- return defaultValue;
- }
-
- return previousMeta;
- }
- return nearestMeta;
- };
-
- updateSEOTags({
- title: getMetaValue("title"),
- description: getMetaValue("description"),
- keywords: getMetaValue("keywords", []),
- robots: {
- index: getMetaValue(
- "robots.index",
- !to.meta.middleware
- ? true
- : to.meta.middleware != "authenticated",
- ),
- follow: getMetaValue(
- "robots.follow",
- !to.meta.middleware
- ? true
- : to.meta.middleware != "authenticated",
- ),
- },
- url: getMetaValue("url", to.path),
- image: getMetaValue("image", ""),
- });
- }, 10);
-
- window.setTimeout(() => {
- const autofocusElement = document.querySelector("[autofocus]");
- if (autofocusElement) {
- autofocusElement.focus();
- }
-
- const hash = window.location.hash;
- if (hash) {
- const target = document.querySelector(hash);
- if (target) {
- target.scrollIntoView();
- }
- }
- }, 10);
-
- if (applicationStore.pageLoaderTimeout !== 0) {
- window.clearTimeout(applicationStore.pageLoaderTimeout);
- applicationStore.pageLoaderTimeout = 0;
- }
-
- const pageLoadingElem = document.getElementById("sm-page-loading");
- if (pageLoadingElem !== null) {
- pageLoadingElem.style.display = "none";
- }
-
- applicationStore.hydrated = true;
-});
-
-export default router;
diff --git a/resources/js/store/ApplicationStore.ts b/resources/js/store/ApplicationStore.ts
deleted file mode 100644
index ff3ea03..0000000
--- a/resources/js/store/ApplicationStore.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-import { defineStore } from "pinia";
-
-type ApplicationStoreEventKeyUpCallback = (event: KeyboardEvent) => boolean;
-type ApplicationStoreEventKeyPressCallback = (event: KeyboardEvent) => boolean;
-
-export interface ApplicationStore {
- hydrated: boolean;
- unavailable: boolean;
- dynamicTitle: string;
- eventKeyUpStack: ApplicationStoreEventKeyUpCallback[];
- eventKeyPressStack: ApplicationStoreEventKeyPressCallback[];
- pageLoaderTimeout: number;
- _addedListener: boolean;
-}
-
-export const useApplicationStore = defineStore({
- id: "application",
- state: (): ApplicationStore => ({
- hydrated: false,
- unavailable: false,
- dynamicTitle: "",
- eventKeyUpStack: [],
- eventKeyPressStack: [],
- pageLoaderTimeout: 0,
- _addedListener: false,
- }),
-
- actions: {
- async setDynamicTitle(title: string) {
- this.$state.dynamicTitle = title;
- document.title = `STEMMechanics | ${title}`;
- },
-
- clearDynamicTitle() {
- this.$state.dynamicTitle = "";
- },
-
- addKeyUpListener(callback: ApplicationStoreEventKeyUpCallback) {
- this.eventKeyUpStack.push(callback);
-
- if (!this._addedListener) {
- document.addEventListener("keyup", (event: KeyboardEvent) => {
- this.eventKeyUpStack.every(
- (item: ApplicationStoreEventKeyUpCallback) => {
- const result = item(event);
- if (result) {
- return false;
- }
-
- return true;
- },
- );
- });
- }
- },
-
- removeKeyUpListener(callback: ApplicationStoreEventKeyUpCallback) {
- this.eventKeyUpStack = this.eventKeyUpStack.filter(
- (item: ApplicationStoreEventKeyUpCallback) => item !== callback,
- );
- },
-
- addKeyPressListener(callback: ApplicationStoreEventKeyPressCallback) {
- this.eventKeyPressStack.push(callback);
-
- if (!this._addedListener) {
- document.addEventListener(
- "keypress",
- (event: KeyboardEvent) => {
- this.eventKeyPressStack.every(
- (item: ApplicationStoreEventKeyPressCallback) => {
- const result = item(event);
- if (result) {
- return false;
- }
-
- return true;
- },
- );
- },
- );
- }
- },
-
- removeKeyPressListener(
- callback: ApplicationStoreEventKeyPressCallback,
- ) {
- this.eventKeyPressStack = this.eventKeyPressStack.filter(
- (item: ApplicationStoreEventKeyPressCallback) =>
- item !== callback,
- );
- },
- },
-});
diff --git a/resources/js/store/CacheStore.ts b/resources/js/store/CacheStore.ts
deleted file mode 100644
index b43a808..0000000
--- a/resources/js/store/CacheStore.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import { DefineStoreOptions, defineStore } from "pinia";
-
-interface CacheItem {
- url: string;
- data: unknown;
-}
-
-export const useCacheStore = defineStore({
- id: "cache",
- state: () => ({
- cache: [] as CacheItem[],
- }),
-
- actions: {
- // Method to retrieve cached JSON data based on a URL
- getCacheByUrl(url: string) {
- const cachedItem = this.cache.find((item) => item.url === url);
- return cachedItem ? cachedItem.data : null;
- },
-
- // Method to update the cache with new data and check for modifications
- updateCache(url: string, newData: unknown): boolean {
- const index = this.cache.findIndex((item) => item.url === url);
-
- if (index !== -1) {
- // If the URL is already in the cache, check for modifications
- const existingData = this.cache[index].data;
-
- if (JSON.stringify(existingData) === JSON.stringify(newData)) {
- // Data is not modified, return false
- return false;
- } else {
- // Data is modified, update the cache
- this.cache[index].data = newData;
- return true;
- }
- } else {
- // If the URL is not in the cache, add it
- this.cache.push({ url, data: newData });
- return true;
- }
- },
-
- // Method to clear the cache for a specific URL
- clearCacheByUrl(url: string) {
- const index = this.cache.findIndex((item) => item.url === url);
- if (index !== -1) {
- this.cache.splice(index, 1);
- }
- },
-
- // Method to clear the entire cache
- clearCache() {
- this.cache = [];
- },
- },
-
- persist: true,
-} as DefineStoreOptions & {
- persist?: boolean;
-});
diff --git a/resources/js/store/ToastStore.ts b/resources/js/store/ToastStore.ts
deleted file mode 100644
index 27008a8..0000000
--- a/resources/js/store/ToastStore.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import { defineStore } from "pinia";
-
-export interface ToastOptions {
- id?: number;
- title?: string;
- content: string;
- type?: string;
- loader?: boolean;
-}
-
-export interface ToastItem {
- id: number;
- title: string;
- content: string;
- type: string;
- loader: boolean;
-}
-
-export interface ToastStore {
- toasts: ToastItem[];
-}
-
-export const defaultToastItem: ToastItem = {
- id: 0,
- title: "",
- content: "",
- type: "primary",
- loader: false,
-};
-
-export const useToastStore = defineStore({
- id: "toasts",
- state: (): ToastStore => ({
- toasts: [],
- }),
-
- actions: {
- addToast(toast: ToastOptions): number {
- while (
- !toast.id ||
- toast.id == 0 ||
- this.toasts.find((item: ToastItem) => item.id === toast.id)
- ) {
- toast.id =
- Math.floor(Math.random() * Number.MAX_SAFE_INTEGER) + 1;
- }
-
- toast.title = toast.title || defaultToastItem.title;
- toast.type = toast.type || defaultToastItem.type;
-
- this.toasts.push(toast);
- return toast.id;
- },
-
- clearToast(id: number): void {
- this.toasts = this.toasts.filter(
- (item: ToastItem) => item.id !== id
- );
- },
-
- updateToast(id: number, updatedFields: Partial): void {
- const toastToUpdate = this.toasts.find(
- (item: ToastItem) => item.id === id
- );
-
- if (toastToUpdate) {
- toastToUpdate.title =
- updatedFields.title || toastToUpdate.title;
- toastToUpdate.content =
- updatedFields.content || toastToUpdate.content;
- toastToUpdate.type = updatedFields.type || toastToUpdate.type;
- if (
- Object.prototype.hasOwnProperty.call(
- updatedFields,
- "loader"
- )
- ) {
- toastToUpdate.loader = updatedFields.loader;
- }
- }
- },
- },
-});
diff --git a/resources/js/store/UserStore.ts b/resources/js/store/UserStore.ts
deleted file mode 100644
index 7186682..0000000
--- a/resources/js/store/UserStore.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import { defineStore, DefineStoreOptions } from "pinia";
-
-export interface UserDetails {
- id: string;
- username: string;
- first_name: string;
- last_name: string;
- display_name: string;
- email: string;
- phone: string;
- permissions: string[];
-}
-
-export interface UserState {
- id: string;
- token: string;
- username: string;
- firstName: string;
- lastName: string;
- displayName: string;
- email: string;
- phone: string;
- permissions: string[];
-}
-
-export const useUserStore = defineStore({
- id: "user",
- state: (): UserState => {
- return {
- id: "",
- token: "",
- username: "",
- firstName: "",
- lastName: "",
- displayName: "",
- email: "",
- phone: "",
- permissions: [],
- };
- },
-
- actions: {
- async setUserDetails(user: UserDetails) {
- this.$state.id = user.id;
- this.$state.username = user.username;
- this.$state.firstName = user.first_name;
- this.$state.lastName = user.last_name;
- this.$state.displayName = user.display_name;
- this.$state.email = user.email;
- this.$state.phone = user.phone;
- this.$state.permissions = user.permissions || [];
- },
-
- async setUserToken(token: string) {
- this.$state.token = token;
- },
-
- clearUser() {
- this.$state.id = null;
- this.$state.token = null;
- this.$state.username = null;
- this.$state.firstName = null;
- this.$state.lastName = null;
- this.$state.displayName = null;
- this.$state.email = null;
- this.$state.phone = null;
- this.$state.permissions = [];
- },
- },
-
- persist: true,
-} as DefineStoreOptions & { persist?: boolean });
diff --git a/resources/js/tests/datetime.test.ts b/resources/js/tests/datetime.test.ts
deleted file mode 100644
index 01d4d12..0000000
--- a/resources/js/tests/datetime.test.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { expect, describe, it } from "vitest";
-import { SMDate } from "../helpers/datetime";
-
-describe("format()", () => {
- it("should return an empty string when the first argument is not a Date object", () => {
- const result = new SMDate("not a date").format("yyyy-MM-dd");
- expect(result).toEqual("");
- });
-
- it("should format the date correctly", () => {
- const date = new Date("2022-02-19T12:34:56");
- const result = new SMDate(date).format("yyyy-MM-dd HH:mm:ss");
- expect(result).toEqual("2022-02-19 12:34:56");
- });
-
- it("should handle single-digit month and day", () => {
- const date = new Date("2022-01-01T00:00:00");
- const result = new SMDate(date).format("yy-M-d");
- expect(result).toEqual("22-1-1");
- });
-
- it("should handle day of week and month name abbreviations", () => {
- const date = new Date("2022-03-22T00:00:00");
- const result = new SMDate(date).format("EEE, MMM dd, yyyy");
- expect(result).toEqual("Tue, Mar 22, 2022");
- });
-
- it("should handle 12-hour clock with am/pm", () => {
- const date = new Date("2022-01-01T12:34:56");
- const result = new SMDate(date).format("hh:mm:ss aa");
- expect(result).toEqual("12:34:56 pm");
- });
-});
diff --git a/resources/js/tests/string.test.ts b/resources/js/tests/string.test.ts
deleted file mode 100644
index 53620e2..0000000
--- a/resources/js/tests/string.test.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { expect, describe, it } from "vitest";
-import { toTitleCase } from "../helpers/string";
-
-describe("toTitleCase()", () => {
- it("should return a converted title case string", () => {
- const result = toTitleCase("titlecase");
- expect(result).toEqual("Titlecase");
- });
-
- it("should return a converted title case string and spaces", () => {
- const result = toTitleCase("titlecase_and_more");
- expect(result).toEqual("Titlecase And More");
- });
-});
diff --git a/resources/js/tests/validate.test.ts b/resources/js/tests/validate.test.ts
deleted file mode 100644
index 64003b4..0000000
--- a/resources/js/tests/validate.test.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { expect, describe, it } from "vitest";
-import { Email } from "../helpers/validate";
-
-describe("Email()", () => {
- it("should return valid=false when an invalid email address is passed to the validate function", async () => {
- const v = Email();
- const result = await v.validate("invalid email");
- expect(result.valid).toBe(false);
- });
-
- it("should return valid=false when an invalid email address is passed to the validate function", async () => {
- const v = Email();
- const result = await v.validate("fake@outlook");
- expect(result.valid).toBe(false);
- });
-
- it("should return valid=true when an valid email address is passed to the validate function", async () => {
- const v = Email();
- const result = await v.validate("fake@outlook.com");
- expect(result.valid).toBe(true);
- });
-
- it("should return valid=true when an valid email address is passed to the validate function", async () => {
- const v = Email();
- const result = await v.validate("fake@outlook.com.au");
- expect(result.valid).toBe(true);
- });
-});
diff --git a/resources/js/tooltip.js b/resources/js/tooltip.js
new file mode 100644
index 0000000..490ab48
--- /dev/null
+++ b/resources/js/tooltip.js
@@ -0,0 +1,40 @@
+// Create a new div element for the tooltip
+var tooltipDiv = document.createElement("div");
+tooltipDiv.style.display = "none";
+tooltipDiv.classList.add('absolute');
+tooltipDiv.classList.add('bg-yellow-200');
+tooltipDiv.classList.add('border');
+tooltipDiv.classList.add('border-yellow-400');
+tooltipDiv.classList.add('text-yellow-900');
+tooltipDiv.classList.add('select-none');
+tooltipDiv.classList.add('p-1');
+tooltipDiv.classList.add('rounded-sm');
+tooltipDiv.classList.add('shadow-md');
+tooltipDiv.classList.add('text-xs');
+tooltipDiv.classList.add('z-10');
+tooltipDiv.classList.add('max-w-48');
+document.body.appendChild(tooltipDiv);
+
+// Add event listeners to the body
+document.body.addEventListener('mouseover', showTooltip);
+document.body.addEventListener('mouseout', hideTooltip);
+document.body.addEventListener('touchstart', showTooltip);
+document.body.addEventListener('touchend', hideTooltip);
+
+function showTooltip(event) {
+ // Check if the event target has a title attribute
+ if (event.target.hasAttribute('data-tooltip')) {
+ // Show the tooltip and position it
+ tooltipDiv.style.display = "block";
+ tooltipDiv.style.left = ((event.pageX || event.touches[0].pageX) + 5) + 'px';
+ tooltipDiv.style.top = ((event.pageY || event.touches[0].pageY) - 5) + 'px';
+ tooltipDiv.textContent = event.target.getAttribute('data-tooltip');
+ }
+}
+
+function hideTooltip(event) {
+ // Check if the event target has a title attribute
+ if (event.target !== tooltipDiv && !event.target.hasAttribute('data-tooltip')) {
+ tooltipDiv.style.display = "none";
+ }
+}
diff --git a/resources/js/views/404.vue b/resources/js/views/404.vue
deleted file mode 100644
index 7e8e8a3..0000000
--- a/resources/js/views/404.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/resources/js/views/App.vue b/resources/js/views/App.vue
deleted file mode 100644
index afbc6af..0000000
--- a/resources/js/views/App.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/Article.vue b/resources/js/views/Article.vue
deleted file mode 100644
index 4e0885a..0000000
--- a/resources/js/views/Article.vue
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
-
-
-
-
![]()
-
-
-
- {{ article.title }}
-
-
-
-
- {{ formattedDate(article.publish_at) }}
-
-
-
Edit Article
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/Blog.vue b/resources/js/views/Blog.vue
deleted file mode 100644
index d4aae24..0000000
--- a/resources/js/views/Blog.vue
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ articlesError || "No posts where found" }}
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/Cart.vue b/resources/js/views/Cart.vue
deleted file mode 100644
index 476cc04..0000000
--- a/resources/js/views/Cart.vue
+++ /dev/null
@@ -1,3 +0,0 @@
-
- CART
-
diff --git a/resources/js/views/CodeOfConduct.vue b/resources/js/views/CodeOfConduct.vue
deleted file mode 100644
index 5bb3dbd..0000000
--- a/resources/js/views/CodeOfConduct.vue
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
-
- STEMMechanics supports the international community open to
- everyone without discrimination. We want this community to be a
- safe and welcoming place for both newcomers and current members.
- Everyone should feel comfortable and accepted regardless of
- their personal background and affiliation our projects and
- workshops.
-
-
-
- In the STEMMechanics community, participants from all over the
- world come together to create and work on STEM projects. This is
- made possible by the support, hard work, and enthusiasm of
- people who collaborate towards the common goal of creating great
- ideas. Cooperation at such a scale requires common guidelines to
- ensure a positive and inspiring atmosphere in the community.
-
-
- This is why we have this Code of Conduct: it explains the type
- of community we want to have. The rules below are not applied to
- all interactions with a simple matching algorithm. Human
- interactions happen in context and are complex. Perceived
- violations are evaluated by real humans who will try to
- interpret the interactions and the rules with kindness.
- Accordingly, there is no need to hypothesize on how these rules
- would affect normal interactions. Be reasonable, the
- Code of Conduct team surely will be as
- well.
-
-
-
- This Code of Conduct applies to all users, contributors and
- participants who engage with the STEMMechanics workshops,
- projects and its community platforms.
-
-
-
- -
- Politeness is expected at all times. Be kind and courteous.
-
- -
- Always assume positive intent from others. Be aware that
- differences in culture and English proficiency make written
- communication more difficult than face-to-face communication
- and that your interpretation of messages may not be the one
- the author intended. Conversely, if someone asks you to
- rephrase something you said, be ready to do so without
- feeling judged.
-
- -
- Feedback is always welcome but keep your criticism
- constructive. We encourage you to open discussions,
- proposals, issues, and bug reports. Use the community
- platforms to discuss improvements, not to vent out
- frustration. Similarly, when other users offer you feedback
- please accept it gracefully.
-
-
-
-
- Participating in restricted conduct will lead to a warning from
- community moderators and/or the Code of Conduct team and may
- lead to exclusion from the community in the form of a ban from
- one or all platforms.
-
-
- -
- STEMMechanics is committed to providing a friendly and safe
- environment for everyone, regardless of level of experience,
- gender identity and expression, sexual orientation,
- disability, physical appearance, body size, race, ethnicity,
- language proficiency, age, political orientation,
- nationality, religion, or other similar characteristics. We
- do not tolerate harassment or discrimination of participants
- in any form.
-
- -
- In particular, we strive to be welcoming to all and to
- ensure that anyone can take a more active role in the
- community and a project. Targeted harassment of minorities
- or individuals is unacceptable.
-
- - Aggressive or offensive behavior is not acceptable.
- -
- You will be excluded from participating in the community if
- you insult, demean, harass, intentionally make others
- uncomfortable by any means, or participate in any other
- hateful conduct, either publicly or privately.
-
- -
- Likewise, any spamming, trolling, flaming, baiting, or other
- attention-stealing behavior is not welcome and will result
- in exclusion from the community.
-
- -
- Any form of retaliation against a participant who contacts
- the Code of Conduct team is completely unacceptable,
- regardless of the outcome of the complaint. Any such
- behavior will result in exclusion from the community.
-
- -
- For certainty, any conduct which could reasonably be
- considered inappropriate in a professional setting is not
- acceptable.
-
-
-
-
- If you witness or are involved in an interaction with another
- community member that you think may violate this Code of
- Conduct, please contact STEMMechanics
- Code of Conduct team.
-
-
- STEMMechanics recognizes that it can be difficult to come
- forward in cases of a violation of the Code of Conduct. To make
- it easier to report violations, we provide a single point of
- contact via email at:
- conduct@stemmechanics.com.au. If you are more comfortable reaching out to a single person,
- you are also welcome to contact one or more members of the team
- using their personal emails listed below, or via direct
- messaging on community platforms where they are present.
-
-
-
- - James Collins, james@stemmechanics.com.au
-
- -
- GitHub / Discord / Reddit / Twitter:
- nomadjimbob
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/Community.vue b/resources/js/views/Community.vue
deleted file mode 100644
index c729776..0000000
--- a/resources/js/views/Community.vue
+++ /dev/null
@@ -1,130 +0,0 @@
-
- STEMMechanics has an active community across multiple channels. By
- joining our communities, you agree to follow the
- Code of Conduct.
-
-
-
-
-
-
diff --git a/resources/js/views/Contact.vue b/resources/js/views/Contact.vue
deleted file mode 100644
index 570db09..0000000
--- a/resources/js/views/Contact.vue
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
- If you have a question or would like help with a project, you can
- send it our way using the form on this page or be emailing
- hello@stemmechanics.com.au.
-
-
- You can find us on various social media platforms, and if you join
- our
- Discord
- server, you'll have the opportunity to connect with our team,
- participants, and other individuals who share similar interests.
-
-
-
-
- We provide both public and private workshops as well as run events
- on behalf of your organisation. If you would like to discuss a
- potential opportunity, send us an email at
- hello@stemmechanics.com.au.
-
-
-
- We do not have a physical address as our workshops are delivered
- across Queensland. Visit the
- workshops
- page for each specific location.
-
-
Official mail can be sent to the following postal address:
-
-
- STEMMechanics
PO Box 36
Edmonton, QLD, 4869
Australia
-
-
ABN: 15 772 281 735
-
-
-
-
-
diff --git a/resources/js/views/EmailVerify.vue b/resources/js/views/EmailVerify.vue
deleted file mode 100644
index 6b2bd64..0000000
--- a/resources/js/views/EmailVerify.vue
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
- Email Verify
-
- Enter your verification code below. If you have not yet
- received one,
- request a new code.
-
-
-
-
-
-
-
-
-
- Email Verified!
- Hurrah, Your email has been verified!
-
- Login
-
-
-
-
-
-
diff --git a/resources/js/views/Event.vue b/resources/js/views/Event.vue
deleted file mode 100644
index c8a3add..0000000
--- a/resources/js/views/Event.vue
+++ /dev/null
@@ -1,357 +0,0 @@
-
-
-
-
-
-
-
![]()
-
-
-
-
-
{{ event.title }}
-
-
-
-
-
- Registration for this event has closed.
-
-
- This event is at capacity.
-
-
- Registration for this event will open soon.
-
-
- This event has been cancelled.
-
-
- Registration not required for this event.
Arrive
- early to avoid disappointment as seating maybe limited.
-
-
-
- {{ event.registration_data }}
-
-
Edit Event
-
-
-
-
-
- Date / Time
-
-
- {{ line }}
-
-
-
-
-
-
-
- Location
-
-
- Online event
- {{ event.address }}
- {{ event.address }}
-
-
-
-
-
-
-
- {{ computedAges }}
-
-
- {{ computedAgeNotice }}
-
-
-
-
-
$
- {{ computedPrice }}
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/File.vue b/resources/js/views/File.vue
deleted file mode 100644
index 2f00f1d..0000000
--- a/resources/js/views/File.vue
+++ /dev/null
@@ -1,193 +0,0 @@
-
-
-
-
-
-
Password Required
-
- The file {{ fileName }} requires a password
- before you can view it:
-
-
-
-
-
-
-
-
-
-
Download Requested
-
- If you have permission to view this document, your download
- should now begin.
-
-
-
-
- Home
-
-
-
-
-
-
-
diff --git a/resources/js/views/ForgotPassword.vue b/resources/js/views/ForgotPassword.vue
deleted file mode 100644
index 1b352c1..0000000
--- a/resources/js/views/ForgotPassword.vue
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
- Forgot Password
-
- Enter your email below to receive a password reset link.
-
-
-
-
-
- Remember?Log in
-
-
-
-
-
-
-
- Email Sent!
-
- If that email address has been registered, you will receive an
- email with a reset password link in the next few minutes.
-
-
- Home
-
-
-
-
-
-
diff --git a/resources/js/views/Home.vue b/resources/js/views/Home.vue
deleted file mode 100644
index eb25a8c..0000000
--- a/resources/js/views/Home.vue
+++ /dev/null
@@ -1,385 +0,0 @@
-
-
-
-
-
- Latest News
-
-
-
-
-
-
-
-
-
-
- {{ articlesError || "No articles where found" }}
-
-
-
-
-
-
-

-
-
-
- Build skills while having a great time
-
-
- To keep up with our ever-changing world, it's important to
- encourage and support a new generation of curious minds who love
- science, engineering, art, and leadership.
-
-
-
- Explore Workshops
-
-
-
-
-
-
-
- Upcoming workshops
-
-
-
-
-
-
-
-
-
-
- {{ eventsError || "No workshops scheduled at this time" }}
-
-
-
-
-
-
-
- Play Minecraft with us
-
-
- We invite you to join us on our
-
- Minecraft server
- where you can participate in weekly challenges and mini-games.
-
-
-

-
- We also offer workshops for
-
- Minecraft Education
- , where you can learn to make it rain rabbits or grow
- flowers wherever you walk, all without the need for a school
- account.
-
-
-
-

-
-
-
-
-
-

-
-
-
- And the support doesn't stop!
-
-
- Though the workshop has come to a close, we remain available to
- assist you via email and Discord with any projects you undertake
- at home. We are always happy to help.
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/Login.vue b/resources/js/views/Login.vue
deleted file mode 100644
index 8f6092c..0000000
--- a/resources/js/views/Login.vue
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
- Log in
-
- Enter your website login details to view your account.
-
-
-
-
- Forgot password?
-
-
-
- Need an account?Register
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/Logout.vue b/resources/js/views/Logout.vue
deleted file mode 100644
index 7b83740..0000000
--- a/resources/js/views/Logout.vue
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
diff --git a/resources/js/views/Minecraft.vue b/resources/js/views/Minecraft.vue
deleted file mode 100644
index d0d25e9..0000000
--- a/resources/js/views/Minecraft.vue
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
- Howdy Minecraft fans, we invite you to join us on our own
- Minecraft server,
- STEMCraft.
-
-
- STEMCraft offers a unique blend of survival gameplay,
- captivating mini-games, and an array of custom items and
- mobs that will keep you immersed in a thrilling gaming
- experience.
-
-
- And best of all, the server can be customized by YOU!
- STEMCraft goes beyond mere entertainment—it is designed with
- an educational focus. We have incorporated special features
- to support our workshops, from coding new in commands in
- Java, customized mobs using 3D editing tools such as Blender
- and designing unique items for players to interact with.
-
-
- Jump over to the
- STEMCraft
- website for more information.
-
-
-
-
-
- STEMMechanics launched the Drustcraft server three years ago and
- since then, players have had countless enjoyable experiences. Cities
- were built, bosses defeated, and most importantly, a tight-knit
- community formed.
-
-
- Maintaining the server design became overwhelming and took away the
- fun of playing Minecraft. Hence, in January, the decision was made
- to shut down Drustcraft and offer a more straightforward Minecraft
- server, retaining the beloved elements of Drustcraft like
- mini-games, bosses, and survival. Join us on the new STEMMechanics
- Minecraft server, where the Drustcraft community awaits.
-
-
-
- After seven incredible years of operation, the Cairns Minecraft
- server officially closed its virtual doors in May 2022. This
- close-knit online community, which brought together gamers from
- around the region, renowned for its fantastic builds, lively
- competitions, and unique events. Throughout its existence, players
- forged genuine friendships, collaborated on awe-inspiring projects,
- and pushed the boundaries of creativity in the world of Minecraft.
- Although the server's closure marked the end of an era, the
- cherished memories and invaluable experiences shared by its members
- will forever remain etched in the hearts of the Cairns Minecraft
- community.
-
-
-
-
-
-
diff --git a/resources/js/views/MinecraftCurve.vue b/resources/js/views/MinecraftCurve.vue
deleted file mode 100644
index 544b02e..0000000
--- a/resources/js/views/MinecraftCurve.vue
+++ /dev/null
@@ -1,1104 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Width: {{ ruler_info.width }}
-
Height: {{ ruler_info.height }}
-
Area: {{ ruler_info.area }}
-
Filled: {{ ruler_info.filled }}
-
-
-
-
-
-
- Based on the work at
- https://iseenbaas.nl/curve/.
-
-
-
-
-
-
-
diff --git a/resources/js/views/Privacy.vue b/resources/js/views/Privacy.vue
deleted file mode 100644
index 1fd2d53..0000000
--- a/resources/js/views/Privacy.vue
+++ /dev/null
@@ -1,359 +0,0 @@
-
-
-
-
-
- At STEMMechanics, we take our customers' privacy and security
- seriously. We are committed to protecting your privacy and security
- and to complying with the Australian Privacy Principles in the
- Australian Privacy Act.
-
-
- The purpose of the Privacy Policy ("Privacy Policy") is to outline
- the personal information collected by us and the use of such
- information. The Privacy Policy applies to (stemmechanics.com.au)
- and online services (collectively, the "Sites") of STEMMechanics.
- ("STEMMechanics"). In this Privacy Policy, "Personal Information"
- means information or opinion about an identified individual, or an
- individual who is reasonably identifiable in accordance with section
- 6 of the Privacy Act 1988 (Cth).
-
-
- By using the Website and our online services, you agree to accept
- the Privacy Policy and the Site's Terms and Conditions
- https://www.stemmechanics.com.au/terms-and-conditions
- (Terms and Conditions). Where the Privacy Policy uses a word
- starting with a capital letter, that term will be defined in the
- Terms and Conditions or elsewhere in this Privacy Policy. If you do
- not agree to the terms of this Privacy Policy or the Terms and
- Conditions, you should not use the Site.
-
-
-
-
- Depending on the particular circumstances, we may collect and hold a
- range of different information about you.
-
-
-
-
- The types of individually identifiable information we collect will
- depend on the purposes(s) for which we are collecting it. For
- example, we may ask for:
-
-
- - your name;
- - your gamer tag or gamer username;
- - contact details;
- - identification information;
- -
- historical records of your communication and interaction with
- us;
-
- -
- details or history of preference, interests and behaviour
- relation to transactions, products, services and activities on
- our Site;
-
-
-
- As well as other similar Personal Information that is needed to
- register or subscribe you to our services or offers. If we ever ask
- for significantly different information, we will inform you. If you
- do not provide certain requested Personal Information to us, we may
- not be able to provide you with access to and use of the Site,
- provide you with access to our other products and services, or to
- fulfil one or more of our functions and activities applicable to
- you.
-
-
-
-
- Non-identifiable information is data that has never been labelled
- with individual identifiers or from which identifiers have been
- permanently removed, and by means of which no specific individual
- can be identified. When you visit the Site, our Company servers may
- automatically record non-identifiable information that your browser
- sends. This data may include:
-
-
- - your computer's IP address;
- - browser type;
- -
- webpage you were visiting before you came to our Site; the pages
- within
- www.stemmechanics.com.au
- you visit;
-
- -
- the time spent on those pages, items, and information searched
- on our Site, access times, dates and other statistics.
-
-
-
- Non-identifiable information is collected for analysis and
- evaluation in order to help us improve our Site and the services and
- products we provide. This data will not be used in association with
- any other Personal Information
-
-
-
We may collect your information in a number of ways, including:
-
(a) Directly from you, including but not limited when you:
-
- - browse our Site;
- - save an item;
- - register on our Site;
- - log into the Site once registered;
- - make a purchase from us;
- -
- contact our Customer Support, either about an order or for any
- other reason;
-
- - click on STEMMechanics banners, hyperlinks or plugins;
- - interact with us on our social media;
- - or have a conversation with our team members
-
-
- (b) From third parties such as our related entities, business or
- commercial partners, and
-
-
(c) From publicly available sources of information.
-
- We may also collect information from you online. See more
- information in clause 6.
-
-
-
- We may store your Personal Information in hard copy or electronic
- format, in facilities that we own and operate ourselves, or that are
- owned and operated by our service providers. We take the privacy and
- security of your Personal Information seriously and we use a number
- of procedures and processes to ensure, where possible, the security
- and integrity of your Personal Information.
-
-
We protect your Personal Information by:
-
- - Restricting access to Personal Information;
- -
- Maintaining technology products to prevent unauthorised computer
- access;
-
- -
- Securely destroying your Personal Information when it is no
- longer needed for our record retention purposes.
-
-
-
- To further secure your credit card, we also don't keep details of
- your credit card information, including the security code (or CCV
- number) that you need to input in order to complete an order using
- your credit card.
-
-
- However, no data transmission over the internet can be guaranteed as
- completely secure. Once any information is in our possession, we
- will take reasonable steps to protect that information from misuse,
- loss, unauthorized access, and modification or disclosure. While we
- strive to protect such information, we cannot guarantee 100% the
- security of any information (personal or other) you transmit to us.
- Therefore, we will not be liable for any breach of security or
- unintended loss or disclosure of information due to the Site being
- linked to the Internet.
-
-
-
- We may use your information for a range of different purposes,
- including:
-
-
(a) to provide products and services to you;
-
- (b) to communicate with you, including about products and services,
- competition results, special offers, and events which might interest
- you;
-
-
- (c) to answer your questions and provide you with information or
- advice;
-
-
- (d) to create orders, transaction records, agreements for the sale
- of products or services, accounts, tax invoices or receipts;
-
-
- (e) to gain an understanding your information to improve or develop
- our products and services;
-
-
(f) to provide you with better customer services;
-
(g) to perform research and analysis;
-
- (h) to carry out administration, marketing, planning, fraud and loss
- prevention activities, procurement, product and service development,
- quality control and research to improve the way STEMMechanics and
- our related bodies corporate and service providers provide products
- and services to you; and;
-
-
- (i) to comply with laws or regulations or to comply with any
- directions given by regulators or authorities.
-
-
- We may also use your information so that we, our related entities,
- other business or commercial partners can promote and market
- products, services and special offers that will be of interest to
- you (which may include products, services and offers provided by a
- third party).
-
-
- We collect aggregated information about you which informs us about
- our users. The browser information we collect is used in an
- aggregated, anonymous manner in our internal analysis of traffic
- patterns within our Site. This information is used by us to
- administer and improve our education and training products and
- services.
-
-
-
- We engage a range of third parties to provide services and perform
- business support functions for us. Some of those third parties need
- access to Personal Information in order to provide the services or
- perform the functions we require. Therefore, we may disclose your
- information to these third parties to:
-
-
- (a) assist us in providing products and services you have requested,
- such as delivery service providers and fulfilment managers;
-
-
(b) conduct market research and marketing strategy analysis; and
-
- (c) manage or develop our business and corporate strategies and
- functions.
-
-
- Where we share your Personal Information with third party service
- providers, they will be contractually bound to use the information
- only for the purposes of providing the services or performing the
- functions required by us and to store the information securely, for
- example, storing in non-human readable form to ensure the security
- of your information.
-
-
-
- We use "cookies" when you visit our Site. It is a technology that
- enables us to operate an efficient service and track the patterns of
- behaviour of visitors to the Site. There are four main types of
- cookies - here's how and why we use them.
-
-
- (a) Site functionality cookies - these cookies allow you to navigate
- the Site and use our features, such as "Add to Bag" and "Add to
- Wishlist".
-
-
- (b) Site analytics cookies - these cookies allow us to measure and
- analyse how our customers use the Site, to improve both its
- functionality and your shopping experience.
-
-
- (c) Customer preference cookies - when you are browsing, these
- cookies will remember your preferences (like your language or
- location), so we can make your shopping experience as seamless as
- possible, and more personal to you.
-
-
- (d) Targeting or advertising cookies - these cookies are used to
- deliver marketing and advertising materials that are relevant to
- you. They also limit the number of times that you see an ad and help
- us measure the effectiveness of our marketing campaigns.
-
-
- By using our Site, you agree to us placing these sorts of cookies on
- your device and accessing them when you visit the Site in the
- future. You can modify the settings on your device to prevent cookie
- use. Please note by disabling cookies, you user experience may be
- affected and you might not be able to take advantage of certain
- functions of our Site.
-
-
-
- Under the Privacy Act, individuals have a right to complete access
- to their records. You may ask us in writing to provide you with
- details of the Personal Information we hold about you. We will
- endeavour to process your request as soon as practicable.
-
-
- If you wish for your Personal Information to be removed from our
- database, please contact us at
- https://www.stemmechanics.com.au/contact.
-
-
-
- If you wish to exercise any of your rights under this Privacy
- Policy, have any questions, comments or complaints regarding our
- practices, or if you are of the view that we have not adhered to
- this Privacy Policy, you can contact us by email to
- hello@stemmechanics.com.au. You can find more information about privacy and the protection of
- your Personal Information on the website of the OAIC at
- https://www.oaic.gov.au.
-
-
-
- Please note that this Privacy Policy forms part of the Terms and
- Conditions for use of the Site and forms part of the Agreement
- between you and us. We may, from time to time, amend this Privacy
- Policy, in whole or part, in our sole discretion. Any changes to
- this Privacy Policy will be effective immediately upon the posting
- of the revised Privacy policy on the Site. Depending on the nature
- of the change, we may announce the change on the Site or by email if
- we have your email address. However, in any event, by continuing to
- use the Site following any changes, you will be deemed to have
- agreed to such changes. If you do not agree with the terms of this
- Privacy Policy, as it may be amended from time to time, in whole or
- partly, you must terminate your use of the Site.
-
-
-
-
-
diff --git a/resources/js/views/Register.vue b/resources/js/views/Register.vue
deleted file mode 100644
index d0605dc..0000000
--- a/resources/js/views/Register.vue
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
- Register
-
- Create an account to access STEMMechanics courses and features.
-
-
-
-
-
-
-
- Already have an account?Log in
-
-
-
-
-
-
Email Sent!
-
- An email has been sent to you to confirm your details and to
- finish registering your account.
-
-
- Home
-
-
-
-
-
-
diff --git a/resources/js/views/ResendEmailVerify.vue b/resources/js/views/ResendEmailVerify.vue
deleted file mode 100644
index 9bf6618..0000000
--- a/resources/js/views/ResendEmailVerify.vue
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- Resend Email
-
- If you have not received your verification email yet, we can
- send you another one.
-
-
-
-
- Stuck?Contact Us
-
-
-
-
-
-
-
- Email Sent!
-
- If that email address has been registered, and you still need to
- verify your email, you will receive an email with a new verify
- code.
-
-
- Home
-
-
-
-
-
-
diff --git a/resources/js/views/ResetPassword.vue b/resources/js/views/ResetPassword.vue
deleted file mode 100644
index c352885..0000000
--- a/resources/js/views/ResetPassword.vue
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
- Reset Password
-
-
-
-
-
-
-
- Password Reset!
- Hurrah, Your password has been changed!
-
- Log in
-
-
-
-
-
-
diff --git a/resources/js/views/Rules.vue b/resources/js/views/Rules.vue
deleted file mode 100644
index 60715e0..0000000
--- a/resources/js/views/Rules.vue
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
- We want to make sure everyone has fun and stays safe while using our
- platforms and services. That's why we have some rules to follow.
-
-
- These are some of the things we DO NOT allow
- anywhere:
-
-
- - Don't spam or use bad words too much.
- - Don't be mean to others or say hateful things.
- - Don't share inappropriate, adult or violent stuff.
- -
- Don't tell people where you live or give them your real name.
-
- - Don't advertise things, but it's okay to talk about them.
- -
- Don't send anything that could harm someone's computer or
- property.
-
- - Don't try to get out of trouble by doing something sneaky.
- - Don't bully or be mean to others.
-
-
-
-
-
-
-
- - Don't beg for things from others.
- - Use must use a Microsoft account to play on the server.
- -
- Don't use hacks to cheat like Jesus, Camera, and Dupes (but
- mini-maps are okay).
-
- -
- Don't destroy other people's buildings, except in the Survival
- game mode.
-
-
-
-
-
-
diff --git a/resources/js/views/TermsAndConditions.vue b/resources/js/views/TermsAndConditions.vue
deleted file mode 100644
index 1396e03..0000000
--- a/resources/js/views/TermsAndConditions.vue
+++ /dev/null
@@ -1,589 +0,0 @@
-
-
-
-
- Please read these terms carefully. By accessing or using our website
- and online servers, you agree to be bound by these terms and
- conditions. Do not use this site or our other online services if you
- if you do not agree to all of these terms. If you have any questions
- regarding the use of our site, please contact us. These Terms and
- Conditions ("Terms") apply to your access to, and use of the website
- (stemmechanics.com.au) and online services (collectively, the
- "Sites") of STEMMechanics. ("STEMMechanics"). The Terms do not alter
- in any way the terms or conditions of any other agreement you may
- have with STEMMechanics, or our subsidiaries or affiliates, for
- products, services or otherwise. If you are using the Sites on
- behalf of any entity, you represent and declare that you are
- authorized to accept these Terms on such entity's behalf and that
- such entity agrees to indemnify you and STEMMechanics for its
- violations of these Terms.
-
-
-
- You must be 18 years of age to use the Website. If you are under 18
- years of age you must have the permission of your parent or guardian
- to use the Site.
-
-
- Until you are 18 years old, by using our online services you certify
- that your parents or legal guardian has consented to your use and
- agreed to these Terms and Conditions on your behalf, and you
- acknowledge and agree that your use of our online services is at
- their discretion. We may require your parents or legal guardian to
- provide a written acknowledgement of these Terms and Conditions on
- your behalf before we provide you with part of all of our online
- services.
-
-
- You also represent and warrant that you (a) have not previously been
- suspended or removed from the Sites; (b) do not have more than one
- Site account.
-
-
- In consideration of your use of the Sites, you agree to (a) provide
- accurate, current and complete information; (b) maintain and
- promptly update your account information; (c) maintain the security
- of your account credentials; (d) not share your account credentials
- with others; and (e) promptly notify STEMMechanics if you discover
- or otherwise suspect any security breaches related to the Sites.
-
-
-
- Unless otherwise indicated on our Sites, the Sites and all content
- and materials therein, including but not limited to the
- STEMMechanics logo and all designs, text, graphics, pictures,
- information, data, software, sound files, other files and the
- selection and arrangement thereof (collectively, "Site Content") are
- the proprietary property of STEMMechanics or our affiliates,
- licensors, suppliers or users and are protected by international
- copyright laws.
-
-
- You are granted a limited, nonexclusive, non-sublicensable license
- to access and use the Sites and electronically copy (except where
- prohibited without a license) and print hard copy portions of the
- Site Content for your informational, non-commercial and personal
- use. Such license is subject to these Terms and excludes: (a) any
- resale of the Sites or Site Content; (b) the collection and use of
- any product listings, pictures or descriptions; (c) the
- distribution, public performance or public display of any Site
- Content; (d) modifying or otherwise making any derivative uses of
- the Sites and the Site Content, or any portion thereof; (e) use of
- any data mining, robots or similar data gathering or extraction
- methods; (f) downloading (other than page caching) of any portion of
- the Sites, the Site Content or any information contained therein,
- except as expressly permitted on the Sites or pursuant to separate
- terms; or (g) any use of the Sites or the Site Content other than
- for its intended purpose. Any other use of the Sites or the Site
- Content, without the prior written permission of STEMMechanics, is
- strictly prohibited and will terminate the license granted herein.
- Unless explicitly stated herein, nothing in these Terms shall be
- construed as conferring any license to intellectual property rights,
- whether by estoppel, implication or otherwise. This license is
- revocable at any time.
-
-
-
- You are granted a limited, non-exclusive right to create a text
- hyperlink to the Sites for non-commercial purposes, provided such
- link does not portray STEMMechanics or any of our products and
- services in a false, misleading, derogatory or otherwise defamatory
- manner and provided further that the linking site does not contain
- any adult or illegal material or any material that is offensive,
- harassing or otherwise objectionable. This limited right may be
- revoked at any time. You may not use a STEMMechanics logo or other
- proprietary graphic of STEMMechanics to link to the Sites without
- the express written permission of STEMMechanics. Further, you may
- not use, frame or utilize framing techniques to enclose any
- STEMMechanics logo or other proprietary information, including the
- images found at the Sites, the content of any text or the
- layout/design of any page or form contained on a page on the Sites
- without STEMMechanics' express written consent.
-
-
- STEMMechanics makes no claim or representation regarding the
- quality, content, nature or reliability of third-party websites
- accessible by hyperlink from the Sites, or websites linking to the
- Sites. Such sites are not under the control of STEMMechanics and
- STEMMechanics provides these links to you only as a convenience. The
- inclusion of any link does not imply affiliation, endorsement or
- adoption by STEMMechanics of any site or any information contained
- therein. When you leave our Sites, you should be aware that our
- terms and policies no longer govern. You should review the
- applicable terms and policies, including privacy and data gathering
- practices, of any site to which you navigate from the Sites.
-
-
-
- The Sites may include discussion blogs, profiles, product reviews or
- other interactive features or areas (collectively, "Interactive
- Areas"), in which you or other users create, post, transmit or store
- any content, such as text, photos, video, graphics or code on the
- Sites ("User Content"). User Content is publicly-viewable and
- includes your profile information and any content you post pursuant
- to your profile, but it does not include your stemmechanics.com.au
- account information (also known as "Your STEMMechanics Account" or
- "Your Account") or information you submit in order to make a
- purchase. You agree that you are solely responsible for your User
- Content and for your use of such Interactive Areas, and that you use
- the Interactive Areas at your own risk.
-
-
- By using any Interactive Areas, you agree not to post, upload to,
- transmit, distribute, store, create or otherwise publish or send
- through the Sites any of the following:
-
-
- -
- User Content that is unlawful, defamatory, obscene,
- pornographic, indecent, lewd, suggestive, harassing,
- threatening, abusive, inflammatory, fraudulent or otherwise
- objectionable;
-
- -
- User Content that would constitute, encourage or provide
- instructions for a criminal offense, violate the rights of any
- party or that would otherwise create liability or violate any
- local, state, national or international law;
-
- -
- User Content that displays, describes or encourages usage of any
- product we sell in a manner that could be offensive,
- inappropriate or harmful to STEMMechanics or any user or
- consumer or that is contrary to any instructions or warnings
- relating to the product (safety concerns can be reported here);
-
- -
- User Content that may impinge upon or violate the publicity,
- privacy or data protection rights of others, including pictures,
- videos, images or information about another individual where you
- have not obtained such individual's consent;
-
- -
- User Content that makes false or misleading statements, claims
- or depictions about a person, company, product or service;
-
- -
- User Content that does not clearly and prominently disclose any
- material connections you may have to STEMMechanics or
- third-party brands or sellers (for example, if you receive free
- products or services or are a paid blogger or employee);
-
- -
- User Content that may infringe any patent, trademark, trade
- secret, copyright or other intellectual or proprietary right of
- any party;
-
- -
- User Content that impersonates any person or entity or otherwise
- misrepresents your affiliation with a person or entity;
-
- -
- Viruses, malware of any kind, corrupted data or other harmful,
- disruptive or destructive files or code; and
-
- -
- User Content that, in the sole judgment of STEMMechanics,
- restricts or inhibits any other person from using or enjoying
- the Sites or which may expose STEMMechanics or our users to any
- harm or liability of any type.
-
-
-
- Enforcement of the Terms, however, is solely in our discretion and
- the absence of enforcement of these Terms in some instances does not
- constitute a waiver of our right to enforce the Terms in other
- instances. In addition, these Terms do not create any private right
- of action on the part of any third party or any reasonable
- expectation or promise that the Sites will not contain any content
- that is prohibited by such Terms. Although STEMMechanics has no
- obligation to screen, edit or monitor any of the User Content posted
- on the Sites, STEMMechanics reserves the right, and has absolute
- discretion, to remove, screen or edit any User Content posted or
- stored on the Sites at any time and for any reason without notice,
- and you are solely responsible for creating backup copies and
- replacing any User Content you post or store on the Sites at your
- sole cost and expense.
-
-
- Any use of the Sites in violation of these Terms may result in,
- among other things, termination or suspension of your rights to use
- the Sites.
-
-
-
- Except as otherwise provided herein, on the Sites or in a separate
- agreement with us (such as the rules of a STEMMechanics photo
- sharing contest), STEMMechanics claims no ownership or control over
- any User Content. However, by submitting or posting User Content on
- the Sites, you grant STEMMechanics and our subsidiaries and
- affiliates a nonexclusive, royalty-free, world-wide, perpetual,
- irrevocable, transferable, and fully sublicensable right to use,
- reproduce, modify, adapt, publish, translate, create derivative
- works from, distribute, perform and display such User Content on the
- Sites and on third-party sites and in all other media or formats,
- whether currently known or hereafter developed, for any purpose and
- without any compensation to you. You also grant users of the Sites
- the right to access your User Content in connection with their use
- of the Sites. If you choose to remove your User Content, the license
- granted above will automatically expire; however, you acknowledge
- that there may be exceptions (for example, you cannot delete a vote
- you submitted that has already been counted or your purchase
- history). In addition, we may retain archived copies of your User
- Content and cached copies of your User Content may still be
- available for some period of time.
-
-
- By posting User Content to the Sites, you represent and warrant that
- (a) such User Content is non-confidential; (b) you own and control
- all of the rights, title and interest in and to the User Content or
- you otherwise have all necessary rights to post and use such User
- Content to the Sites and to grant the rights to STEMMechanics that
- you grant in these Terms; (c) the User Content is accurate and not
- misleading or harmful in any manner; and (d) the User Content, and
- your use and posting thereof in connection with the Sites, do not
- and will not violate these Terms, our Site Rules, any other
- applicable STEMMechanics terms, guidelines or policies or any
- applicable law, rule or regulation.
-
-
-
- Separate and apart from User Content, you have the ability to submit
- questions, comments suggestions, reviews, ideas, plans, designs,
- notes, proposals, drawings, original or creative materials and other
- information regarding the Sites, STEMMechanics and our products or
- services (collectively "Feedback"). You agree that Feedback is
- non-confidential and shall become the sole property of
- STEMMechanics. STEMMechanics shall own exclusive rights, including
- all intellectual property rights, in and to such Feedback and shall
- be entitled to the unrestricted use and dissemination of the
- Feedback for any purpose, commercial or otherwise, without
- acknowledgment or compensation to you. Do not send us Feedback if
- you expect to be paid or want to continue to own or claim rights in
- them; your idea might be great, but we may have already had the same
- or a similar idea and we do not want disputes.
-
-
-
- You agree that you will not violate any law, contract or
- intellectual property or other third party right or commit a tort
- and that you are solely responsible for your conduct while accessing
- or using the Sites. You also agree to abide by our Site Rules and
- that you will not:
-
-
- -
- Use the Sites in any unlawful manner or in any manner that could
- damage, disable, overburden or impair the Sites;
-
- -
- Send unsolicited or unauthorized advertising, solicitations,
- promotional materials, spam, junk mail, chain letters and
- pyramid schemes, or harvest or collect email addresses or other
- contact information of other users from the Sites for the
- purposes of sending spam;
-
- -
- Use any robot, spider, crawler, scraper or other automated means
- or interface not provided by us to access the Sites or to
- extract data;
-
- -
- Reverse engineer any aspect of the Sites or do anything that
- might discover source code or bypass or circumvent measures
- employed to prevent or limit access to any area, content or code
- of the Sites (except as otherwise expressly permitted by law);
-
- -
- Solicit personal information from anyone under 18 or solicit
- passwords or personally identifying information for commercial
- or unlawful purposes;
-
- -
- Use or attempt to use another's account without authorization
- from STEMMechanics;
-
- -
- Attempt to circumvent any content filtering techniques we employ
- or access any service or area of the Sites that you are not
- authorized to access;
-
- -
- Engage in any harassing, intimidating, predatory or stalking
- conduct;
-
- -
- Develop any third-party applications that interact with User
- Content and our Sites;
-
- -
- Interfere with or damage the operation of the Sites or introduce
- to the Sites or its users any viruses, malware, corrupted data
- or other harmful, disruptive or destructive files or code; or
-
- -
- "Frame" our Sites or otherwise make it look like you have a
- relationship to us or that we have endorsed you for any purpose.
-
-
-
- In addition to the above rules, you also agree to abide by any
- additional STEMMechanics rules in realtion to any organised Forum,
- Chat, Game and/or Realm Servers. You can view the collection of
- additional rules at
- stemmechanics.com.au/rules
-
-
- STEMMechanics has no obligation to monitor any user conduct on the
- Sites, and STEMMechanics reserves the right and has absolute
- discretion to monitor any user conduct on the Sites at any time and
- for any reason without notice. STEMMechanics does not approve or
- endorse any user-posted meetings or events referenced on the Sites
- and STEMMechanics recommends exercising caution before contacting or
- meeting anyone (online or offline) that is unfamiliar to you.
-
-
-
- These Terms are for the benefit of, and will be enforceable by, the
- parties only. These Terms are not intended to confer any right or
- benefit on any third party or to create any obligations or liability
- of a party to any such third party.
-
-
-
- To the fullest extent permitted by applicable law, you agree to
- defend, indemnify and hold harmless STEMMechanics and our
- subsidiaries and affiliates, and our respective, directors,
- employees, independent contractors, service providers and
- consultants, from and against any claims, damages, costs,
- liabilities and expenses (collectively, "Claims") arising out of or
- related to (a) your access to and use or misuse of the Sites; (b)
- any User Content you post, upload, use, distribute, store or
- otherwise transmit on or through the Sites; (c) any Feedback you
- provide; (d) your violation of these Terms; and (e) your violation
- of any rights of another.
-
-
-
- Except as expressly provided, the Sites, Site Content, User Content
- and services provided on or in connection with the Sites
- (collectively, "Complete Site") are provided on an "AS IS" and "WITH
- ALL FAULTS" basis without representations, warranties or conditions
- of any kind, either express or implied. STEMMECHANICS DISCLAIMS ALL
- OTHER REPRESENTATIONS, WARRANTIES, CONDITIONS AND DUTIES, EXPRESS,
- IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO IMPLIED
- WARRANTIES, DUTIES OR CONDITIONS: (A) OF MERCHANTABILITY, FITNESS
- FOR A PARTICULAR PURPOSE OR USE, RESULTS, TITLE, AND
- NON-INFRINGEMENT; AND (B) CREATED BY TRADE USAGE, COURSE OF DEALING
- OR COURSE OF PERFORMANCE. STEMMechanics does not represent or
- warrant that the Complete Site is accurate, complete, reliable,
- current or error-free. STEMMechanics does not represent or warrant
- that the Sites or our servers are free of viruses or other harmful
- components.
-
-
- The Site Content, including, but not limited to, STEMMechanics
- videos and "Expert Advice" articles, is general in nature and must
- be used with an appreciation for the differing capabilities among
- individual users and the differing demands placed on equipment and
- techniques by the wide variety of circumstances that can be
- encountered in outdoor recreation. The information is not a
- substitute for in-person guidance by a qualified instructor.
-
-
-
- To the fullest extent permitted by applicable law, in no event shall
- the STEMMechanics parties be liable for any special, indirect,
- incidental or consequential damages, including, but not limited to,
- loss of use, loss of profits or loss of data, whether in an action
- in contract, tort (including, but not limited to, negligence) or
- otherwise, arising out of or in any way connected to the access or
- use of the complete site, your online or offline interactions with
- other site users, or otherwise related to these terms, including but
- not limited to any damages that result from events beyond our
- reasonable control, such as interruptions to all or portions of the
- complete site, deletion of files or email, errors or omissions,
- defects, viruses, delays in operation or transmission or failure of
- performance, whether or not resulting from acts of god,
- communications failure, theft, destruction or unauthorized access to
- an STEMMechanics party's records, programs or services.
-
-
-
- STEMMechanics reserves the right to modify or discontinue,
- temporarily or permanently, the Sites or any features or portions
- thereof without prior notice.
-
-
-
- You may terminate the Terms at any time by closing your account,
- discontinuing your use of the Sites and providing STEMMechanics with
- a notice of termination. STEMMechanics reserves the right, without
- notice and in our sole discretion, to terminate your right to use
- the Sites, or any portion of the Sites, and to block or prevent your
- future access to and use of the Sites or any portion of the Sites.
-
-
-
- If any provision of these Terms shall be deemed unlawful, void or
- for any reason unenforceable, then that provision shall be deemed
- severable from these Terms and shall not affect the validity and
- enforceability of any remaining provisions.
-
-
-
- Upon completing your order and submitting it through the checkout
- system, an order reference number will be issued to you via a
- confirmation email. We will not process your order until it has
- passed our internal validation procedures, for the purpose of
- preventing credit card or payment fraud. Upon processing your order
- and receiving payment we will send you a confirmation email which is
- your Tax Invoice. We reserve the right to refuse service or supply
- of the products or to terminate the contract and/or your account at
- our sole discretion. If we cannot process your order after receiving
- payment, we will contact you using the details entered at the
- checkout. By placing an order with stemmechanics.com.au, you declare
- that will not be on-selling the product(s) to another person(s) for
- financial gain.
-
-
- In the instance that you need to cancel or edit your order of a
- physical item; if you fail to notify us before your order has been
- dispatched, you can incur a return to sender delivery fee of $25. To
- avoid any fees associated when cancelling/editing your order, you'll
- need to notify receive confirmation from a STEMMechanics customer
- support team member before the order has been dispatched from our
- premises.
-
-
- Digital items cannot be cancelled or edited after receiving payment.
-
-
-
- All prices are shown in Australia dollars (AUD). All items are
- subject to availability and we reserve the right to impose quantity
- limits on any order, to reject all or part of an order and to
- discontinue products or services without notice, even if you have
- already placed your order. All prices are subject to change without
- notice. Prices displayed on the Sites may vary from those in the
- store or from store-advertised prices. All purchases on applicable
- products include GST at the rate of 10%.
-
-
-
- We attempt to be as accurate as possible and eliminate errors on the
- Sites; however, we do not warrant that any product, service,
- description, photograph, pricing or other information is accurate,
- complete, reliable, current or error-free. In the event of an error,
- whether on the Sites, in an order confirmation, in processing an
- order, delivering a product or service or otherwise, we reserve the
- right to correct such error and revise your order accordingly if
- necessary (including charging the correct price) or to cancel the
- order and refund any amount charged. Your sole remedy in the event
- of such error is to cancel your order and obtain a refund.
-
-
-
- If the colour or size you want is not listed in the "Choose Your
- Colour/Size" drop-down box on the Product Information page, it is
- not then available for ordering. Please check back later. If the
- colour or size you want has an Out of Stock label, it is on
- backorder and available for pre-order. Sometimes we will not know in
- advance that product is unavailable, so when you place items in your
- Cart you will be asked if you would like to pre-order them. If you
- indicate yes, the item will be sent to you once it becomes
- available. Note that some items may be backordered or unavailable
- even if the Sites indicate that they are in-stock, and adding an
- item to your Cart does not guarantee the availability of that item.
- If you have items on pre-order that you would like to cancel, please
- contact us.
-
-
-
- You agree that all of your transactions with or through the Sites
- may, at our option, be conducted electronically from start to
- finish, and that any oral conversations may be recorded. If we
- decide to proceed non-electronically, those transactions will still
- be governed by the remainder of these Terms unless you enter into
- different terms provided by us. You are responsible to print or make
- an electronic a copy of these Terms and any other contract or
- disclosure that we are required to provide to you.
-
-
-
- We currently accept Visa and Mastercard online. Only valid credit
- cards or other payment method acceptable to us may be used and all
- refunds will be credited to the same card or, in our discretion,
- other method. By submitting your order, you represent and declare
- that you are authorized to use the designated card or method and
- authorize us to charge your order (including taxes, delivery costs,
- handling and any other amounts described on the Sites) to that card
- or other method. If the card (or other method) cannot be verified,
- is invalid, or is not otherwise acceptable, your order may be
- suspended or cancelled automatically.
-
-
-
- You may not place orders with the intention to immediately
- on-forward the products to another person in a business transaction
- (via marketplaces such as eBay etc), without the express written
- permission of STEMMechanics.
-
-
- In the instance that you, a customer who has received a
- STEMMechanics order via an on-forwarder, then you forfeit your right
- to make; a) a warranty claim or b) refund or exchange with
- STEMMechanics. As per Australian Consumer Law or Consumer Guarantee,
- the reseller who has conducted the transaction must address the
- warranty and refunds directly with the manufacturer at their own
- cost and loss.
-
-
- If a reseller who has conducted the transaction is requesting that
- STEMMechanics send the product directly to the customer then they
- are engaging in Misleading Breach of the Law. The two laws are:
- Section 18 of the act which relates to Passing Off, and Trading on
- the Goodwill of Another Business - and, section 29 1 G which relates
- to Affiliation (misleading the customer that the seller works for
- the Retailer, in this case STEMMechanics). This can be made obvious
- by the reseller's customer receiving a Tax Invoice for the products
- with STEMMechanics letterhead and other documentation supplied by
- STEMMechanics Outdoors, misleading the customer to think they are
- buying from a reputable store instead of a reseller, often just a
- consumer. Exceptions to this would be if the reseller has an ABN or
- ACN that relates solely and specifically to reselling products
- purchased from a Retailer, to their customer base. They will still
- be responsible for warranty and after sales service but this is
- allowed under the Law.
-
-
-
-
-
diff --git a/resources/js/views/Workshops.vue b/resources/js/views/Workshops.vue
deleted file mode 100644
index 65772af..0000000
--- a/resources/js/views/Workshops.vue
+++ /dev/null
@@ -1,256 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ eventsError || "No workshops where found" }}
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/AnalyticsItem.vue b/resources/js/views/dashboard/AnalyticsItem.vue
deleted file mode 100644
index 48fbe70..0000000
--- a/resources/js/views/dashboard/AnalyticsItem.vue
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
- {{ sessionData.ip }}
- {{ sessionData.useragent }}
- {{ sessionData.created_at }}
- {{ sessionData.ended_at }}
-
-
{{ request.type }}
-
{{ request.path }}
-
{{ request.created_at }}
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/AnalyticsList.vue b/resources/js/views/dashboard/AnalyticsList.vue
deleted file mode 100644
index 112ea03..0000000
--- a/resources/js/views/dashboard/AnalyticsList.vue
+++ /dev/null
@@ -1,199 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "No sessions where found" }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/ArticleEdit.vue b/resources/js/views/dashboard/ArticleEdit.vue
deleted file mode 100644
index 9b0b935..0000000
--- a/resources/js/views/dashboard/ArticleEdit.vue
+++ /dev/null
@@ -1,345 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gallery
-
- {{ gallery.length }} image{{
- gallery.length != 1 ? "s" : ""
- }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/ArticleList.vue b/resources/js/views/dashboard/ArticleList.vue
deleted file mode 100644
index 6dfb633..0000000
--- a/resources/js/views/dashboard/ArticleList.vue
+++ /dev/null
@@ -1,290 +0,0 @@
-
-
-
-
-
-
-
Create Article
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "No articles where found" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/Dashboard.vue b/resources/js/views/dashboard/Dashboard.vue
deleted file mode 100644
index b14a1df..0000000
--- a/resources/js/views/dashboard/Dashboard.vue
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
-
-
-
-
- My Details
-
-
-
-
-
- Articles
-
-
-
-
-
- Users
-
-
-
-
-
- Events
-
-
-
-
-
- {{ courseBoxTitle }}
-
-
-
-
-
- Media
-
-
-
-
-
- Analytics
-
-
-
-
-
-
- Shortlinks
-
-
-
-
-
-
-
- Discord
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/DiscordBotLogs.vue b/resources/js/views/dashboard/DiscordBotLogs.vue
deleted file mode 100644
index f29c80d..0000000
--- a/resources/js/views/dashboard/DiscordBotLogs.vue
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
- {{
- logOutputContent
- }}
-
-
- {{
- logErrorContent
- }}
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/EventEdit.vue b/resources/js/views/dashboard/EventEdit.vue
deleted file mode 100644
index f77df1a..0000000
--- a/resources/js/views/dashboard/EventEdit.vue
+++ /dev/null
@@ -1,397 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Leave blank to hide from public. Also supports TBD and
- TBC.
- Leave blank to hide from public.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/EventList.vue b/resources/js/views/dashboard/EventList.vue
deleted file mode 100644
index ae805e8..0000000
--- a/resources/js/views/dashboard/EventList.vue
+++ /dev/null
@@ -1,405 +0,0 @@
-
-
-
-
-
-
-
Create Event
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "No events where found" }}
-
-
-
-
-
- {{
- formattedDate(item.start_at)
- }}
- {{ parseEventLocation(item) }}
-
- {{ toTitleCase(item.status) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/MediaEdit.vue b/resources/js/views/dashboard/MediaEdit.vue
deleted file mode 100644
index d1c0ab6..0000000
--- a/resources/js/views/dashboard/MediaEdit.vue
+++ /dev/null
@@ -1,576 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/MediaList.vue b/resources/js/views/dashboard/MediaList.vue
deleted file mode 100644
index 5301418..0000000
--- a/resources/js/views/dashboard/MediaList.vue
+++ /dev/null
@@ -1,484 +0,0 @@
-
-
-
-
-
-
-
Upload Media
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "No media where found" }}
-
-
-
-
-
-
-
-
-
- {{ bytesReadable(item.size) }}
-
-
-
-
-
- {{ item.title }}
- ({{ item.name }})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ computedSelectedCount }} selected
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/ShortlinkEdit.vue b/resources/js/views/dashboard/ShortlinkEdit.vue
deleted file mode 100644
index 65bbb6f..0000000
--- a/resources/js/views/dashboard/ShortlinkEdit.vue
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/ShortlinkList.vue b/resources/js/views/dashboard/ShortlinkList.vue
deleted file mode 100644
index 3d1b49d..0000000
--- a/resources/js/views/dashboard/ShortlinkList.vue
+++ /dev/null
@@ -1,295 +0,0 @@
-
-
-
-
-
-
-
Create Link
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "No shortlinks where found" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/UserEdit.vue b/resources/js/views/dashboard/UserEdit.vue
deleted file mode 100644
index 3013d9e..0000000
--- a/resources/js/views/dashboard/UserEdit.vue
+++ /dev/null
@@ -1,263 +0,0 @@
-
-
-
-
-
-
-
-
-
- This field is optional
- This field is optional
- This field is optional
-
- Permissions
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/dashboard/UserList.vue b/resources/js/views/dashboard/UserList.vue
deleted file mode 100644
index 103d715..0000000
--- a/resources/js/views/dashboard/UserList.vue
+++ /dev/null
@@ -1,247 +0,0 @@
-
-
-
-
-
-
-
Create User
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "No users where found" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/js/views/form.ts b/resources/js/views/form.ts
deleted file mode 100644
index a3985f2..0000000
--- a/resources/js/views/form.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { reactive } from "vue";
-import { Form, FormControl, FormObject } from "../helpers/form";
-
-export const form: FormObject = reactive(
- Form({
- password: FormControl("", Required()),
- }),
-);
diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php
new file mode 100644
index 0000000..65d41af
--- /dev/null
+++ b/resources/lang/en/validation.php
@@ -0,0 +1,44 @@
+ [
+ 'email_required' => 'An email address is required',
+ 'email_invalid' => 'The email address doesn\'t look right',
+ 'email_exists' => 'This email address already has an account',
+ 'email_not_exists' => 'This email address doesn\'t have an account',
+
+ 'token_invalid' => 'The login token is invalid',
+
+ 'firstname_required' => 'A first name is required',
+ 'surname_required' => 'A surname is required',
+ 'phone_required' => 'A phone number is required',
+
+ 'home_address_required' => 'A home address is required',
+ 'home_city_required' => 'A home city is required',
+ 'home_postcode_required' => 'A home postcode is required',
+ 'home_country_required' => 'A home country is required',
+ 'home_state_required' => 'A home state is required',
+
+ 'billing_address_required' => 'A billing address is required',
+ 'billing_city_required' => 'A billing city is required',
+ 'billing_postcode_required' => 'A billing postcode is required',
+ 'billing_country_required' => 'A billing country is required',
+ 'billing_state_required' => 'A billing state is required',
+
+ 'title_required' => 'A title is required',
+ 'content_required' => 'Item content is required',
+ 'hero_media_name_required' => 'A hero image is required',
+ 'hero_media_name_exists' => 'The hero image not longer exists',
+ 'starts_at_required' => 'A start date is required',
+ 'ends_at_required' => 'An end date is required',
+ 'ends_at_after' => 'The end date must be after the start date',
+ 'publish_at_required' => 'A publish date is required',
+ 'closes_at_required' => 'A closing date is required',
+ 'status_required' => 'A status is required',
+ 'registration_data_required_unless' => 'Registration information is required if registration is not none',
+
+ 'file_required' => 'A file is required',
+ 'file_file' => 'The file must be a file',
+ 'file_max' => 'The file is larger than the maximum size allowed of :max',
+ ],
+];
diff --git a/resources/views/account.blade.php b/resources/views/account.blade.php
new file mode 100644
index 0000000..4b6c675
--- /dev/null
+++ b/resources/views/account.blade.php
@@ -0,0 +1,99 @@
+@php
+$user = auth()->user();
+
+$billing_same_home = $user->home_address === $user->billing_address
+ && $user->home_address2 === $user->billing_address2
+ && $user->home_city === $user->billing_city
+ && $user->home_state === $user->billing_state
+ && $user->home_postcode === $user->billing_postcode
+ && $user->home_country === $user->billing_country;
+@endphp
+
+
+ Account Settings
+
+
+
+
diff --git a/resources/views/admin/location/edit.blade.php b/resources/views/admin/location/edit.blade.php
new file mode 100644
index 0000000..395532b
--- /dev/null
+++ b/resources/views/admin/location/edit.blade.php
@@ -0,0 +1,28 @@
+
+ {{ isset($location) ? 'Edit' : 'Create' }} Location
+
+
+
+
+
diff --git a/resources/views/admin/location/index.blade.php b/resources/views/admin/location/index.blade.php
new file mode 100644
index 0000000..ac084b5
--- /dev/null
+++ b/resources/views/admin/location/index.blade.php
@@ -0,0 +1,43 @@
+
+ Locations
+
+
+
+
+ Create Location
+
+
+
+
+
+
+ @if($locations->isEmpty())
+
+ @else
+
+
+ Name |
+ Address |
+ Action |
+
+
+ @foreach ($locations as $location)
+
+ | {{ $location->name }} |
+ {{ $location->address }} |
+
+
+ |
+
+ @endforeach
+
+
+
+ {{ $locations->links() }}
+ @endif
+
+
+
diff --git a/resources/views/admin/media/edit.blade.php b/resources/views/admin/media/edit.blade.php
new file mode 100644
index 0000000..38cf14c
--- /dev/null
+++ b/resources/views/admin/media/edit.blade.php
@@ -0,0 +1,34 @@
+
+ {{ isset($medium) ? 'Edit' : 'Create' }} Media
+
+
+
+
+
+
diff --git a/resources/views/admin/media/index.blade.php b/resources/views/admin/media/index.blade.php
new file mode 100644
index 0000000..1f503ce
--- /dev/null
+++ b/resources/views/admin/media/index.blade.php
@@ -0,0 +1,47 @@
+
+ Media
+
+
+
+
+ @if($media->isEmpty())
+
+ @else
+
+
+ Title |
+ Size |
+ Type |
+ Uploaded |
+ Action |
+
+
+ @foreach ($media as $medium)
+
+ | {{ $medium->title }} |
+ {{ \App\Helpers::bytesToString($medium->size) }} |
+ {{ $medium->mime_type }} |
+ {{ \Carbon\Carbon::parse($medium->created_at)->format('M j Y, g:i a') }} |
+
+
+ |
+
+ @endforeach
+
+
+
+ {{ $media->links() }}
+ @endif
+
+
+
diff --git a/resources/views/admin/post/edit.blade.php b/resources/views/admin/post/edit.blade.php
new file mode 100644
index 0000000..10e42af
--- /dev/null
+++ b/resources/views/admin/post/edit.blade.php
@@ -0,0 +1,74 @@
+
+ {{ isset($post) ? 'Edit' : 'Create' }} Post
+
+
+
+
+
+
+
diff --git a/resources/views/admin/post/index.blade.php b/resources/views/admin/post/index.blade.php
new file mode 100644
index 0000000..6625f41
--- /dev/null
+++ b/resources/views/admin/post/index.blade.php
@@ -0,0 +1,47 @@
+
+ Posts
+
+
+
+
+ Create Post
+
+
+
+
+
+
+ @if($posts->isEmpty())
+
+ @else
+
+
+ Title |
+ Created |
+ Status |
+ Author |
+ Action |
+
+
+ @foreach ($posts as $post)
+
+ | {{ $post->title }} |
+ {{ $post->created_at }} |
+ {{ ucwords($post->status) }} |
+ {{ $post->author->getName() }} |
+
+
+ |
+
+ @endforeach
+
+
+
+ {{ $posts->links() }}
+ @endif
+
+
+
diff --git a/resources/views/admin/user/create.blade.php b/resources/views/admin/user/create.blade.php
new file mode 100644
index 0000000..6c10c08
--- /dev/null
+++ b/resources/views/admin/user/create.blade.php
@@ -0,0 +1,73 @@
+
+ Create User
+
+
+
+
+
diff --git a/resources/views/admin/user/edit.blade.php b/resources/views/admin/user/edit.blade.php
new file mode 100644
index 0000000..10acadd
--- /dev/null
+++ b/resources/views/admin/user/edit.blade.php
@@ -0,0 +1,99 @@
+@php
+ $billing_same_home = $user->home_address === $user->billing_address
+ && $user->home_address2 === $user->billing_address2
+ && $user->home_city === $user->billing_city
+ && $user->home_state === $user->billing_state
+ && $user->home_postcode === $user->billing_postcode
+ && $user->home_country === $user->billing_country;
+@endphp
+
+
+ Edit User
+
+
+
+
+
diff --git a/resources/views/admin/user/index.blade.php b/resources/views/admin/user/index.blade.php
new file mode 100644
index 0000000..4d09ed9
--- /dev/null
+++ b/resources/views/admin/user/index.blade.php
@@ -0,0 +1,49 @@
+
+ Users
+
+
+
+
+ Create User
+
+
+
+
+
+
+ @if($users->isEmpty())
+
+ @else
+
+
+ First name |
+ Surname |
+ Email |
+ Actions |
+
+
+ @foreach ($users as $user)
+
+ | {{ $user->firstname }} |
+ {{ $user->surname }} |
+ {{ $user->email }} |
+
+
+ @if($user->id !== '1')
+
+ @endif
+ |
+
+ @endforeach
+
+
+
+ {{ $users->links() }}
+ @endif
+
+
+
diff --git a/resources/views/admin/workshop/edit.blade.php b/resources/views/admin/workshop/edit.blade.php
new file mode 100644
index 0000000..9ad3797
--- /dev/null
+++ b/resources/views/admin/workshop/edit.blade.php
@@ -0,0 +1,159 @@
+@php
+ $workshopContent = isset($workshop) ? $workshop->content : '';
+@endphp
+
+ {{ isset($workshop) ? 'Edit' : 'Create' }} Workshop
+
+
+
+
+
+
+
diff --git a/resources/views/admin/workshop/index.blade.php b/resources/views/admin/workshop/index.blade.php
new file mode 100644
index 0000000..41b80e5
--- /dev/null
+++ b/resources/views/admin/workshop/index.blade.php
@@ -0,0 +1,47 @@
+
+ Workshops
+
+
+
+
+ @if($workshops->isEmpty())
+
+ @else
+
+
+ Title |
+ Status |
+ Location |
+ Starts |
+ Action |
+
+
+ @foreach ($workshops as $workshop)
+
+ | {{ $workshop->title }} |
+ {{ ucwords($workshop->status) }} |
+ {{ $workshop->location->name }} |
+ {{ \Carbon\Carbon::parse($workshop->starts_at)->format('M j Y, g:i a') }} |
+
+
+ |
+
+ @endforeach
+
+
+
+ {{ $workshops->links() }}
+ @endif
+
+
+
diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php
deleted file mode 100644
index 040b862..0000000
--- a/resources/views/app.blade.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
- STEMMechanics
-
-
-
-
-
-
-
-
- @vite('resources/js/main.js')
-
-
diff --git a/resources/views/auth/login-link.blade.php b/resources/views/auth/login-link.blade.php
new file mode 100644
index 0000000..792fd06
--- /dev/null
+++ b/resources/views/auth/login-link.blade.php
@@ -0,0 +1,7 @@
+
+
+ Check your inbox
+ Click the link we sent to your email address to sign in.
+ Home
+
+
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php
new file mode 100644
index 0000000..9ba1df5
--- /dev/null
+++ b/resources/views/auth/login.blade.php
@@ -0,0 +1,20 @@
+
+
+ @if(session('status') == 'not-found')
+ Sorry, we didn't recognize that email
+
+ Would you like to sign in with a different email?
+
+ @else
+ Sign in with email
+
+ Enter the email address associated with your account, and we'll send a magic link to your inbox.
+
+ @endif
+
+
+ Don't have an account?
Register
+ Continue
+
+
+
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php
new file mode 100644
index 0000000..360af3a
--- /dev/null
+++ b/resources/views/auth/register.blade.php
@@ -0,0 +1,23 @@
+
+ @if (session('status') == 'sent')
+
+ Check your inbox
+ Click the link we sent to your email address to sign in.
+
+ Home
+
+
+ @else
+
+ Create a new account
+
+ Enter your email address and we'll create an account for you to use on our website.
+
+
+
+ Already have an account?
Log in
+ Register
+
+
+ @endif
+
diff --git a/resources/views/code-of-conduct.blade.php b/resources/views/code-of-conduct.blade.php
new file mode 100644
index 0000000..b0ef19e
--- /dev/null
+++ b/resources/views/code-of-conduct.blade.php
@@ -0,0 +1,44 @@
+
+ Code of Conduct
+
+ STEMMechanics supports the international community open to everyone without discrimination. We want this community to be a safe and welcoming place for both newcomers and current members. Everyone should feel comfortable and accepted regardless of their personal background and affiliation our projects and workshops.
+
+ Philosophy
+ In the STEMMechanics community, participants from all over the world come together to create and work on STEM projects. This is made possible by the support, hard work, and enthusiasm of people who collaborate towards the common goal of creating great ideas. Cooperation at such a scale requires common guidelines to ensure a positive and inspiring atmosphere in the community.
+ This is why we have this Code of Conduct: it explains the type of community we want to have. The rules below are not applied to all interactions with a simple matching algorithm. Human interactions happen in context and are complex. Perceived violations are evaluated by real humans who will try to interpret the interactions and the rules with kindness. Accordingly, there is no need to hypothesize on how these rules would affect normal interactions. Be reasonable, the Code of Conduct team surely will be as well.
+
+ Application
+ This Code of Conduct applies to all users, contributors and participants who engage with the STEMMechanics workshops, projects and its community platforms.
+
+ Expectations
+
+ - Politeness is expected at all times. Be kind and courteous.
+ - Always assume positive intent from others. Be aware that differences in culture and English proficiency make written communication more difficult than face-to-face communication and that your interpretation of messages may not be the one the author intended. Conversely, if someone asks you to rephrase something you said, be ready to do so without feeling judged.
+ - Feedback is always welcome but keep your criticism constructive. We encourage you to open discussions, proposals, issues, and bug reports. Use the community platforms to discuss improvements, not to vent out frustration. Similarly, when other users offer you feedback please accept it gracefully.
+
+
+ Restricted conduct
+ Participating in restricted conduct will lead to a warning from community moderators and/or the Code of Conduct team and may lead to exclusion from the community in the form of a ban from one or all platforms.
+
+ - STEMMechanics is committed to providing a friendly and safe environment for everyone, regardless of level of experience, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, ethnicity, language proficiency, age, political orientation, nationality, religion, or other similar characteristics. We do not tolerate harassment or discrimination of participants in any form.
+ - In particular, we strive to be welcoming to all and to ensure that anyone can take a more active role in the community and a project. Targeted harassment of minorities or individuals is unacceptable.
+ - Aggressive or offensive behavior is not acceptable.
+ - You will be excluded from participating in the community if you insult, demean, harass, intentionally make others uncomfortable by any means, or participate in any other hateful conduct, either publicly or privately.
+ - Likewise, any spamming, trolling, flaming, baiting, or other attention-stealing behavior is not welcome and will result in exclusion from the community.
+ - Any form of retaliation against a participant who contacts the Code of Conduct team is completely unacceptable, regardless of the outcome of the complaint. Any such behavior will result in exclusion from the community.
+ - For certainty, any conduct which could reasonably be considered inappropriate in a professional setting is not acceptable.
+
+
+ Reporting a breach
+ If you witness or are involved in an interaction with another community member that you think may violate this Code of Conduct, please contact STEMMechanics Code of Conduct team.
+ STEMMechanics recognizes that it can be difficult to come forward in cases of a violation of the Code of Conduct. To make it easier to report violations, we provide a single point of contact via email at: conduct@stemmechanics.com.au. If you are more comfortable reaching out to a single person, you are also welcome to contact one or more members of the team using their personal emails listed below, or via direct messaging on community platforms where they are present.
+
+ Code of Conduct team
+
+ - James Collins, james@stemmechanics.com.au
+
+ - GitHub / Discord / Reddit / Twitter: nomadjimbob
+
+
+
+
diff --git a/resources/views/components/container.blade.php b/resources/views/components/container.blade.php
new file mode 100644
index 0000000..b7b1b01
--- /dev/null
+++ b/resources/views/components/container.blade.php
@@ -0,0 +1,3 @@
+
diff --git a/resources/views/components/dialog.blade.php b/resources/views/components/dialog.blade.php
new file mode 100644
index 0000000..366913d
--- /dev/null
+++ b/resources/views/components/dialog.blade.php
@@ -0,0 +1,33 @@
+
+
+ @isset($title)
+
{{ $title }}
+ @endisset
+ @isset($header)
+
+ {{ $header }}
+
+ @endisset
+
+ @isset($formaction)
+
+ @else
+ {{ $slot }}
+
+ @isset($footer)
+
+ @endisset
+ @endisset
+
+
diff --git a/resources/views/components/footer.blade.php b/resources/views/components/footer.blade.php
new file mode 100644
index 0000000..ba9556e
--- /dev/null
+++ b/resources/views/components/footer.blade.php
@@ -0,0 +1,24 @@
+
diff --git a/resources/views/components/heading.blade.php b/resources/views/components/heading.blade.php
new file mode 100644
index 0000000..383962c
--- /dev/null
+++ b/resources/views/components/heading.blade.php
@@ -0,0 +1,16 @@
+@php
+$id = Str::slug($slot);
+$uri = url()->current() . '#' . $id;
+@endphp
+
+
+ {{ $slot }}
+ #
+
diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php
new file mode 100644
index 0000000..cfbb7ab
--- /dev/null
+++ b/resources/views/components/layout.blade.php
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+ {{ 'STEMMechanics' . (isset($title) ? ' - ' . $title : '') }}
+
+
+
+
+
+
+
+ @livewireStyles
+ @vite('resources/js/app.js')
+ @vite('resources/css/app.css')
+
+
+@if(env('APP_NOTICE'))
+ {{ env('APP_NOTICE') }}
+@endif
+
+{{ $slot }}
+
+@if (session('message'))
+
+@endif
+@livewireScripts
+
+
diff --git a/resources/views/components/mast.blade.php b/resources/views/components/mast.blade.php
new file mode 100644
index 0000000..55ca2d2
--- /dev/null
+++ b/resources/views/components/mast.blade.php
@@ -0,0 +1,6 @@
+
+ {{ $slot }}
+ @if(isset($backRoute) && isset($backTitle))
+ {{ $backTitle }}
+ @endif
+
diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php
new file mode 100644
index 0000000..9adcd9b
--- /dev/null
+++ b/resources/views/components/navbar.blade.php
@@ -0,0 +1,81 @@
+
diff --git a/resources/views/components/none-found.blade.php b/resources/views/components/none-found.blade.php
new file mode 100644
index 0000000..659ba66
--- /dev/null
+++ b/resources/views/components/none-found.blade.php
@@ -0,0 +1,20 @@
+@props(['item' => 'results', 'search', 'message', 'title'])
+
+@php
+if(!isset($message)) {
+ if(!isset($search) || $search == '')
+ $message = "We couldn't find any $item";
+ else
+ $message = "We couldn't find any $item matching \"$search\"";
+}
+
+if(!isset($title)) {
+ $title = "No results found";
+}
+@endphp
+
+
+
+
{{ $title }}
+
{{ $message }}
+
diff --git a/resources/views/components/noticebar.blade.php b/resources/views/components/noticebar.blade.php
new file mode 100644
index 0000000..bf189f4
--- /dev/null
+++ b/resources/views/components/noticebar.blade.php
@@ -0,0 +1,4 @@
+
+{{ $slot }}
+
+
diff --git a/resources/views/components/panel-post.blade.php b/resources/views/components/panel-post.blade.php
new file mode 100644
index 0000000..27c3aa4
--- /dev/null
+++ b/resources/views/components/panel-post.blade.php
@@ -0,0 +1,11 @@
+@props(['post'])
+
+
+
+
+
{{ $post->created_at->format('j M Y') }}
+
{{ $post->title }}
+
{{ Str::words(strip_tags($post->content), 20) }}
+
Read More
+
+
diff --git a/resources/views/components/panel-workshop.blade.php b/resources/views/components/panel-workshop.blade.php
new file mode 100644
index 0000000..dd2590b
--- /dev/null
+++ b/resources/views/components/panel-workshop.blade.php
@@ -0,0 +1,45 @@
+@props(['workshop'])
+
+@php
+ $statusClass = $workshop->status;
+ $statusTitle = $workshop->status;
+
+ if($workshop->status === 'scheduled') {
+ $statusClass = 'soon';
+ $statusTitle = 'Open soon';
+ }
+@endphp
+
+
+
+
{{ $workshop->starts_at->format('j') }}
+
{{ $workshop->starts_at->format('M') }}
+
+ {{ $statusTitle }}
+
+
+
{{ $workshop->title }}
+
+
+
+
{{ $workshop->starts_at->format('j/m/Y @ g:i a') }}
+
+
+
+
+
{{ $workshop->location->name }}
+
+ @if($workshop->ages)
+
+
+
+
{{ isset($workshop->ages) && $workshop->ages !== '' ? 'Ages ' . $workshop->ages : 'All ages' }}
+
+ @endif
+
+
+
+
{{ isset($workshop->price) && $workshop->price !== '' ? $workshop->price : 'Free' }}
+
+
+
diff --git a/resources/views/components/post.blade.php b/resources/views/components/post.blade.php
new file mode 100644
index 0000000..4effd54
--- /dev/null
+++ b/resources/views/components/post.blade.php
@@ -0,0 +1,6 @@
+
+
IMAGE
+
{{ $post->title }}
+
{{ $post->created }}
+
{{ $post->excerpt }}
+
diff --git a/resources/views/components/ui/button.blade.php b/resources/views/components/ui/button.blade.php
new file mode 100644
index 0000000..88a947b
--- /dev/null
+++ b/resources/views/components/ui/button.blade.php
@@ -0,0 +1,18 @@
+@props(['type' => 'link', 'class', 'href', 'target', 'color' => 'primary'])
+
+@php
+ $colorClasses = [
+ 'outline' => 'hover:bg-gray-500 focus-visible:outline-primary-color text-gray-800 border border-gray-400 bg-white hover:text-white',
+ 'primary' => 'hover:bg-primary-color-dark focus-visible:outline-primary-color bg-primary-color text-white',
+ 'primary-outline' => 'hover:bg-primary-color-dark focus-visible:outline-primary-color text-primary-color border border-primary-color bg-white hover:text-white',
+ 'danger' => 'hover:bg-danger-color-dark focus-visible:outline-danger-color bg-danger-color text-white',
+ 'success' => 'hover:bg-success-color-dark focus-visible:outline-success-color bg-success-color text-white'
+ ][$color];
+ $commonClasses = @twMerge(['whitespace-nowrap', 'text-center','justify-center','rounded-md','px-8','py-1.5','text-sm','font-semibold','leading-6','shadow-sm','focus-visible:outline','focus-visible:outline-2','focus-visible:outline-offset-2','transition'], ($class ?? ''));
+@endphp
+
+@if($type == 'submit' || $type == 'button')
+
+@elseif($type == 'link')
+ {{ $slot }}
+@endif
diff --git a/resources/views/components/ui/checkbox.blade.php b/resources/views/components/ui/checkbox.blade.php
new file mode 100644
index 0000000..de220f6
--- /dev/null
+++ b/resources/views/components/ui/checkbox.blade.php
@@ -0,0 +1,23 @@
+@props(['name', 'label', 'checked' => false])
+
+
+
+
diff --git a/resources/views/components/ui/editor.blade.php b/resources/views/components/ui/editor.blade.php
new file mode 100644
index 0000000..6834873
--- /dev/null
+++ b/resources/views/components/ui/editor.blade.php
@@ -0,0 +1,203 @@
+@props(['name', 'value' => '', 'info', 'label' => 'Content'])
+
+@php
+ $hasError = $errors->has($name);
+ $value = old($name, $value);
+@endphp
+
+
+
{{ $label }}
+
+@if(isset($info) && $info !== '')
+
{{ $info }}
+@endif
+@if ($hasError)
+
{{ $errors->first($name) }}
+@endif
+
+
+
diff --git a/resources/views/components/ui/file.blade.php b/resources/views/components/ui/file.blade.php
new file mode 100644
index 0000000..3ffa7f9
--- /dev/null
+++ b/resources/views/components/ui/file.blade.php
@@ -0,0 +1,78 @@
+@props(['type' => 'text', 'name', 'label' => 'File', 'info', 'value' => '', 'fileName' => '', 'fileSize' => '', 'fileType' => '', 'fileUrl' => '', 'readonly' => false])
+
+@php
+ $hasError = $errors->has($name);
+ $onchange = $attributes->get('onchange');
+ $readonly = filter_var($readonly, FILTER_VALIDATE_BOOLEAN);
+@endphp
+
+
+
{{ $label }}
+
+
+
![preview]()
+
{{ $fileName }}
+
{{ $fileSize != '' ? \App\Helpers::bytesToString($fileSize) : '' }}
+ @if (!$readonly)
+
+
Max upload size: {{ \App\Helpers::bytesToString(\App\Helpers::getMaxUploadSize()) }}
+ @endif
+ @if(isset($info) && $info !== '')
+
{{ $info }}
+ @endif
+ @if ($hasError)
+
{{ $errors->first($name) }}
+ @endif
+
+ @if (!$readonly)
+
+ @endif
+{{--
--}}
+
+
+
diff --git a/resources/views/components/ui/filelist.blade.php b/resources/views/components/ui/filelist.blade.php
new file mode 100644
index 0000000..e25a8c6
--- /dev/null
+++ b/resources/views/components/ui/filelist.blade.php
@@ -0,0 +1,71 @@
+@props(['type' => 'text', 'name' => '', 'label' => 'Files', 'info', 'value' => '', 'editor' => false])
+
+@php
+ $hasError = $errors->has($name);
+ $onchange = $attributes->get('onchange');
+ $value = old($name, $value);
+ $editor = filter_var($editor, FILTER_VALIDATE_BOOLEAN);
+@endphp
+
+@if($value !== '' || $editor === true)
+
+
{{ $label }}
+
+
+ -
+
+
+
+ @if($editor)
+
+ @endif
+
+
+
+
+
+ @if($editor)
+
+
Max upload size: {{ \App\Helpers::bytesToString(\App\Helpers::getMaxUploadSize()) }}
+
+ @endif
+ @if(isset($info) && $info !== '')
+
{{ $info }}
+ @endif
+
+
+
+@endif
diff --git a/resources/views/components/ui/gallery.blade.php b/resources/views/components/ui/gallery.blade.php
new file mode 100644
index 0000000..be422c6
--- /dev/null
+++ b/resources/views/components/ui/gallery.blade.php
@@ -0,0 +1,106 @@
+@props(['type' => 'text', 'name' => '', 'label' => 'Gallery', 'info', 'value' => '', 'editor' => false])
+
+@php
+ $hasError = $errors->has($name);
+ $onchange = $attributes->get('onchange');
+ $value = old($name, $value);
+ $editor = filter_var($editor, FILTER_VALIDATE_BOOLEAN);
+@endphp
+
+@if($value !== '' || $editor === true)
+
+ @if($editor === true)
+
{{ $label }}
+
+ @else
+
+
+
+
+
+ -
+
+
+
+
+
+ @endif
+
+
+ -
+
+ @if($editor)
+
+
+
+ @endif
+
+
+ @if($editor)
+ -
+
+
+ @endif
+
+
+ @if($editor)
+
+ @endif
+ @if(isset($info) && $info !== '')
+
{{ $info }}
+ @endif
+
+
+
+@endif
diff --git a/resources/views/components/ui/image-hero.blade.php b/resources/views/components/ui/image-hero.blade.php
new file mode 100644
index 0000000..a67e10a
--- /dev/null
+++ b/resources/views/components/ui/image-hero.blade.php
@@ -0,0 +1,6 @@
+@props(['image'])
+
+
+
+

+
diff --git a/resources/views/components/ui/input.blade.php b/resources/views/components/ui/input.blade.php
new file mode 100644
index 0000000..042fbc3
--- /dev/null
+++ b/resources/views/components/ui/input.blade.php
@@ -0,0 +1,47 @@
+@props(['type' => 'text', 'name', 'label' => '', 'value' => '', 'floating' => false, 'noLabel' => false, 'readonly' => false, 'info', 'error' => null, 'labelNotice' => null])
+
+@php
+ if($error === null) {
+ $error = $errors->first($name);
+ }
+
+ $hasError = $error !== '';
+ $classes = 'disabled:bg-gray-100 bg-white block px-2.5 pb-2.5 w-full text-sm text-gray-900 rounded-lg border appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 ' . ($hasError ? 'border-red-600 ring-red-600 focus:border-red-600 focus:ring-red-600' : 'border-gray-300 focus:border-indigo-300 focus:ring-indigo-300');
+ $value = old($name, $value);
+@endphp
+
+
+ @if($floating)
+
+ @if($type === 'textarea')
+
+ @else
+
+ @endif
+
+
+ @elseif($noLabel)
+
+ @if($type === 'textarea')
+
+ @else
+
+ @endif
+
+ @else
+
+
+ @if($type === 'textarea')
+
+ @else
+
+ @endif
+
+ @endif
+ @if(isset($info) && $info !== '')
+
{{ $info }}
+ @endif
+ @if ($hasError)
+
{{ $error }}
+ @endif
+
diff --git a/resources/views/components/ui/media.blade.php b/resources/views/components/ui/media.blade.php
new file mode 100644
index 0000000..91a0205
--- /dev/null
+++ b/resources/views/components/ui/media.blade.php
@@ -0,0 +1,56 @@
+@props(['type' => 'text', 'name', 'label' => 'File', 'value' => null, 'info', 'mime_type' => 'image/*', 'allow_multiple' => 'false', 'allow_uploads' => 'false'])
+
+@php
+ $hasError = $errors->has($name);
+@endphp
+
+
+
{{ $label }}
+
+
+
![preview]()
+
+
+
+
Max upload size: {{ \App\Helpers::bytesToString(\App\Helpers::getMaxUploadSize()) }}
+ @if(isset($info) && $info !== '')
+
{{ $info }}
+ @endif
+ @if ($hasError)
+
{{ $errors->first($name) }}
+ @endif
+
+
+
+
+
diff --git a/resources/views/components/ui/search.blade.php b/resources/views/components/ui/search.blade.php
new file mode 100644
index 0000000..3bd0275
--- /dev/null
+++ b/resources/views/components/ui/search.blade.php
@@ -0,0 +1,12 @@
+@props(['type' => 'text', 'name', 'label', 'value' => old($name)])
+
+@php
+ $classes = 'bg-white flex-grow px-2.5 py-2.5 text-sm text-gray-900 bg-transparent rounded-l-lg border border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer border-gray-300 focus:border-indigo-300 focus:ring-indigo-300';
+@endphp
+
+
diff --git a/resources/views/components/ui/select.blade.php b/resources/views/components/ui/select.blade.php
new file mode 100644
index 0000000..b693b22
--- /dev/null
+++ b/resources/views/components/ui/select.blade.php
@@ -0,0 +1,30 @@
+@props(['type' => 'text', 'name', 'label', 'value' => '', 'floating' => false, 'readonly' => false, 'info'])
+
+@php
+ $classes = 'disabled:bg-gray-100 bg-white block mt-1 px-2.5 pb-2.5 w-full text-sm text-gray-900 rounded-lg border appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 border-gray-300 focus:border-indigo-300 focus:ring-indigo-300';
+ $value = old($name, $value);
+@endphp
+
+
+ @if($floating)
+
+ @if($type === 'textarea')
+
+ @else
+
+ @endif
+
+
+ @else
+
+
+
+
+
+ @endif
+ @if(isset($info) && $info !== '')
+
{{ $info }}
+ @endif
+
diff --git a/resources/views/components/ui/table.blade.php b/resources/views/components/ui/table.blade.php
new file mode 100644
index 0000000..66c71fe
--- /dev/null
+++ b/resources/views/components/ui/table.blade.php
@@ -0,0 +1,58 @@
+
+
+
+ {{ $header }}
+
+
+
+ {{ $body }}
+
+
+
+
diff --git a/resources/views/contact.blade.php b/resources/views/contact.blade.php
new file mode 100644
index 0000000..f806c1f
--- /dev/null
+++ b/resources/views/contact.blade.php
@@ -0,0 +1,20 @@
+
+ Contact us
+
+ Questions & Support
+ If you have a question or would like help with a project, you can send it our way using the form on this page or be emailing hello@stemmechanics.com.au.
+ You can find us on various social media platforms, and if you join our Discord server, you'll have the opportunity to connect with our team, participants, and other individuals who share similar interests.
+
+ Wanting a workshop?
+ We provide both public and private workshops as well as run events on behalf of your organisation. If you would like to discuss a potential opportunity, send us an email at hello@stemmechanics.com.au.
+
+ Where are you located?
+ We do not have a physical address as our workshops are delivered across Queensland. Visit the workshops page for each specific location.
+ Official mail can be sent to the following postal address:
+ STEMMechanics
+ 1/4 Jordan Street
+ Edmonton, QLD, 4869
+ Australia
+ ABN: 15 772 281 735
+
+
diff --git a/resources/views/emails/change-email-link.blade.php b/resources/views/emails/change-email-link.blade.php
new file mode 100644
index 0000000..50c9c3d
--- /dev/null
+++ b/resources/views/emails/change-email-link.blade.php
@@ -0,0 +1,14 @@
+@component('mail::message', ['username' => $username, 'email' => $email])
+ Confirm your new email address
+ A request was made to change your email address at STEMMechanics to {{ $newEmail }}.
+ For your security, this link can only be used once and expires after 10 minutes.
+
+ @component('mail::button', ['url' => route('update.email', ['token' => $token])])
+ Update Email
+ @endcomponent
+
+
+ Why did I get this link?
+ Someone asked to change the email address associated with an account at STEMMechanics with this email.
+ If this wasn't you, you can ignore this email.
+@endcomponent
diff --git a/resources/views/emails/exception.blade.php b/resources/views/emails/exception.blade.php
deleted file mode 100644
index 70957b5..0000000
--- a/resources/views/emails/exception.blade.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
- {!! $content ?? '' !!}
-
-
\ No newline at end of file
diff --git a/resources/views/emails/login-link.blade.php b/resources/views/emails/login-link.blade.php
new file mode 100644
index 0000000..808d88e
--- /dev/null
+++ b/resources/views/emails/login-link.blade.php
@@ -0,0 +1,13 @@
+@component('mail::message', ['username' => $username, 'email' => $email])
+ Follow this link to log in to your account.
+ For your security, this link can only be used once and expires after 10 minutes.
+
+ @component('mail::button', ['url' => route('login', ['token' => $token])])
+ Log in
+ @endcomponent
+
+
+ Why did I get this link?
+ Someone asked for a login link to log in to STEMMechanics with this email.
+ If this wasn't you, you can ignore this email.
+@endcomponent
diff --git a/resources/views/emails/register-link.blade.php b/resources/views/emails/register-link.blade.php
new file mode 100644
index 0000000..02a1748
--- /dev/null
+++ b/resources/views/emails/register-link.blade.php
@@ -0,0 +1,13 @@
+@component('mail::message', ['username' => $username, 'email' => $email])
+ Follow this link to register your account.
+ For your security, this link can only be used once and expires after 10 minutes.
+
+ @component('mail::button', ['url' => route('login', ['token' => $token])])
+ Register
+ @endcomponent
+
+
+ Why did I get this link?
+ Someone asked to register an account at STEMMechanics with this email.
+ If this wasn't you, you can ignore this email.
+@endcomponent
diff --git a/resources/views/emails/user/change_email_verify.blade.php b/resources/views/emails/user/change_email_verify.blade.php
deleted file mode 100644
index e7d491b..0000000
--- a/resources/views/emails/user/change_email_verify.blade.php
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
- STEMMechanics - Forgot Password
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- Hey {{ $user?->display_name }}, |
-
-
- |
- We just need to confirm that this is your new email address. Click this link stemmechanics.com.au/verify-email and if you are asked, use the confirm code:
- |
-
-
- |
- {{ $code }}
- |
-
-
- |
- But if you didn't ask to reset your password, you can delete
- this email and your password will remain the same.
- |
-
-
- |
- Need help or got feedback?
- Contact us
- or touch base at
- @stemmechanics.
- |
-
-
-
- Sent by STEMMechanics ·
- Visit our Website
- ·
- @stemmechanics PO Box 36, Edmonton, QLD 4869, Australia
- |
-
-
-
-
diff --git a/resources/views/emails/user/change_email_verify_plain.blade.php b/resources/views/emails/user/change_email_verify_plain.blade.php
deleted file mode 100644
index 04d8feb..0000000
--- a/resources/views/emails/user/change_email_verify_plain.blade.php
+++ /dev/null
@@ -1,16 +0,0 @@
-Hey {{ $user?->display_name }},
-
-We just need to confirm that this is your new email address.
-
-Enter the following URL in your browser:
-
-https://www.stemmechanics.com.au/verify-email
-
-and when asked, use the confirm code: {{ $code }}
-
-Need help or got feedback? Contact us at https://www.stemmechanics.com.au/contact or touch base on twitter at @stemmechanics
-
---
-Sent by STEMMechanics
-https://www.stemmechanics.com.au/
-PO Box 36, Edmonton, QLD 4869, Australia
diff --git a/resources/views/emails/user/changed_email.blade.php b/resources/views/emails/user/changed_email.blade.php
deleted file mode 100644
index 45a6af3..0000000
--- a/resources/views/emails/user/changed_email.blade.php
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
-
- STEMMechanics - Forgot Password
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- Yo {{ $user?->display_name }} |
-
-
- |
- Just a quick word that your email has been changed to {{ $new_email }}.
- |
-
-
- |
- If this was not you, please contact us by replying to this email so we can disable your account.
- |
-
-
- |
- Need help or got feedback?
- Contact us
- or touch base at
- @stemmechanics.
- |
-
-
-
- Sent by STEMMechanics ·
- Visit our Website
- ·
- @stemmechanics PO Box 36, Edmonton, QLD 4869, Australia
- |
-
-
-
-
diff --git a/resources/views/emails/user/changed_email_plain.blade.php b/resources/views/emails/user/changed_email_plain.blade.php
deleted file mode 100644
index 611155f..0000000
--- a/resources/views/emails/user/changed_email_plain.blade.php
+++ /dev/null
@@ -1,12 +0,0 @@
-Yo {{ $user?->display_name }}
-
-Just a quick word that your email has been changed to {{ $new_email }}.
-
-If this was not you, please contact us by replying to this email so we can disable your account.
-
-Need help or got feedback? Contact us at https://www.stemmechanics.com.au/contact or touch base on twitter at @stemmechanics
-
---
-Sent by STEMMechanics
-https://www.stemmechanics.com.au/
-PO Box 36, Edmonton, QLD 4869, Australia
\ No newline at end of file
diff --git a/resources/views/emails/user/changed_password.blade.php b/resources/views/emails/user/changed_password.blade.php
deleted file mode 100644
index cf4b548..0000000
--- a/resources/views/emails/user/changed_password.blade.php
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
-
- STEMMechanics - Forgot Password
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- Yo {{ $user?->display_name }} |
-
-
- |
- Just a quick word that your password has been changed.
- |
-
-
- |
- If this was not you, please contact us by replying to this email so we can disable your account.
- |
-
-
- |
- Need help or got feedback?
- Contact us
- or touch base at
- @stemmechanics.
- |
-
-
-
- Sent by STEMMechanics ·
- Visit our Website
- ·
- @stemmechanics PO Box 36, Edmonton, QLD 4869, Australia
- |
-
-
-
-
diff --git a/resources/views/emails/user/changed_password_plain.blade.php b/resources/views/emails/user/changed_password_plain.blade.php
deleted file mode 100644
index 723515f..0000000
--- a/resources/views/emails/user/changed_password_plain.blade.php
+++ /dev/null
@@ -1,12 +0,0 @@
-Yo {{ $user?->display_name }}
-
-Just a quick word that your password has been changed.
-
-If this was not you, please contact us by replying to this email so we can disable your account.
-
-Need help or got feedback? Contact us at https://www.stemmechanics.com.au/contact or touch base on twitter at @stemmechanics
-
---
-Sent by STEMMechanics
-https://www.stemmechanics.com.au/
-PO Box 36, Edmonton, QLD 4869, Australia
\ No newline at end of file
diff --git a/resources/views/emails/user/contact.blade.php b/resources/views/emails/user/contact.blade.php
deleted file mode 100644
index b87a8d2..0000000
--- a/resources/views/emails/user/contact.blade.php
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
-
- STEMMechanics - Forgot Password
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- Hi STEMMechanics, |
-
-
- |
- {{ $content }}
- |
-
-
- |
- From: {{ $name }} - {{ $email }}
- |
-
-
- |
- Need help or got feedback?
- Contact us
- or touch base at
- @stemmechanics.
- |
-
-
-
- Sent by STEMMechanics ·
- Visit our Website
- ·
- @stemmechanics PO Box 36, Edmonton, QLD 4869, Australia
- |
-
-
-
-
diff --git a/resources/views/emails/user/contact_plain.blade.php b/resources/views/emails/user/contact_plain.blade.php
deleted file mode 100644
index f1236c9..0000000
--- a/resources/views/emails/user/contact_plain.blade.php
+++ /dev/null
@@ -1,8 +0,0 @@
-{{ $content }}
-
-From: {{ $name }} - {{ $email }}
-
---
-Sent by STEMMechanics
-https://www.stemmechanics.com.au/
-PO Box 36, Edmonton, QLD 4869, Australia
diff --git a/resources/views/emails/user/email_verify.blade.php b/resources/views/emails/user/email_verify.blade.php
deleted file mode 100644
index 933f3fb..0000000
--- a/resources/views/emails/user/email_verify.blade.php
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
-
- STEMMechanics - Forgot Password
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- Welcome {{ $user?->display_name }}, |
-
-
- |
- We've heard you would like to try out our workshops and courses!
- |
-
-
- |
- Before we can let you loose on our website, we need to make sure you are a real person and not a pesky robot or cat. Click this link stemmechanics.com.au/verify-email and if you are asked, use the confirm code:
- |
-
-
- |
- {{ $code }}
- |
-
-
- |
- But if you didn't ask to reset your password, you can delete
- this email and your password will remain the same.
- |
-
-
- |
- Need help or got feedback?
- Contact us
- or touch base at
- @stemmechanics.
- |
-
-
-
- Sent by STEMMechanics ·
- Visit our Website
- ·
- @stemmechanics PO Box 36, Edmonton, QLD 4869, Australia
- |
-
-
-
-
diff --git a/resources/views/emails/user/email_verify_plain.blade.php b/resources/views/emails/user/email_verify_plain.blade.php
deleted file mode 100644
index 6f279d3..0000000
--- a/resources/views/emails/user/email_verify_plain.blade.php
+++ /dev/null
@@ -1,17 +0,0 @@
-Welcome {{ $user?->display_name }},
-
-We've heard you would like to try out our workshops and courses!
-Before we can let you loose on our website, we need to make sure you are a real person and not a pesky robot or cat.
-
-Enter the following URL in your browser:
-
-https://www.stemmechanics.com.au/verify-email
-
-and when asked, use the confirm code: {{ $code }}
-
-Need help or got feedback? Contact us at https://www.stemmechanics.com.au/contact or touch base on twitter at @stemmechanics
-
---
-Sent by STEMMechanics
-https://www.stemmechanics.com.au/
-PO Box 36, Edmonton, QLD 4869, Australia
diff --git a/resources/views/emails/user/forgot_password.blade.php b/resources/views/emails/user/forgot_password.blade.php
deleted file mode 100644
index c98950f..0000000
--- a/resources/views/emails/user/forgot_password.blade.php
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
-
-
-
- STEMMechanics - Forgot Password
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- Yo {{ $user?->display_name }} |
-
-
- |
- We all forget things sometimes! But you can reset your
- password by clicking the link
- Reset Password
- and entering the following code:
- |
-
-
- |
- {{ $code }}
- |
-
-
- |
- But if you didn't ask to reset your password, you can delete
- this email and your password will remain the same.
- |
-
-
- |
- Need help or got feedback?
- Contact us
- or touch base at
- @stemmechanics.
- |
-
-
-
- Sent by STEMMechanics ·
- Visit our Website
- ·
- @stemmechanics PO Box 36, Edmonton, QLD 4869, Australia
- |
-
-
-
-
diff --git a/resources/views/emails/user/forgot_password_plain.blade.php b/resources/views/emails/user/forgot_password_plain.blade.php
deleted file mode 100644
index bd95a01..0000000
--- a/resources/views/emails/user/forgot_password_plain.blade.php
+++ /dev/null
@@ -1,14 +0,0 @@
-Yo {{ $user?->display_name }}
-
-We all forget things sometimes! But you can reset your password typing the following into your browser https://www.stemmechanics.com.au/reset-password and entering the following code:
-
-{{ $code }}
-
-But if you didn't ask to reset your password, you can delete this email and we will keep your current password.
-
-Need help or got feedback? Contact us at https://www.stemmechanics.com.au/contact or touch base on twitter at @stemmechanics
-
---
-Sent by STEMMechanics
-https://www.stemmechanics.com.au/
-PO Box 36, Edmonton, QLD 4869, Australia
\ No newline at end of file
diff --git a/resources/views/errors/403.blade.php b/resources/views/errors/403.blade.php
new file mode 100644
index 0000000..f036930
--- /dev/null
+++ b/resources/views/errors/403.blade.php
@@ -0,0 +1,11 @@
+
+
+
+
 }})
+
+
+
403
+
You are not permitted to view this page
+
+
+
diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php
new file mode 100644
index 0000000..ae273ac
--- /dev/null
+++ b/resources/views/errors/404.blade.php
@@ -0,0 +1,11 @@
+
+
+
+
 }})
+
+
+
404
+
That page was not found around here
+
+
+
diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php
new file mode 100644
index 0000000..a4cedc7
--- /dev/null
+++ b/resources/views/home.blade.php
@@ -0,0 +1,79 @@
+
+ Home
+
+
+ Join the fun!
+ To keep up with our ever-changing world, it's important to encourage and support a new generation of curious minds who love science, engineering, art, and leadership.
+ Our fun and exciting workshops can unlock countless opportunities for new ideas and improvements, giving kids the skills and tools they need to solve any problem that comes their way.
+ Steady Hand Game in Ravenshoe
+
+
+
+
+ Latest Posts
+ @if($posts->isEmpty())
+
+ @else
+
+ @foreach($posts as $index => $post)
+
+ @endforeach
+
+ @endif
+
+
+
+
+
+
+
Build skills while having a great time
+
To keep up with our ever-changing world, it's important to encourage and support a new generation of curious minds who love science, engineering, art, and leadership.
+
Explore Workshops
+
+
+
+
+
+ Upcoming workshops
+ @if($workshops->isEmpty())
+
+ @else
+
+ @foreach($workshops as $index => $workshop)
+
+ @endforeach
+
+ @endif
+
+
+
+
+ Play Minecraft with us
+ We invite you to join us on our Minecraft server where you can participate in weekly challenges and mini-games.
+
+

+
We also run workshops on our minecraft server, both online and offline, where you ca learn to make it rain rabbits, or grow flowers wherever you walk!
+
+
+

+
+
+
+
+
+
+
+
And the support doesn't stop!
+
Though the workshop has come to a close, we remain available to assist you via email and Discord with any projects you undertake at home. We are always happy to help.
+
+ Join Discord
+ Contact Us
+
+
+
+
+
diff --git a/resources/views/post/index.blade.php b/resources/views/post/index.blade.php
new file mode 100644
index 0000000..30f39ae
--- /dev/null
+++ b/resources/views/post/index.blade.php
@@ -0,0 +1,26 @@
+
+ Blog
+ Blog
+
+
+
+
+
+ @if($posts->isEmpty())
+
+
+
+ @else
+
+ @foreach ($posts as $post)
+
+ @endforeach
+
+
+ {{ $posts->appends(request()->query())->links() }}
+
+ @endif
+
+
diff --git a/resources/views/post/show.blade.php b/resources/views/post/show.blade.php
new file mode 100644
index 0000000..a06ff3d
--- /dev/null
+++ b/resources/views/post/show.blade.php
@@ -0,0 +1,15 @@
+
+
+
+ {{ $post->title }}
+
+
{{ $post->created_at->format('F j, Y') }}
+ @if(auth()->user()?->admin)
+
Edit Article
+ @endif
+
+ {!! $post->content !!}
+
+
+
+
diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/vendor/mail/html/button.blade.php
new file mode 100644
index 0000000..1889ee2
--- /dev/null
+++ b/resources/views/vendor/mail/html/button.blade.php
@@ -0,0 +1,6 @@
+@props([
+ 'url',
+ 'color' => 'primary',
+ 'align' => 'center',
+])
+{{ $slot }}
diff --git a/resources/views/vendor/mail/html/footer.blade.php b/resources/views/vendor/mail/html/footer.blade.php
new file mode 100644
index 0000000..3ff41f8
--- /dev/null
+++ b/resources/views/vendor/mail/html/footer.blade.php
@@ -0,0 +1,11 @@
+
+|
+
+ |
+
diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php
new file mode 100644
index 0000000..c59aaf9
--- /dev/null
+++ b/resources/views/vendor/mail/html/header.blade.php
@@ -0,0 +1,14 @@
+@props(['url', 'username'])
+
+
+
diff --git a/resources/views/vendor/mail/html/layout.blade.php b/resources/views/vendor/mail/html/layout.blade.php
new file mode 100644
index 0000000..e55f6a6
--- /dev/null
+++ b/resources/views/vendor/mail/html/layout.blade.php
@@ -0,0 +1,57 @@
+
+
+
+{{ config('app.name') }}
+
+
+
+
+
+
+
+
+
+
+
+
+{{ $header ?? '' }}
+
+
+
+
+
+
+
+|
+{{ Illuminate\Mail\Markdown::parse($slot) }}
+
+{{ $subcopy ?? '' }}
+ |
+
+
+ |
+
+
+{{ $footer ?? '' }}
+
+ |
+
+
+
+
diff --git a/resources/views/vendor/mail/html/message.blade.php b/resources/views/vendor/mail/html/message.blade.php
new file mode 100644
index 0000000..57a7628
--- /dev/null
+++ b/resources/views/vendor/mail/html/message.blade.php
@@ -0,0 +1,29 @@
+
+{{-- Header --}}
+
+
+
+
+{{-- Body --}}
+{{ Illuminate\Mail\Markdown::parse($slot) }}
+
+{{-- Subcopy --}}
+@isset($subcopy)
+
+
+{{ $subcopy }}
+
+
+@endisset
+
+{{-- Footer --}}
+
+
+This email was sent to {{ $email }}
+{{ config('app.name') }} | 1/4 Jordan Street | Edmonton, QLD 4869 Australia
+© {{ date('Y') }} {{ config('app.name') }}. {{ __('All rights reserved.') }}
+Privacy Policy
+
+
+
+
diff --git a/resources/views/vendor/mail/html/panel.blade.php b/resources/views/vendor/mail/html/panel.blade.php
new file mode 100644
index 0000000..2975a60
--- /dev/null
+++ b/resources/views/vendor/mail/html/panel.blade.php
@@ -0,0 +1,14 @@
+
+
+
+
+
+|
+{{ Illuminate\Mail\Markdown::parse($slot) }}
+ |
+
+
+ |
+
+
+
diff --git a/resources/views/vendor/mail/html/subcopy.blade.php b/resources/views/vendor/mail/html/subcopy.blade.php
new file mode 100644
index 0000000..790ce6c
--- /dev/null
+++ b/resources/views/vendor/mail/html/subcopy.blade.php
@@ -0,0 +1,7 @@
+
+
+|
+{{ Illuminate\Mail\Markdown::parse($slot) }}
+ |
+
+
diff --git a/resources/views/vendor/mail/html/table.blade.php b/resources/views/vendor/mail/html/table.blade.php
new file mode 100644
index 0000000..a5f3348
--- /dev/null
+++ b/resources/views/vendor/mail/html/table.blade.php
@@ -0,0 +1,3 @@
+
+{{ Illuminate\Mail\Markdown::parse($slot) }}
+
diff --git a/resources/views/vendor/mail/html/themes/default.css b/resources/views/vendor/mail/html/themes/default.css
new file mode 100644
index 0000000..9265ab6
--- /dev/null
+++ b/resources/views/vendor/mail/html/themes/default.css
@@ -0,0 +1,308 @@
+/* Base */
+
+body,
+body *:not(html):not(style):not(br):not(tr):not(code) {
+ box-sizing: border-box;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
+ position: relative;
+}
+
+body {
+ -webkit-text-size-adjust: none;
+ background-color: #ffffff;
+ color: #718096;
+ height: 100%;
+ line-height: 1.4;
+ margin: 0;
+ padding: 0;
+ width: 100% !important;
+}
+
+p,
+ul,
+ol,
+blockquote {
+ line-height: 1.4;
+ text-align: left;
+}
+
+a {
+ color: #3869d4;
+}
+
+a img {
+ border: none;
+}
+
+/* Typography */
+
+h1 {
+ color: #3d4852;
+ font-size: 24px;
+ font-weight: bold;
+ margin-top: 14px;
+ text-align: center;
+}
+
+h2 {
+ font-size: 16px;
+ font-weight: bold;
+ margin-top: 0;
+ text-align: left;
+}
+
+h3 {
+ font-size: 14px;
+ font-weight: bold;
+ margin-top: 0;
+ text-align: left;
+}
+
+p {
+ font-size: 16px;
+ line-height: 1.5em;
+ margin-top: 0;
+ text-align: left;
+}
+
+p.sub {
+ font-size: 12px;
+}
+
+img {
+ max-width: 100%;
+}
+
+hr {
+ border-width: 1px 0 0 0;
+ border-style: solid;
+ border-color: #DDD;
+ margin-top: 24px;
+ margin-bottom: 24px;
+}
+
+/* Layout */
+
+.wrapper {
+ -premailer-cellpadding: 0;
+ -premailer-cellspacing: 0;
+ -premailer-width: 100%;
+ background-color: #edf2f7;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+.content {
+ -premailer-cellpadding: 0;
+ -premailer-cellspacing: 0;
+ -premailer-width: 100%;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+.center {
+ text-align: center;
+}
+
+.narrow {
+ padding-left: 32px;
+ padding-right: 32px;
+}
+
+/* Header */
+
+.header {
+ padding: 25px 0;
+ text-align: center;
+}
+
+.header a {
+ color: #3d4852;
+ font-size: 19px;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+/* Logo */
+
+.logo {
+ height: 75px;
+ max-height: 75px;
+ width: 75px;
+}
+
+/* Body */
+
+.body {
+ -premailer-cellpadding: 0;
+ -premailer-cellspacing: 0;
+ -premailer-width: 100%;
+ background-color: #edf2f7;
+ border-bottom: 1px solid #edf2f7;
+ border-top: 1px solid #edf2f7;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+.inner-body {
+ -premailer-cellpadding: 0;
+ -premailer-cellspacing: 0;
+ -premailer-width: 570px;
+ background-color: #ffffff;
+ border-color: #e8e5ef;
+ border-radius: 2px;
+ border-width: 1px;
+ box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015);
+ margin: 0 auto;
+ padding: 0;
+ width: 570px;
+}
+
+/* Subcopy */
+
+.subcopy {
+ border-top: 1px solid #e8e5ef;
+ margin-top: 25px;
+ padding-top: 25px;
+}
+
+.subcopy p {
+ font-size: 14px;
+}
+
+/* Footer */
+
+.footer {
+ -premailer-cellpadding: 0;
+ -premailer-cellspacing: 0;
+ -premailer-width: 570px;
+ margin: 0 auto;
+ padding: 0;
+ text-align: center;
+ width: 570px;
+}
+
+.footer p {
+ color: #807a92;
+ font-size: 12px;
+ text-align: center;
+ line-height: 20px;
+}
+
+.footer a {
+ color: #0284C7;
+ text-decoration: underline;
+}
+
+/* Tables */
+
+.table table {
+ -premailer-cellpadding: 0;
+ -premailer-cellspacing: 0;
+ -premailer-width: 100%;
+ margin: 30px auto;
+ width: 100%;
+}
+
+.table th {
+ border-bottom: 1px solid #edeff2;
+ margin: 0;
+ padding-bottom: 8px;
+}
+
+.table td {
+ color: #74787e;
+ font-size: 15px;
+ line-height: 18px;
+ margin: 0;
+ padding: 10px 0;
+}
+
+.content-cell {
+ max-width: 100vw;
+ padding: 32px;
+}
+
+/* Buttons */
+
+.action {
+ -premailer-cellpadding: 0;
+ -premailer-cellspacing: 0;
+ -premailer-width: 100%;
+ margin: 30px auto;
+ padding: 0;
+ text-align: center;
+ width: 100%;
+}
+
+.button {
+ -webkit-text-size-adjust: none;
+ border-radius: 4px;
+ color: #fff;
+ display: inline-block;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+.button-blue,
+.button-primary {
+ background-color: #2d3748;
+ border-bottom: 8px solid #2d3748;
+ border-left: 18px solid #2d3748;
+ border-right: 18px solid #2d3748;
+ border-top: 8px solid #2d3748;
+}
+
+.button-green,
+.button-success {
+ background-color: #48bb78;
+ border-bottom: 8px solid #48bb78;
+ border-left: 18px solid #48bb78;
+ border-right: 18px solid #48bb78;
+ border-top: 8px solid #48bb78;
+}
+
+.button-red,
+.button-error {
+ background-color: #e53e3e;
+ border-bottom: 8px solid #e53e3e;
+ border-left: 18px solid #e53e3e;
+ border-right: 18px solid #e53e3e;
+ border-top: 8px solid #e53e3e;
+}
+
+/* Panels */
+
+.panel {
+ border-left: #2d3748 solid 4px;
+ margin: 21px 0;
+}
+
+.panel-content {
+ background-color: #edf2f7;
+ color: #718096;
+ padding: 16px;
+}
+
+.panel-content p {
+ color: #718096;
+}
+
+.panel-item {
+ padding: 0;
+}
+
+.panel-item p:last-of-type {
+ margin-bottom: 0;
+ padding-bottom: 0;
+}
+
+/* Utilities */
+
+.break-all {
+ word-break: break-all;
+}
diff --git a/resources/views/vendor/mail/text/button.blade.php b/resources/views/vendor/mail/text/button.blade.php
new file mode 100644
index 0000000..97444eb
--- /dev/null
+++ b/resources/views/vendor/mail/text/button.blade.php
@@ -0,0 +1 @@
+{{ $slot }}: {{ $url }}
diff --git a/resources/views/vendor/mail/text/footer.blade.php b/resources/views/vendor/mail/text/footer.blade.php
new file mode 100644
index 0000000..3338f62
--- /dev/null
+++ b/resources/views/vendor/mail/text/footer.blade.php
@@ -0,0 +1 @@
+{{ $slot }}
diff --git a/resources/views/vendor/mail/text/header.blade.php b/resources/views/vendor/mail/text/header.blade.php
new file mode 100644
index 0000000..97444eb
--- /dev/null
+++ b/resources/views/vendor/mail/text/header.blade.php
@@ -0,0 +1 @@
+{{ $slot }}: {{ $url }}
diff --git a/resources/views/vendor/mail/text/layout.blade.php b/resources/views/vendor/mail/text/layout.blade.php
new file mode 100644
index 0000000..ec58e83
--- /dev/null
+++ b/resources/views/vendor/mail/text/layout.blade.php
@@ -0,0 +1,9 @@
+{!! strip_tags($header ?? '') !!}
+
+{!! strip_tags($slot) !!}
+@isset($subcopy)
+
+{!! strip_tags($subcopy) !!}
+@endisset
+
+{!! strip_tags($footer ?? '') !!}
diff --git a/resources/views/vendor/mail/text/message.blade.php b/resources/views/vendor/mail/text/message.blade.php
new file mode 100644
index 0000000..80bce21
--- /dev/null
+++ b/resources/views/vendor/mail/text/message.blade.php
@@ -0,0 +1,27 @@
+
+ {{-- Header --}}
+
+
+ {{ config('app.name') }}
+
+
+
+ {{-- Body --}}
+ {{ $slot }}
+
+ {{-- Subcopy --}}
+ @isset($subcopy)
+
+
+ {{ $subcopy }}
+
+
+ @endisset
+
+ {{-- Footer --}}
+
+
+ © {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.')
+
+
+
diff --git a/resources/views/vendor/mail/text/panel.blade.php b/resources/views/vendor/mail/text/panel.blade.php
new file mode 100644
index 0000000..3338f62
--- /dev/null
+++ b/resources/views/vendor/mail/text/panel.blade.php
@@ -0,0 +1 @@
+{{ $slot }}
diff --git a/resources/views/vendor/mail/text/subcopy.blade.php b/resources/views/vendor/mail/text/subcopy.blade.php
new file mode 100644
index 0000000..3338f62
--- /dev/null
+++ b/resources/views/vendor/mail/text/subcopy.blade.php
@@ -0,0 +1 @@
+{{ $slot }}
diff --git a/resources/views/vendor/mail/text/table.blade.php b/resources/views/vendor/mail/text/table.blade.php
new file mode 100644
index 0000000..3338f62
--- /dev/null
+++ b/resources/views/vendor/mail/text/table.blade.php
@@ -0,0 +1 @@
+{{ $slot }}
diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php
new file mode 100644
index 0000000..63c6f56
--- /dev/null
+++ b/resources/views/vendor/pagination/bootstrap-4.blade.php
@@ -0,0 +1,46 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/bootstrap-5.blade.php b/resources/views/vendor/pagination/bootstrap-5.blade.php
new file mode 100644
index 0000000..a1795a4
--- /dev/null
+++ b/resources/views/vendor/pagination/bootstrap-5.blade.php
@@ -0,0 +1,88 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/default.blade.php
new file mode 100644
index 0000000..0db70b5
--- /dev/null
+++ b/resources/views/vendor/pagination/default.blade.php
@@ -0,0 +1,46 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/semantic-ui.blade.php b/resources/views/vendor/pagination/semantic-ui.blade.php
new file mode 100644
index 0000000..ef0dbb1
--- /dev/null
+++ b/resources/views/vendor/pagination/semantic-ui.blade.php
@@ -0,0 +1,36 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php
new file mode 100644
index 0000000..4bb4917
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php
@@ -0,0 +1,27 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-bootstrap-5.blade.php b/resources/views/vendor/pagination/simple-bootstrap-5.blade.php
new file mode 100644
index 0000000..a89005e
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-bootstrap-5.blade.php
@@ -0,0 +1,29 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-default.blade.php
new file mode 100644
index 0000000..36bdbc1
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-default.blade.php
@@ -0,0 +1,19 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-tailwind.blade.php b/resources/views/vendor/pagination/simple-tailwind.blade.php
new file mode 100644
index 0000000..ea02400
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-tailwind.blade.php
@@ -0,0 +1,25 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/tailwind.blade.php b/resources/views/vendor/pagination/tailwind.blade.php
new file mode 100644
index 0000000..f177e97
--- /dev/null
+++ b/resources/views/vendor/pagination/tailwind.blade.php
@@ -0,0 +1,106 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/workshop/index.blade.php b/resources/views/workshop/index.blade.php
new file mode 100644
index 0000000..d2549ac
--- /dev/null
+++ b/resources/views/workshop/index.blade.php
@@ -0,0 +1,30 @@
+
+ Workshops
+ Workshops
+
+
+
+
+
+
+ @if($workshops->isEmpty())
+
+
+
+ @else
+
+ @foreach ($workshops as $workshop)
+
+ @endforeach
+
+
+ {{ $workshops->appends(request()->query())->links() }}
+
+ @endif
+
+
diff --git a/resources/views/workshop/show.blade.php b/resources/views/workshop/show.blade.php
new file mode 100644
index 0000000..2131b08
--- /dev/null
+++ b/resources/views/workshop/show.blade.php
@@ -0,0 +1,59 @@
+
+
+
+
+
+
{!! $workshop->title !!}
+
{!! $workshop->content !!}
+
+
+
+ @if($workshop->status === 'closed')
+
Registration for this event has closed.
+ @elseif($workshop->status === 'full')
+
This workshop is currently full.
+ @elseif($workshop->status === 'scheduled')
+
Registration for this workshop will open soon.
+ @elseif($workshop->status === 'cancelled')
+
This workshop has been cancelled.
+ @elseif($workshop->registration === 'none')
+
Registration not required for this event. Arrive early to avoid disappointment as seating maybe limited.
+ @elseif($workshop->registration === 'link')
+
Register for Event
+ @elseif($workshop->registration === 'email')
+
+ @elseif($workshop->registration === 'message')
+
{{ $workshop->registration_data }}
+ @endif
+ @if(auth()->user()?->admin)
+
Edit Workshop
+ @endif
+
Date/Time
+
{!! implode('
', \App\Helpers::createTimeDurationStr($workshop->starts_at, $workshop->ends_at)) !!}
+
Location
+
+
{{ isset($workshop->ages) && $workshop->ages !== '' ? 'Ages ' . $workshop->ages : 'All ages' }}
+ @if(\App\Helpers::isUnderAge($workshop->ages))
+
Parental supervision may be required for children 8 years of age and under.
+ @endif
+
{{ isset($workshop->price) && $workshop->price !== '' ? $workshop->price : 'Free' }}
+
+
+
+
diff --git a/routes/api.php b/routes/api.php
deleted file mode 100644
index 0446adb..0000000
--- a/routes/api.php
+++ /dev/null
@@ -1,74 +0,0 @@
-name('login');
-Route::post('/register', [UserController::class, 'register']);
-
-Route::get('/analytics', [AnalyticsController::class, 'index']);
-Route::get('/analytics/{session}', [AnalyticsController::class, 'show']);
-Route::post('/analytics', [AnalyticsController::class, 'store']);
-
-Route::apiResource('users', UserController::class);
-Route::post('/users/forgotPassword', [UserController::class, 'forgotPassword']);
-Route::post('/users/resetPassword', [UserController::class, 'resetPassword']);
-Route::post('/users/resendVerifyEmailCode', [UserController::class, 'resendVerifyEmailCode']);
-Route::post('/users/verifyEmail', [UserController::class, 'verifyEmail']);
-Route::get('/users/{user}/events', [UserController::class, 'eventList']);
-
-Route::get('media/jobs', [MediaJobController::class, 'index']);
-Route::get('media/jobs/{mediaJob}', [MediaJobController::class, 'show']);
-Route::apiResource('media', MediaController::class);
-Route::get('media/{media}/download', [MediaController::class, 'download']);
-
-Route::apiResource('articles', ArticleController::class);
-// Route::apiAddendumResource('attachments', 'articles', ArticleController::class);
-
-Route::apiResource('events', EventController::class);
-Route::apiAddendumResource('attachments', 'events', EventController::class);
-
-Route::get('/events/{event}/users', [EventController::class, 'userList']);
-Route::post('/events/{event}/users', [EventController::class, 'userAdd']);
-Route::match(['put', 'patch'], '/events/{event}/users', [EventController::class, 'userUpdate']);
-Route::delete('/events/{event}/users/{user}', [EventController::class, 'userDelete']);
-
-Route::post('/contact', [ContactController::class, 'send']);
-
-Route::apiResource('/shortlinks', ShortlinkController::class);
-
-Route::get('/logs/{name}', [LogController::class, 'show']);
-Route::get('/ocr', [OCRController::class, 'show']);
-
-Route::middleware('auth:sanctum')->group(function () {
- Route::post('/logout', [AuthController::class, 'logout']);
- Route::get('/me', [AuthController::class, 'me']);
-});
-
-Route::any('{any}', function () {
- return response()->json(['message' => 'Resource not found'], 404);
-})->where('any', '.*');
diff --git a/routes/channels.php b/routes/channels.php
deleted file mode 100644
index 5d451e1..0000000
--- a/routes/channels.php
+++ /dev/null
@@ -1,18 +0,0 @@
-id === (int) $id;
-});
diff --git a/routes/console.php b/routes/console.php
index e05f4c9..0a1db7f 100644
--- a/routes/console.php
+++ b/routes/console.php
@@ -1,19 +1,38 @@
comment(Inspiring::quote());
-})->purpose('Display an inspiring quote');
+ // Clean up expired tokens
+ DB::table('login_tokens')
+ ->where('created_at', '<', now()->subMinutes(10))
+ ->delete();
+
+ // Clean up expired change email requests
+ DB::table('email_updates')
+ ->where('created_at', '<', now()->subMinutes(10))
+ ->delete();
+
+ // Published scheduled posts
+ DB::table('posts')
+ ->where('status', '!=', 'scheduled')
+ ->where('published_at', '<', now())
+ ->update(['status' => 'published']);
+
+ // Open scheduled workshops
+ DB::table('workshops')
+ ->where('status', 'scheduled')
+ ->where('publish_at', '<', now())
+ ->update(['status' => 'open']);
+
+ // Close workshops
+ DB::table('workshops')
+ ->whereIn('status', ['open', 'full'])
+ ->where('closes_at', '<', now())
+ ->update(['status' => 'closed']);
+
+})->purpose('Clean up expired data')->everyMinute();
diff --git a/routes/web.php b/routes/web.php
index b9aedb5..0fb5a25 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,18 +1,80 @@
name('index');
-Route::get('/{any}', function () {
- return view('app');
-})->where('any', '.*');
+Route::get('posts', [PostController::class, 'index'])->name('post.index');
+Route::get('posts/{post}', [PostController::class, 'show'])->name('post.show');
+Route::get('workshops', [WorkshopController::class, 'index'])->name('workshop.index');
+Route::get('workshops/{workshop}', [WorkshopController::class, 'show'])->name('workshop.show');
+
+Route::middleware('auth')->group(function () {
+ Route::get('/account', [AccountController::class, 'show'])->name('account.show');
+ Route::post('/account', [AccountController::class, 'update'])->name('account.update');
+ Route::delete('/account', [AccountController::class, 'destroy'])->name('account.destroy');
+});
+
+Route::get('/login', [AuthController::class, 'showLogin'])->name('login');
+Route::post('/login', [AuthController::class, 'postLogin'])->name('login.store');
+Route::get('/logout', [AuthController::class, 'logout'])->name('logout');
+Route::get('/register', [AuthController::class, 'showRegister'])->name('register');
+Route::post('/register', [AuthController::class, 'postRegister'])->name('register.store');
+Route::get('/update-email', [AuthController::class, 'updateEmail'])->name('update.email');
+
+Route::get('/contact', function () {
+ return view('contact');
+})->name('contact');
+
+Route::get('/code-of-conduct', function () {
+ return view('code-of-conduct');
+})->name('code-of-conduct');
+
+Route::get('/media', [MediaController::class, 'index'])->name('media.index');
+Route::get('/media/{media}', [MediaController::class, 'show'])->name('media.show');
+Route::get('/media/download/{media}', [MediaController::class, 'download'])->name('media.download');
+
+Route::middleware('admin')->group(function () {
+ Route::get('/admin/media', [MediaController::class, 'admin_index'])->name('admin.media.index');
+ Route::get('/admin/media/create', [MediaController::class, 'admin_create'])->name('admin.media.create');
+ Route::post('/admin/media', [MediaController::class, 'admin_store'])->name('admin.media.store');
+ Route::get('/admin/media/{media}', [MediaController::class, 'admin_edit'])->name('admin.media.edit');
+ Route::put('/admin/media/{media}', [MediaController::class, 'admin_update'])->name('admin.media.update');
+ Route::delete('/admin/media/{media}', [MediaController::class, 'admin_destroy'])->name('admin.media.destroy');
+ Route::get('/admin/locations', [LocationController::class, 'index'])->name('admin.location.index');
+ Route::get('/admin/locations/create', [LocationController::class, 'create'])->name('admin.location.create');
+ Route::post('/admin/locations', [LocationController::class, 'store'])->name('admin.location.store');
+ Route::get('/admin/locations/{location}', [LocationController::class, 'edit'])->name('admin.location.edit');
+ Route::put('/admin/locations/{location}', [LocationController::class, 'update'])->name('admin.location.update');
+ Route::delete('/admin/locations/{location}', [LocationController::class, 'destroy'])->name('admin.location.destroy');
+
+ Route::get('/admin/posts', [PostController::class, 'admin_index'])->name('admin.post.index');
+ Route::get('/admin/posts/create', [PostController::class, 'admin_create'])->name('admin.post.create');
+ Route::post('/admin/posts', [PostController::class, 'admin_store'])->name('admin.post.store');
+ Route::get('/admin/posts/{post}', [PostController::class, 'admin_edit'])->name('admin.post.edit');
+ Route::put('/admin/posts/{post}', [PostController::class, 'admin_update'])->name('admin.post.update');
+ Route::delete('/admin/posts/{post}', [PostController::class, 'admin_destroy'])->name('admin.post.destroy');
+
+ Route::get('/admin/users', [UserController::class, 'index'])->name('admin.user.index');
+ Route::get('/admin/users/create', [UserController::class, 'create'])->name('admin.user.create');
+ Route::post('/admin/users', [UserController::class, 'store'])->name('admin.user.store');
+ Route::get('/admin/users/{user}', [UserController::class, 'edit'])->name('admin.user.edit');
+ Route::put('/admin/users/{user}', [UserController::class, 'update'])->name('admin.user.update');
+ Route::delete('/admin/users/{user}', [UserController::class, 'destroy'])->name('admin.user.destroy');
+
+ Route::get('/admin/workshops', [WorkshopController::class, 'admin_index'])->name('admin.workshop.index');
+ Route::get('/admin/workshops/create', [WorkshopController::class, 'admin_create'])->name('admin.workshop.create');
+ Route::post('/admin/workshops', [WorkshopController::class, 'admin_store'])->name('admin.workshop.store');
+ Route::get('/admin/workshops/{workshop}', [WorkshopController::class, 'admin_edit'])->name('admin.workshop.edit');
+ Route::put('/admin/workshops/{workshop}', [WorkshopController::class, 'admin_update'])->name('admin.workshop.update');
+ Route::delete('/admin/workshops/{workshop}', [WorkshopController::class, 'admin_destroy'])->name('admin.workshop.destroy');
+
+});
diff --git a/scripts/keras.py b/scripts/keras.py
deleted file mode 100644
index bebd26c..0000000
--- a/scripts/keras.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import sys
-import urllib.parse
-import numpy as np
-import keras_ocr
-
-if len(sys.argv) > 1:
- url = urllib.parse.unquote(sys.argv[1])
- image = keras_ocr.tools.read(url)
- pipeline = keras_ocr.pipeline.Pipeline()
- prediction = pipeline.recognize([image])
- print("----------START----------")
- for text, box in prediction [0]:
- print(text)
diff --git a/tailwind.config.js b/tailwind.config.js
new file mode 100644
index 0000000..982c6d4
--- /dev/null
+++ b/tailwind.config.js
@@ -0,0 +1,30 @@
+/** @type {import('tailwindcss').Config} */
+export default {
+ content: [
+ "./resources/**/*.blade.php",
+ "./resources/**/*.js",
+ './vendor/**/*.blade.php',
+ ],
+ theme: {
+ extend: {
+ boxShadow: {
+ 'deep': '0 10px 15px rgba(0, 0, 0, 0.5)',
+ },
+ colors: {
+ 'primary-color': '#0284C7', // sky-600
+ 'primary-color-dark': '#0370A1', // sky-500
+ 'primary-color-light': '#0EA5E9', // sky-400
+
+ 'danger-color': '#b91c1c', // red-600
+ 'danger-color-dark': '#991b1b', // red-500
+ 'danger-color-light': '#dc2626', // red-400
+
+ 'success-color': '#16a34a', // green-600
+ 'success-color-dark': '#22c55e', // green-500
+ 'success-color-light': '#4ade80', // green-400
+ },
+ },
+ },
+ plugins: [],
+}
+
diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php
deleted file mode 100644
index c6b6d48..0000000
--- a/tests/CreatesApplication.php
+++ /dev/null
@@ -1,23 +0,0 @@
-make(Kernel::class)->bootstrap();
-
- return $app;
- }
-}
diff --git a/tests/Feature/ArticlesApiTest.php b/tests/Feature/ArticlesApiTest.php
deleted file mode 100644
index 37d1332..0000000
--- a/tests/Feature/ArticlesApiTest.php
+++ /dev/null
@@ -1,162 +0,0 @@
-faker = FakerFactory::create();
- }
-
- /**
- * Tests that any user can view an article if it's published and not in the future.
- *
- * @return void
- */
- public function testAnyUserCanViewArticle(): void
- {
- // Create an event
- $article = Article::factory()->create([
- 'publish_at' => $this->faker->dateTimeBetween('-2 months', '-1 month'),
- ]);
-
- // Create a future event
- $futureArticle = Article::factory()->create([
- 'publish_at' => $this->faker->dateTimeBetween('+1 month', '+2 months'),
- ]);
-
- // Send GET request to the /api/articles endpoint
- $response = $this->getJson('/api/articles');
- $response->assertStatus(200);
-
- // Assert that the event is in the response data
- $response->assertJsonCount(1, 'articles');
- $response->assertJsonFragment([
- 'id' => $article->id,
- 'title' => $article->title,
- 'content' => $article->content,
- ]);
-
- $response->assertJsonMissing([
- 'id' => $futureArticle->id,
- 'title' => $futureArticle->title,
- 'content' => $futureArticle->content,
- ]);
- }
-
- /**
- * Tests that an admin can create, update, and delete articles.
- *
- * @return void
- */
- public function testAdminCanCreateUpdateDeleteArticle(): void
- {
- // Create a user with the admin/events permission
- $adminUser = User::factory()->create();
- $adminUser->givePermission('admin/articles');
-
- // Create media data
- $media = Media::factory()->create(['user_id' => $adminUser->id]);
-
- // Create event data
- $articleData = Article::factory()->make([
- 'user_id' => $adminUser->id,
- 'hero' => $media->id,
- ])->toArray();
-
- // Test creating event
- $response = $this->actingAs($adminUser)->postJson('/api/articles', $articleData);
- $response->assertStatus(201);
- $this->assertDatabaseHas('articles', [
- 'title' => $articleData['title'],
- 'content' => $articleData['content'],
- ]);
-
- // Test viewing event
- $article = Article::where('title', $articleData['title'])->first();
- $response = $this->get("/api/articles/$article->id");
- $response->assertStatus(200);
- $response->assertJsonStructure([
- 'article' => [
- 'id',
- 'title',
- 'content',
- ]
- ]);
-
- // Test updating event
- $articleData['title'] = 'Updated Article';
- $response = $this->actingAs($adminUser)->putJson("/api/articles/$article->id", $articleData);
- $response->assertStatus(200);
- $this->assertDatabaseHas('articles', [
- 'title' => 'Updated Article',
- ]);
-
- // Test deleting event
- $response = $this->actingAs($adminUser)->delete("/api/articles/$article->id");
- $response->assertStatus(204);
- $this->assertDatabaseMissing('articles', [
- 'title' => 'Updated Article',
- ]);
- }
-
- /**
- * Tests that a non-admin user cannot create, update, or delete articles.
- *
- * @return void
- */
- public function testNonAdminCannotCreateUpdateDeleteArticle(): void
- {
- // Create a user without admin/events permission
- $user = User::factory()->create();
-
- // Authenticate as the user
- $this->actingAs($user);
-
- // Try to create a new article
- $media = Media::factory()->create(['user_id' => $user->id]);
-
- $newArticleData = Article::factory()->make(['user_id' => $user->id, 'hero' => $media->id])->toArray();
-
- $response = $this->postJson('/api/articles', $newArticleData);
- $response->assertStatus(403);
-
- // Try to update an event
- $article = Article::factory()->create();
- $updatedArticleData = [
- 'title' => 'Updated Event',
- 'content' => 'This is an updated event.',
- // Add more fields as needed
- ];
- $response = $this->putJson('/api/articles/' . $article->id, $updatedArticleData);
- $response->assertStatus(403);
-
- // Try to delete an event
- $article = Article::factory()->create();
- $response = $this->deleteJson('/api/articles/' . $article->id);
- $response->assertStatus(403);
- }
-}
diff --git a/tests/Feature/AuthApiTest.php b/tests/Feature/AuthApiTest.php
deleted file mode 100644
index 012b95f..0000000
--- a/tests/Feature/AuthApiTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-create([
- 'password' => bcrypt('password'),
- ]);
-
- // Test successful login
- $response = $this->postJson('/api/login', [
- 'email' => $user->email,
- 'password' => 'password',
- ]);
- $response->assertStatus(200);
- $response->assertJsonStructure([
- 'token',
- ]);
- $token = $response->json('token');
-
- // Test getting authenticated user
- $response = $this->withHeaders([
- 'Authorization' => "Bearer $token",
- ])->get('/api/me');
- $response->assertStatus(200);
- $response->assertJson([
- 'user' => [
- 'id' => $user->id,
- 'email' => $user->email,
- ]
- ]);
-
- // Test logout
- $response = $this->withHeaders([
- 'Authorization' => "Bearer $token",
- ])->postJson('/api/logout');
- $response->assertStatus(204);
-
- // Test failed login
- $response = $this->postJson('/api/login', [
- 'email' => $user->email,
- 'password' => 'wrongpassword',
- ]);
- $response->assertStatus(422);
- }
-}
diff --git a/tests/Feature/ContactFormTest.php b/tests/Feature/ContactFormTest.php
deleted file mode 100644
index fc212e7..0000000
--- a/tests/Feature/ContactFormTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
- 'John Doe',
- 'email' => 'johndoe@example.com',
- 'content' => 'Hello, this is a test message.',
- ];
-
- $response = $this->postJson('/api/contact', $formData);
- $response->assertStatus(201);
-
- $formData = [
- 'name' => 'John Doe',
- 'content' => 'Hello, this is a test message.',
- ];
-
- $response = $this->postJson('/api/contact', $formData);
- $response->assertStatus(422);
- }
-}
diff --git a/tests/Feature/EventsApiTest.php b/tests/Feature/EventsApiTest.php
deleted file mode 100644
index 36d7b2f..0000000
--- a/tests/Feature/EventsApiTest.php
+++ /dev/null
@@ -1,204 +0,0 @@
-faker = FakerFactory::create();
- }
-
- /**
- * Tests that any user can view an event if it's published and not in the future.
- *
- * @return void
- */
- public function testAnyUserCanViewEvent(): void
- {
- // Create an event
- $event = Event::factory()->create([
- 'publish_at' => Carbon::parse($this->faker->dateTimeBetween('-2 months', '-1 month')),
- 'status' => 'open',
- ]);
-
- // Create a future event
- $futureEvent = Event::factory()->create([
- 'publish_at' => Carbon::parse($this->faker->dateTimeBetween('+1 day', '+1 month')),
- 'status' => 'open',
- ]);
-
- // Send GET request to the /api/events endpoint
- $response = $this->getJson('/api/events');
- $response->assertStatus(200);
-
- // Assert that the event is in the response data
- $response->assertJsonCount(1, 'events');
- $response->assertJsonFragment([
- 'id' => $event->id,
- 'title' => $event->title,
- ]);
-
- $response->assertJsonMissing([
- 'id' => $futureEvent->id,
- 'title' => $futureEvent->title,
- ]);
- }
-
- /**
- * Tests that any user cannot see draft events.
- *
- * @return void
- */
- public function testAnyUserCannotSeeDraftEvent(): void
- {
- // Create a draft event
- $draftEvent = Event::factory()->create([
- 'publish_at' => Carbon::parse($this->faker->dateTimeBetween('-2 months', '-1 month')),
- 'status' => 'draft',
- ]);
-
- // Create a open event
- $openEvent = Event::factory()->create([
- 'publish_at' => Carbon::parse($this->faker->dateTimeBetween('-2 months', '-1 month')),
- 'status' => 'open',
- ]);
-
- // Create a closed event
- $closedEvent = Event::factory()->create([
- 'publish_at' => Carbon::parse($this->faker->dateTimeBetween('-2 months', '-1 month')),
- 'status' => 'closed',
- ]);
-
- // Send GET request to the /api/events endpoint
- $response = $this->getJson('/api/events');
- $response->assertStatus(200);
-
- // Assert that the event is in the response data
- $response->assertJsonCount(2, 'events');
-
- $response->assertJsonMissing([
- 'id' => $draftEvent->id,
- 'title' => $draftEvent->title,
- ]);
- }
-
- /**
- * Tests that an admin can create, update, and delete events.
- *
- * @return void
- */
- public function testAdminCanCreateUpdateDeleteEvent(): void
- {
- // Create a user with the admin/events permission
- $adminUser = User::factory()->create();
- $adminUser->givePermission('admin/events');
-
- // Create media data
- $media = Media::factory()->create(['user_id' => $adminUser->id]);
-
- // Create event data
- $eventData = Event::factory()->make([
- 'start_at' => now()->addDays(7),
- 'end_at' => now()->addDays(7)->addHours(2),
- 'hero' => $media->id,
- ])->toArray();
-
- // Test creating event
- $response = $this->actingAs($adminUser)->postJson('/api/events', $eventData);
- $response->assertStatus(201);
- $this->assertDatabaseHas('events', [
- 'title' => $eventData['title'],
- 'content' => $eventData['content'],
- ]);
-
- // Test viewing event
- $event = Event::where('title', $eventData['title'])->first();
- $response = $this->get("/api/events/$event->id");
- $response->assertStatus(200);
- $response->assertJsonStructure([
- 'event' => [
- 'id',
- 'title',
- 'content',
- 'start_at',
- 'end_at',
- ]
- ]);
-
- // Test updating event
- $eventData['title'] = 'Updated Event';
- $response = $this->actingAs($adminUser)->putJson("/api/events/$event->id", $eventData);
- $response->assertStatus(200);
- $this->assertDatabaseHas('events', [
- 'title' => 'Updated Event',
- ]);
-
- // Test deleting event
- $response = $this->actingAs($adminUser)->delete("/api/events/$event->id");
- $response->assertStatus(204);
- $this->assertDatabaseMissing('events', [
- 'title' => 'Updated Event',
- ]);
- }
-
- /**
- * Tests that a non-admin user cannot create, update, or delete events.
- *
- * @return void
- */
- public function testNonAdminCannotCreateUpdateDeleteEvent(): void
- {
- // Create a user without admin/events permission
- $user = User::factory()->create();
-
- // Authenticate as the user
- $this->actingAs($user);
-
- // Try to create a new event
- $media = Media::factory()->create(['user_id' => $user->id]);
-
- $newEventData = Event::factory()->make(['hero' => $media->id])->toArray();
-
- $response = $this->postJson('/api/events', $newEventData);
- $response->assertStatus(403);
-
- // Try to update an event
- $event = Event::factory()->create();
- $updatedEventData = [
- 'title' => 'Updated Event',
- 'content' => 'This is an updated event.',
- // Add more fields as needed
- ];
- $response = $this->putJson('/api/events/' . $event->id, $updatedEventData);
- $response->assertStatus(403);
-
- // Try to delete an event
- $event = Event::factory()->create();
- $response = $this->deleteJson('/api/events/' . $event->id);
- $response->assertStatus(403);
- }
-}
diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php
new file mode 100644
index 0000000..8364a84
--- /dev/null
+++ b/tests/Feature/ExampleTest.php
@@ -0,0 +1,19 @@
+get('/');
+
+ $response->assertStatus(200);
+ }
+}
diff --git a/tests/Feature/UsersApiTest.php b/tests/Feature/UsersApiTest.php
deleted file mode 100644
index 2974143..0000000
--- a/tests/Feature/UsersApiTest.php
+++ /dev/null
@@ -1,263 +0,0 @@
-create();
- $nonAdminUser->revokePermission('admin/users');
-
- // create an admin user
- $adminUser = User::factory()->create();
- $adminUser->givePermission('admin/users');
-
- // ensure the non-admin user can access the endpoint and see basic user info only
- $response = $this->actingAs($nonAdminUser)->get('/api/users');
- $response->assertStatus(200);
- $response->assertJsonStructure([
- 'users' => [
- '*' => [
- 'id',
- 'display_name'
- ]
- ],
- 'total'
- ]);
-
- $response->assertJsonMissing([
- 'users' => [
- '*' => [
- 'email',
- 'password'
- ]
- ],
- ]);
-
- // ensure the admin user can access the endpoint and see additional user info
- $response = $this->actingAs($adminUser)->get('/api/users');
- $response->assertStatus(200);
- $response->assertJsonStructure([
- 'users' => [
- '*' => [
- 'id',
- 'email'
- ]
- ],
- 'total'
- ]);
- $response->assertJsonMissing([
- 'users' => [
- '*' => [
- 'password'
- ]
- ]
- ]);
- $response->assertJsonFragment([
- 'id' => $nonAdminUser->id,
- 'email' => $nonAdminUser->email
- ]);
- }
-
- /**
- * Tests that guests cannot create a user via the API.
- *
- * @return void
- */
- public function testGuestCannotCreateUser(): void
- {
- $userData = [
- 'email' => 'johndoe@example.com',
- 'password' => 'password',
- ];
-
- $response = $this->postJson('/api/users', $userData);
- $response->assertStatus(401);
- $this->assertDatabaseMissing('users', [
- 'email' => $userData['email'],
- ]);
- }
-
- /**
- * Tests that guests can register a user via the API.
- *
- * @return void
- */
- public function testGuestCanRegisterUser(): void
- {
- $userData = [
- 'first_name' => 'John',
- 'last_name' => 'Doe',
- 'display_name' => 'jackdoe',
- 'email' => 'johndoe@example.com',
- 'password' => 'password',
- ];
-
- $response = $this->postJson('/api/register', $userData);
- $response->assertStatus(200);
- $this->assertDatabaseHas('users', [
- 'email' => $userData['email'],
- ]);
- }
-
- /**
- * Tests that duplicate email or display name entries cannot be created.
- *
- * @return void
- */
- public function testCannotCreateDuplicateEmailOrDisplayName(): void
- {
- $userData = [
- 'display_name' => 'JackDoe',
- 'first_name' => 'Jack',
- 'last_name' => 'Doe',
- 'email' => 'jackdoe@example.com',
- 'password' => 'password',
- ];
-
- // Test creating user
- $response = $this->postJson('/api/register', $userData);
- $response->assertStatus(200);
- $this->assertDatabaseHas('users', [
- 'email' => 'jackdoe@example.com',
- ]);
-
- // Test creating duplicate user
- $response = $this->postJson('/api/register', $userData);
- $response->assertStatus(422);
- $response->assertJsonValidationErrors(['display_name', 'email']);
- }
-
- /**
- * Tests that a user can only update their own user info.
- *
- * @return void
- */
- public function testUserCanOnlyUpdateOwnUser(): void
- {
- $user = User::factory()->create();
-
- $userData = [
- 'email' => 'raffi@example.com',
- 'password' => 'password',
- ];
-
- // Test updating own user
- $response = $this->actingAs($user)->putJson('/api/users/' . $user->id, $userData);
- $response->assertStatus(200);
- $this->assertDatabaseHas('users', [
- 'id' => $user->id,
- 'email' => 'raffi@example.com',
- ]);
-
- // Test updating another user
- $otherUser = User::factory()->create();
- $otherUserData = [
- 'email' => 'otherraffi@example.com',
- 'password' => 'password',
- ];
-
- $response = $this->actingAs($user)->putJson('/api/users/' . $otherUser->id, $otherUserData);
- $response->assertStatus(403);
- }
-
- /**
- * Tests that a user cannot delete users via the API.
- *
- * @return void
- */
- public function testUserCannotDeleteUsers(): void
- {
- $user = User::factory()->create();
-
- // Test deleting own user
- $response = $this->actingAs($user)->deleteJson('/api/users/' . $user->id);
- $response->assertStatus(403);
- $this->assertDatabaseHas('users', ['id' => $user->id]);
-
- // Test deleting another user
- $otherUser = User::factory()->create();
- $response = $this->actingAs($user)->deleteJson('/api/users/' . $otherUser->id);
- $response->assertStatus(403);
- $this->assertDatabaseHas('users', ['id' => $otherUser->id]);
- }
-
- /**
- * Tests that an admin can update any user's info.
- *
- * @return void
- */
- public function testAdminCanUpdateAnyUser(): void
- {
- $admin = User::factory()->create();
- $admin->givePermission('admin/users');
-
- $user = User::factory()->create();
-
- $userData = [
- 'email' => 'todddoe@example.com',
- 'password' => 'password',
- ];
-
- // Test updating own user
- $response = $this->actingAs($admin)->putJson('/api/users/' . $user->id, $userData);
- $response->assertStatus(200);
- $this->assertDatabaseHas('users', [
- 'id' => $user->id,
- 'email' => 'todddoe@example.com'
- ]);
-
- // Test updating another user
- $otherUser = User::factory()->create();
- $otherUserData = [
- 'email' => 'kimdoe@example.com',
- 'password' => 'password',
- ];
-
- $response = $this->actingAs($admin)->putJson('/api/users/' . $otherUser->id, $otherUserData);
- $response->assertStatus(200);
- $this->assertDatabaseHas('users', [
- 'id' => $otherUser->id,
- 'email' => 'kimdoe@example.com',
- ]);
- }
-
- /**
- * Tests that an admin can delete any user via the API.
- *
- * @return void
- */
- public function testAdminCanDeleteAnyUser(): void
- {
- $admin = User::factory()->create();
- $admin->givePermission('admin/users');
-
- $user = User::factory()->create();
-
- // Test deleting own user
- $response = $this->actingAs($admin)->deleteJson('/api/users/' . $user->id);
- $response->assertStatus(204);
- $this->assertDatabaseMissing('users', ['id' => $user->id]);
-
- // Test deleting another user
- $otherUser = User::factory()->create();
- $response = $this->actingAs($admin)->deleteJson('/api/users/' . $otherUser->id);
- $response->assertStatus(204);
- $this->assertDatabaseMissing('users', ['id' => $otherUser->id]);
- }
-}
diff --git a/tests/TestCase.php b/tests/TestCase.php
index c6f92c9..fe1ffc2 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -6,18 +6,5 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
- use CreatesApplication;
-
-
- /**
- * {@inheritDoc}
- *
- * @return void
- */
- protected function setUp(): void
- {
- parent::setUp();
-
- $this->withoutVite();
- }
+ //
}
diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php
index 500fbfe..5773b0c 100644
--- a/tests/Unit/ExampleTest.php
+++ b/tests/Unit/ExampleTest.php
@@ -4,12 +4,10 @@ namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
-final class ExampleTest extends TestCase
+class ExampleTest extends TestCase
{
/**
* A basic test example.
- *
- * @return void
*/
public function test_that_true_is_true(): void
{
diff --git a/tsconfig.json b/tsconfig.json
deleted file mode 100644
index b48fd4e..0000000
--- a/tsconfig.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "compilerOptions": {
- "target": "esnext",
- "module": "esnext",
- // "strict": true,
- "moduleResolution": "node",
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true
- },
- "include": ["resources/**/*"],
- "exclude": ["node_modules", "dist"]
-}
diff --git a/vite.config.js b/vite.config.js
new file mode 100644
index 0000000..421b569
--- /dev/null
+++ b/vite.config.js
@@ -0,0 +1,11 @@
+import { defineConfig } from 'vite';
+import laravel from 'laravel-vite-plugin';
+
+export default defineConfig({
+ plugins: [
+ laravel({
+ input: ['resources/css/app.css', 'resources/js/app.js'],
+ refresh: true,
+ }),
+ ],
+});
diff --git a/vite.config.ts b/vite.config.ts
deleted file mode 100644
index 6de0114..0000000
--- a/vite.config.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import vue from "@vitejs/plugin-vue";
-import laravel from "laravel-vite-plugin";
-import analyzer from "rollup-plugin-analyzer";
-import { compression } from "vite-plugin-compression2";
-import { defineConfig } from "vite";
-import Unocss from "unocss/vite";
-
-export default defineConfig({
- plugins: [
- vue({
- template: {
- compilerOptions: {
- isCustomElement: (tag) => ["ion-icon"].includes(tag),
- },
- transformAssetUrls: {
- base: null,
- includeAbsolute: false,
- },
- },
- }),
- Unocss({}),
- laravel({
- input: ["resources/css/app.scss", "resources/js/main.js"],
- refresh: true,
- }),
- analyzer({ summaryOnly: true }),
- compression({
- include: [/\.(js)$/, /\.(css)$/],
- // deleteOriginalAssets: true,
- }),
- ],
- css: {
- preprocessorOptions: {
- scss: {
- // additionalData: `@import "./resources/css/variables.scss";`,
- },
- },
- },
- envPrefix: ["VITE_", "APP_URL"],
- resolve: {
- alias: {
- vue: "vue/dist/vue.esm-bundler.js",
- },
- },
- build: {
- chunkSizeWarningLimit: 500,
- rollupOptions: {
- output: {},
- },
- },
- base: "",
-});