Merge branch 'laravel-upgrade-10' into 3.10

This commit is contained in:
Fatih Alp 2024-06-29 23:10:55 +03:00 committed by GitHub
commit 78bbd2d09c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 85 additions and 127 deletions

View File

@ -1,23 +0,0 @@
<?php namespace App\Listeners;
use Anomaly\SettingsModule\Setting\Form\SettingFormRepository;
use Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved;
use Illuminate\Support\Facades\Artisan;
class EnableMaintenanceMode
{
public function handle(FormWasSaved $event)
{
$builder = $event->getBuilder();
if (get_class($builder->getRepository()) === SettingFormRepository::class) {
if ($builder->getFormValues()->has('maintenance')) {
if ($builder->getFormValues()->get('maintenance')) {
Artisan::call('down');
} elseif (config('streams::maintenance.enabled')) {
Artisan::call('up');
}
}
}
}
}

View File

@ -16,6 +16,14 @@ class BroadcastServiceProvider extends ServiceProvider
{
Broadcast::routes();
require base_path('routes/channels.php');
/*
* Authenticate the user's personal channel...
*/
Broadcast::channel(
'App.User.*',
function ($user, $userId) {
return (int)$user->id === (int)$userId;
}
);
}
}

View File

@ -26,7 +26,9 @@
"anomaly/default_page_handler-extension": "2.2.x-dev",
"anomaly/user_security_check-extension": "2.2.x-dev",
"anomaly/xml_feed_widget-extension": "2.2.x-dev",
"anomaly/private_storage_adapter-extension": "1.2.x-dev",
"anomaly/url_link_type-extension": "2.2.x-dev",
"anomaly/relationship-field_type": "2.3.x-dev",
"anomaly/colorpicker-field_type": "2.4.x-dev",
@ -107,7 +109,8 @@
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
"symfony/dom-crawler": "3.1.*",
"anomaly/installer-module": "2.4.x-dev"
},
"repositories": [
{
@ -154,7 +157,8 @@
"preferred-install": "dist",
"optimize-autoloader": true,
"allow-plugins": {
"visiosoft/composer-merge-plugin": true
"visiosoft/composer-merge-plugin": true,
"php-http/discovery": true
}
}
}

View File

@ -14,8 +14,6 @@ return [
'name' => env('APP_NAME', 'My Application'),
'application_domain' => env('APPLICATION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| Application Environment
@ -55,13 +53,19 @@ return [
*/
'debug_blacklist' => [
'_COOKIE' => env('APP_ENV', 'production') === 'production' ? array_keys($_COOKIE) : [],
'_ENV' => [
'APP_KEY',
'DB_PASSWORD',
],
'_SERVER' => env('APP_ENV', 'production') === 'production' ? array_keys($_SERVER) : [],
'_SERVER' => [
'APP_KEY',
'DB_PASSWORD',
],
'_ENV' => env('APP_ENV', 'production') === 'production' ? array_keys($_ENV) : [],
'_POST' => env('APP_ENV', 'production') === 'production' ? array_keys($_POST) : [],
'_POST' => [
'password',
],
],
/*
@ -197,7 +201,7 @@ return [
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\BroadcastServiceProvider::class,
//App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
@ -256,19 +260,5 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
/**
* Todo
* 30.11.2022
* It has been added for the use of 'with' in the PyroCMS Users Model file.
* Translate(trans) function does not accept nested arrays.
*/
'Anomaly\UsersModule\User\Notification\ActivateYourAccount' => \App\Notification\ActivateYourAccount::class,
'Anomaly\UsersModule\User\Notification\PasswordInvalidated' => \App\Notification\PasswordInvalidated::class,
'Anomaly\UsersModule\User\Notification\ResetYourPassword' => \App\Notification\ResetYourPassword::class,
'Anomaly\UsersModule\User\Notification\UserHasBeenActivated' => \App\Notification\UserHasBeenActivated::class,
'Anomaly\UsersModule\User\Notification\UserHasRegistered' => \App\Notification\UserHasRegistered::class,
'Anomaly\UsersModule\User\Notification\UserPendingActivation' => \App\Notification\UserPendingActivation::class,
],
];

View File

@ -60,7 +60,7 @@ return [
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
'collation' => 'utf8_unicode_ci',
'prefix' => env('DB_PREFIX', ''),
'strict' => false,
'engine' => env('DB_ENGINE'),
@ -108,21 +108,14 @@ return [
'redis' => [
'cluster' => false,
'client' => env('REDIS_CLIENT', 'phpredis'),
'default' => [
'host' => env('REDIS_HOST', 'redis'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
'cache' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
],
];
];

View File

@ -12,7 +12,7 @@ return [
| Set the cache to a writable dir, outside the document root.
|
*/
'enabled' => env('HTTP_CACHE', true),
'enabled' => env('HTTP_CACHE', false),
'esi' => false,
'cache_dir' => storage_path('httpcache'),
@ -27,4 +27,4 @@ return [
*/
'options' => [],
];
];

View File

@ -4,90 +4,79 @@ return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
| Default Search Engine
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
| This option controls the default search connection that gets used while
| using Laravel Scout. This connection is used when syncing all models
| to the search service. You should adjust this based on your needs.
|
| Supported: "algolia", "null"
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
'driver' => env('SCOUT_DRIVER', 'search'),
/*
|--------------------------------------------------------------------------
| Queue Connections
| Index Prefix
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
| Here you may specify a prefix that will be applied to all search index
| names used by Scout. This prefix may be useful if you have multiple
| "tenants" or applications sharing the same search infrastructure.
|
*/
'connections' => [
'prefix' => env('SCOUT_PREFIX', 'tntsearch'),
'sync' => [
'driver' => 'sync',
],
/*
|--------------------------------------------------------------------------
| Queue Data Syncing
|--------------------------------------------------------------------------
|
| This option allows you to control if the operations that sync your data
| with your search engines are queued. When this is set to "true" then
| all automatic data syncing will get queued for better performance.
|
*/
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
'queue' => false,
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
'after_commit' => false,
],
/*
|--------------------------------------------------------------------------
| Algolia Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your Algolia settings. Algolia is a cloud hosted
| search engine which works great with Scout out of the box. Just plug
| in your application ID and admin API key to get started searching.
|
*/
'algolia' => [
'id' => env('ALGOLIA_APP_ID'),
'secret' => env('ALGOLIA_SECRET'),
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
| TNT Configuration
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
| Here you may configure your TNT settings. TNT is the default search
| indexing mechanism for the Streams Platform. TNT Search is a fully
| featured full text search engine for PHP.
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
'tntsearch' => [
'fuzziness' => env('TNTSEARCH_FUZZINESS', false),
'fuzzy' => [
'prefix_length' => 2,
'max_expansions' => 10,
'distance' => 2,
],
'searchBoolean' => env('TNTSEARCH_BOOLEAN', true),
],
];
];

View File

@ -16,10 +16,7 @@ return [
'listeners' => [
\Anomaly\Streams\Platform\Event\Booted::class => [
\App\Listeners\Translations::class
],
\Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved::class => [
\App\Listeners\EnableMaintenanceMode::class
],
]
],
/*