upgrade laravel 10

This commit is contained in:
spektra2147 2023-11-09 20:34:32 +03:00
parent 38c3438e52
commit f46c959e04
9 changed files with 204 additions and 178 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(); 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

@ -15,54 +15,58 @@
} }
], ],
"require": { "require": {
"visiosoft/streams-platform": "~1.9.0", "visiosoft/streams-platform": "1.10.x-dev",
"anomaly/xml_feed_widget-extension": "~2.1.0", "anomaly/default_authenticator-extension": "2.2.x-dev",
"anomaly/default_authenticator-extension": "~2.1.0", "anomaly/throttle_security_check-extension": "2.2.x-dev",
"anomaly/throttle_security_check-extension": "~2.1.0", "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.1.0", "anomaly/private_storage_adapter-extension": "~1.1.0",
"anomaly/default_page_handler-extension": "~2.1.0", "anomaly/url_link_type-extension": "2.2.x-dev",
"anomaly/user_security_check-extension": "~2.1.0", "anomaly/relationship-field_type": "2.3.x-dev",
"anomaly/colorpicker-field_type": "2.4.x-dev",
"anomaly/page_link_type-extension": "~2.1.0", "anomaly/page_link_type-extension": "~2.1.0",
"anomaly/url_link_type-extension": "~2.1.0",
"anomaly/relationship-field_type": "~2.2.0",
"anomaly/colorpicker-field_type": "~2.3.0",
"anomaly/polymorphic-field_type": "~2.1.0", "anomaly/polymorphic-field_type": "~2.1.0",
"anomaly/checkboxes-field_type": "~2.4.0", "anomaly/checkboxes-field_type": "2.5.x-dev",
"anomaly/encrypted-field_type": "~2.1.0", "anomaly/encrypted-field_type": "~2.1.0",
"anomaly/datetime-field_type": "~3.0.0", "anomaly/datetime-field_type": "~3.0.0",
"anomaly/repeater-field_type": "~1.3.0", "anomaly/repeater-field_type": "1.4.x-dev",
"anomaly/language-field_type": "~2.2.0", "anomaly/language-field_type": "~2.2.0",
"anomaly/multiple-field_type": "~2.3.0", "anomaly/multiple-field_type": "2.4.x-dev",
"anomaly/textarea-field_type": "~2.1.0", "anomaly/textarea-field_type": "~2.1.0",
"anomaly/markdown-field_type": "~3.1.0", "anomaly/markdown-field_type": "~3.1.0",
"anomaly/wysiwyg-field_type": "~3.1.0", "anomaly/wysiwyg-field_type": "3.2.x-dev",
"anomaly/boolean-field_type": "~2.3.0", "anomaly/boolean-field_type": "~2.3.0",
"anomaly/country-field_type": "~2.3.0", "anomaly/country-field_type": "2.4.x-dev",
"anomaly/decimal-field_type": "~2.1.0", "anomaly/decimal-field_type": "~2.1.0",
"anomaly/integer-field_type": "~2.1.0", "anomaly/integer-field_type": "~2.1.0",
"anomaly/editor-field_type": "~3.1.0", "anomaly/editor-field_type": "~3.1.0",
"anomaly/select-field_type": "2.3.8", "anomaly/select-field_type": "2.4.x-dev",
"anomaly/slider-field_type": "~3.0.0", "anomaly/slider-field_type": "~3.0.0",
"anomaly/addon-field_type": "~2.2.0", "anomaly/addon-field_type": "2.3.x-dev",
"anomaly/email-field_type": "~2.1.0", "anomaly/email-field_type": "~2.1.0",
"anomaly/state-field_type": "~2.3.0", "anomaly/state-field_type": "~2.4.x-dev",
"anomaly/files-field_type": "~2.3.0", "anomaly/files-field_type": "2.4.x-dev",
"anomaly/tags-field_type": "~2.4.0", "anomaly/tags-field_type": "2.5.x-dev",
"anomaly/slug-field_type": "~2.1.0", "anomaly/slug-field_type": "~2.1.0",
"anomaly/text-field_type": "~2.2.0", "anomaly/text-field_type": "~2.2.0",
"anomaly/file-field_type": "~2.2.0", "anomaly/file-field_type": "2.3.x-dev",
"anomaly/url-field_type": "~2.2.0", "anomaly/url-field_type": "~2.2.0",
"anomaly/configuration-module": "~2.1.0", "anomaly/configuration-module": "2.2.x-dev",
"anomaly/preferences-module": "~2.2.0", "anomaly/preferences-module": "2.3.x-dev",
"anomaly/navigation-module": "~2.4.0", "anomaly/navigation-module": "2.5.x-dev",
"anomaly/dashboard-module": "~2.2.0", "anomaly/dashboard-module": "2.3.x-dev",
"anomaly/redirects-module": "~2.3.0", "anomaly/redirects-module": "2.5.x-dev",
"anomaly/settings-module": "~2.4.0", "anomaly/variables-module": "2.5.x-dev",
"anomaly/search-module": "~3.0.0", "anomaly/settings-module": "2.5.x-dev",
"anomaly/users-module": "~2.5.0", "anomaly/blocks-module": "~1.4.x-dev",
"anomaly/pages-module": "~2.6.0", "anomaly/search-module": "3.2.x-dev",
"anomaly/posts-module": "~2.6.0", "anomaly/streams-module": "1.4.x-dev",
"anomaly/files-module": "~2.6.0", "anomaly/users-module": "2.6.x-dev",
"anomaly/pages-module": "2.7.x-dev",
"anomaly/posts-module": "2.7.x-dev",
"anomaly/files-module": "2.7.x-dev",
"anomaly/contact-plugin": "1.3.x-dev",
"visiosoft/contact-plugin": "*", "visiosoft/contact-plugin": "*",
"anomaly/helper-plugin": "~2.1.0", "anomaly/helper-plugin": "~2.1.0",
"anomaly/robots-extension": "~2.1.0", "anomaly/robots-extension": "~2.1.0",
@ -73,11 +77,9 @@
"visiosoft/list-field_type": "*", "visiosoft/list-field_type": "*",
"visiosoft/addblock-extension": "^1.1", "visiosoft/addblock-extension": "^1.1",
"google/recaptcha": "1.2.*", "google/recaptcha": "1.2.*",
"sentry/sentry-laravel": "2.3.1",
"composer/composer": "2.*", "composer/composer": "2.*",
"visiosoft/composer-merge-plugin": "2.*", "visiosoft/composer-merge-plugin": "2.*",
"guzzlehttp/guzzle": "^7.3", "guzzlehttp/guzzle": "^7.3",
"visiosoft/connect-module": "^1.0",
"visiosoft/singlefile-field_type": "^1.0", "visiosoft/singlefile-field_type": "^1.0",
"visiosoft/profile-module": "^1.0", "visiosoft/profile-module": "^1.0",
"visiosoft/multiple-field_type": "^1.0", "visiosoft/multiple-field_type": "^1.0",
@ -90,7 +92,8 @@
"visiosoft/advs-module": "^1.0", "visiosoft/advs-module": "^1.0",
"visiosoft/json-field_type": "^1.0", "visiosoft/json-field_type": "^1.0",
"visiosoft/language_switcher-plugin": "^1.0", "visiosoft/language_switcher-plugin": "^1.0",
"visiosoft/global_helper-extension": "*" "visiosoft/global_helper-extension": "*",
"php-http/message-factory": "^1.1"
}, },
"replace": { "replace": {
"anomaly/streams-platform": "*" "anomaly/streams-platform": "*"
@ -99,7 +102,8 @@
"filp/whoops": "~2.0", "filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
"symfony/css-selector": "3.1.*", "symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*" "symfony/dom-crawler": "3.1.*",
"anomaly/installer-module": "2.4.x-dev"
}, },
"repositories": [ "repositories": [
{ {
@ -146,7 +150,8 @@
"preferred-install": "dist", "preferred-install": "dist",
"optimize-autoloader": true, "optimize-autoloader": true,
"allow-plugins": { "allow-plugins": {
"visiosoft/composer-merge-plugin": true "visiosoft/composer-merge-plugin": true,
"php-http/discovery": true
} }
} }
} }

View File

@ -1,8 +1,5 @@
<?php <?php
use Sentry\Laravel\Facade;
use Sentry\Laravel\ServiceProvider;
return [ return [
/* /*
@ -17,8 +14,6 @@ return [
'name' => env('APP_NAME', 'My Application'), 'name' => env('APP_NAME', 'My Application'),
'application_domain' => env('APPLICATION_DOMAIN', null),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Environment | Application Environment
@ -58,13 +53,19 @@ return [
*/ */
'debug_blacklist' => [ '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' => [
'password',
'_POST' => env('APP_ENV', 'production') === 'production' ? array_keys($_POST) : [], ],
], ],
/* /*
@ -200,7 +201,7 @@ return [
*/ */
App\Providers\AppServiceProvider::class, App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class, App\Providers\AuthServiceProvider::class,
App\Providers\BroadcastServiceProvider::class, //App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class, App\Providers\RouteServiceProvider::class,
@ -208,8 +209,6 @@ return [
* Streams Service Provider * Streams Service Provider
*/ */
Anomaly\Streams\Platform\StreamsServiceProvider::class, Anomaly\Streams\Platform\StreamsServiceProvider::class,
Sentry\Laravel\ServiceProvider::class,
\Fruitcake\Cors\CorsServiceProvider::class
], ],
/* /*
@ -260,8 +259,6 @@ return [
'URL' => Illuminate\Support\Facades\URL::class, 'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Sentry' => Sentry\Laravel\Facade::class,
/** /**
* Todo * Todo
@ -269,12 +266,12 @@ return [
* It has been added for the use of 'with' in the PyroCMS Users Model file. * It has been added for the use of 'with' in the PyroCMS Users Model file.
* Translate(trans) function does not accept nested arrays. * Translate(trans) function does not accept nested arrays.
*/ */
'Anomaly\UsersModule\User\Notification\ActivateYourAccount' => \App\Notification\ActivateYourAccount::class, // 'Anomaly\UsersModule\User\Notification\ActivateYourAccount' => \App\Notification\ActivateYourAccount::class,
'Anomaly\UsersModule\User\Notification\PasswordInvalidated' => \App\Notification\PasswordInvalidated::class, // 'Anomaly\UsersModule\User\Notification\PasswordInvalidated' => \App\Notification\PasswordInvalidated::class,
'Anomaly\UsersModule\User\Notification\ResetYourPassword' => \App\Notification\ResetYourPassword::class, // 'Anomaly\UsersModule\User\Notification\ResetYourPassword' => \App\Notification\ResetYourPassword::class,
'Anomaly\UsersModule\User\Notification\UserHasBeenActivated' => \App\Notification\UserHasBeenActivated::class, // 'Anomaly\UsersModule\User\Notification\UserHasBeenActivated' => \App\Notification\UserHasBeenActivated::class,
'Anomaly\UsersModule\User\Notification\UserHasRegistered' => \App\Notification\UserHasRegistered::class, // 'Anomaly\UsersModule\User\Notification\UserHasRegistered' => \App\Notification\UserHasRegistered::class,
'Anomaly\UsersModule\User\Notification\UserPendingActivation' => \App\Notification\UserPendingActivation::class, // 'Anomaly\UsersModule\User\Notification\UserPendingActivation' => \App\Notification\UserPendingActivation::class,
], ],
]; ];

View File

@ -60,7 +60,7 @@ return [
'username' => env('DB_USERNAME', 'forge'), 'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8', 'charset' => 'utf8',
'collation' => env('DB_COLLATION', 'utf8_unicode_ci'), 'collation' => 'utf8_unicode_ci',
'prefix' => env('DB_PREFIX', ''), 'prefix' => env('DB_PREFIX', ''),
'strict' => false, 'strict' => false,
'engine' => env('DB_ENGINE'), 'engine' => env('DB_ENGINE'),
@ -108,21 +108,14 @@ return [
'redis' => [ 'redis' => [
'cluster' => false, 'cluster' => false,
'client' => env('REDIS_CLIENT', 'phpredis'),
'default' => [ 'default' => [
'host' => env('REDIS_HOST', 'redis'), 'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD'), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379), 'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0), '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. | Set the cache to a writable dir, outside the document root.
| |
*/ */
'enabled' => env('HTTP_CACHE', true), 'enabled' => env('HTTP_CACHE', false),
'esi' => false, 'esi' => false,
'cache_dir' => storage_path('httpcache'), 'cache_dir' => storage_path('httpcache'),

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 | This option controls the default search connection that gets used while
| API, giving you convenient access to each back-end using the same | using Laravel Scout. This connection is used when syncing all models
| syntax for every one. Here you may define a default connection. | 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 | Here you may specify a prefix that will be applied to all search index
| is used by your application. A default configuration has been added | names used by Scout. This prefix may be useful if you have multiple
| for each back-end shipped with Laravel. You are free to add more. | "tenants" or applications sharing the same search infrastructure.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
| |
*/ */
'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' => [ 'queue' => false,
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
'beanstalkd' => [ /*
'driver' => 'beanstalkd', |--------------------------------------------------------------------------
'host' => 'localhost', | Algolia Configuration
'queue' => 'default', |--------------------------------------------------------------------------
'retry_after' => 90, |
'block_for' => 0, | Here you may configure your Algolia settings. Algolia is a cloud hosted
'after_commit' => false, | 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.
|
'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' => [
'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 | Here you may configure your TNT settings. TNT is the default search
| can control which database and table are used to store the jobs that | indexing mechanism for the Streams Platform. TNT Search is a fully
| have failed. You may change them to any database / table you wish. | featured full text search engine for PHP.
| |
*/ */
'failed' => [ 'tntsearch' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'), 'fuzziness' => env('TNTSEARCH_FUZZINESS', false),
'database' => env('DB_CONNECTION', 'mysql'), 'fuzzy' => [
'table' => 'failed_jobs', 'prefix_length' => 2,
'max_expansions' => 10,
'distance' => 2,
],
'searchBoolean' => env('TNTSEARCH_BOOLEAN', true),
], ],
]; ];

View File

@ -11,11 +11,11 @@ return [
| using Laravel Scout. This connection is used when syncing all models | using Laravel Scout. This connection is used when syncing all models
| to the search service. You should adjust this based on your needs. | to the search service. You should adjust this based on your needs.
| |
| Supported: "algolia", "null" | Supported: "algolia", "meilisearch", "database", "collection", "null"
| |
*/ */
'driver' => env('SCOUT_DRIVER', 'search'), 'driver' => env('SCOUT_DRIVER', 'null'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -28,7 +28,7 @@ return [
| |
*/ */
'prefix' => env('SCOUT_PREFIX', 'tntsearch'), 'prefix' => env('SCOUT_PREFIX', ''),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -41,7 +41,64 @@ return [
| |
*/ */
'queue' => false, 'queue' => env('SCOUT_QUEUE', false),
/*
|--------------------------------------------------------------------------
| Database Transactions
|--------------------------------------------------------------------------
|
| This configuration option determines if your data will only be synced
| with your search indexes after every open database transaction has
| been committed, thus preventing any discarded data from syncing.
|
*/
'after_commit' => false,
/*
|--------------------------------------------------------------------------
| Chunk Sizes
|--------------------------------------------------------------------------
|
| These options allow you to control the maximum chunk size when you are
| mass importing data into the search engine. This allows you to fine
| tune each of these chunk sizes based on the power of the servers.
|
*/
'chunk' => [
'searchable' => 500,
'unsearchable' => 500,
],
/*
|--------------------------------------------------------------------------
| Soft Deletes
|--------------------------------------------------------------------------
|
| This option allows to control whether to keep soft deleted records in
| the search indexes. Maintaining soft deleted records can be useful
| if your application still needs to search for the records later.
|
*/
'soft_delete' => false,
/*
|--------------------------------------------------------------------------
| Identify User
|--------------------------------------------------------------------------
|
| This option allows you to control whether to notify the search engine
| of the user performing the search. This is sometimes useful if the
| engine supports any analytics based on this application's users.
|
| Supported engines: "algolia"
|
*/
'identify' => env('SCOUT_IDENTIFY', false),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -55,28 +112,31 @@ return [
*/ */
'algolia' => [ 'algolia' => [
'id' => env('ALGOLIA_APP_ID'), 'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET'), 'secret' => env('ALGOLIA_SECRET', ''),
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| TNT Configuration | Meilisearch Configuration
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may configure your TNT settings. TNT is the default search | Here you may configure your Meilisearch settings. Meilisearch is an open
| indexing mechanism for the Streams Platform. TNT Search is a fully | source search engine with minimal configuration. Below, you can state
| featured full text search engine for PHP. | the host and key information for your own Meilisearch installation.
|
| See: https://www.meilisearch.com/docs/learn/configuration/instance_options#all-instance-options
| |
*/ */
'tntsearch' => [ 'meilisearch' => [
'fuzziness' => env('TNTSEARCH_FUZZINESS', false), 'host' => env('MEILISEARCH_HOST', 'http://localhost:7700'),
'fuzzy' => [ 'key' => env('MEILISEARCH_KEY'),
'prefix_length' => 2, 'index-settings' => [
'max_expansions' => 10, // 'users' => [
'distance' => 2, // 'filterableAttributes'=> ['id', 'name', 'email'],
// ],
], ],
'searchBoolean' => env('TNTSEARCH_BOOLEAN', true),
], ],
]; ];

View File

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