Merge pull request #1371 from openclassify/laravel-upgrade-10

upgrade laravel 10
This commit is contained in:
Fatih Alp 2024-06-29 23:13:44 +03:00 committed by GitHub
commit b481872421
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 209 additions and 190 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

@ -12,57 +12,68 @@
{
"name": "Visiosoft, Inc.",
"email": "support@visiosoft.com.tr"
},
{
"name": "Vedat Akdogan",
"email": "vedatakdogan@live.com",
"role": "Developer"
}
],
"require": {
"visiosoft/streams-platform": "~1.9.0",
"anomaly/xml_feed_widget-extension": "~2.1.0",
"anomaly/default_authenticator-extension": "~2.1.0",
"anomaly/throttle_security_check-extension": "~2.1.0",
"anomaly/private_storage_adapter-extension": "~1.1.0",
"anomaly/default_page_handler-extension": "~2.1.0",
"anomaly/user_security_check-extension": "~2.1.0",
"visiosoft/streams-platform": "1.10.x-dev",
"anomaly/default_authenticator-extension": "2.2.x-dev",
"anomaly/throttle_security_check-extension": "2.2.x-dev",
"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",
"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/checkboxes-field_type": "~2.4.0",
"anomaly/checkboxes-field_type": "2.5.x-dev",
"anomaly/encrypted-field_type": "~2.1.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/multiple-field_type": "~2.3.0",
"anomaly/multiple-field_type": "2.4.x-dev",
"anomaly/textarea-field_type": "~2.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/country-field_type": "~2.3.0",
"anomaly/country-field_type": "2.4.x-dev",
"anomaly/decimal-field_type": "~2.1.0",
"anomaly/integer-field_type": "~2.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/addon-field_type": "~2.2.0",
"anomaly/addon-field_type": "2.3.x-dev",
"anomaly/email-field_type": "~2.1.0",
"anomaly/state-field_type": "~2.3.0",
"anomaly/files-field_type": "~2.3.0",
"anomaly/tags-field_type": "~2.4.0",
"anomaly/state-field_type": "~2.4.x-dev",
"anomaly/files-field_type": "2.4.x-dev",
"anomaly/tags-field_type": "2.5.x-dev",
"anomaly/slug-field_type": "~2.1.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/configuration-module": "~2.1.0",
"anomaly/preferences-module": "~2.2.0",
"anomaly/navigation-module": "~2.4.0",
"anomaly/dashboard-module": "~2.2.0",
"anomaly/redirects-module": "~2.3.0",
"anomaly/settings-module": "~2.4.0",
"anomaly/search-module": "~3.0.0",
"anomaly/users-module": "~2.5.0",
"anomaly/pages-module": "~2.6.0",
"anomaly/posts-module": "~2.6.0",
"anomaly/files-module": "~2.6.0",
"anomaly/configuration-module": "2.2.x-dev",
"anomaly/preferences-module": "2.3.x-dev",
"anomaly/navigation-module": "2.5.x-dev",
"anomaly/dashboard-module": "2.3.x-dev",
"anomaly/redirects-module": "2.5.x-dev",
"anomaly/variables-module": "2.5.x-dev",
"anomaly/settings-module": "2.5.x-dev",
"anomaly/blocks-module": "~1.4.x-dev",
"anomaly/search-module": "3.2.x-dev",
"anomaly/streams-module": "1.4.x-dev",
"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": "*",
"anomaly/helper-plugin": "~2.1.0",
"anomaly/robots-extension": "~2.1.0",
@ -73,11 +84,9 @@
"visiosoft/list-field_type": "*",
"visiosoft/addblock-extension": "^1.1",
"google/recaptcha": "1.2.*",
"sentry/sentry-laravel": "2.3.1",
"composer/composer": "2.*",
"visiosoft/composer-merge-plugin": "2.*",
"guzzlehttp/guzzle": "^7.3",
"visiosoft/connect-module": "^1.0",
"visiosoft/singlefile-field_type": "^1.0",
"visiosoft/profile-module": "^1.0",
"visiosoft/multiple-field_type": "^1.0",
@ -87,10 +96,11 @@
"visiosoft/defaultadmin-theme": "^1.0",
"visiosoft/cats-module": "^1.0",
"visiosoft/base-theme": "^1.0",
"visiosoft/advs-module": "^1.0",
"visiosoft/advs-module": "v1.10.x-dev",
"visiosoft/json-field_type": "^1.0",
"visiosoft/language_switcher-plugin": "^1.0",
"visiosoft/global_helper-extension": "*"
"visiosoft/global_helper-extension": "*",
"php-http/message-factory": "^1.1"
},
"replace": {
"anomaly/streams-platform": "*"
@ -99,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": [
{
@ -146,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

@ -1,8 +1,5 @@
<?php
use Sentry\Laravel\Facade;
use Sentry\Laravel\ServiceProvider;
return [
/*
@ -17,8 +14,6 @@ return [
'name' => env('APP_NAME', 'My Application'),
'application_domain' => env('APPLICATION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| Application Environment
@ -58,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',
],
],
/*
@ -200,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,
@ -208,8 +209,6 @@ return [
* Streams Service Provider
*/
Anomaly\Streams\Platform\StreamsServiceProvider::class,
Sentry\Laravel\ServiceProvider::class,
\Fruitcake\Cors\CorsServiceProvider::class
],
/*
@ -260,21 +259,6 @@ return [
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Sentry' => Sentry\Laravel\Facade::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

@ -11,11 +11,11 @@ return [
| 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"
| 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' => [
'id' => env('ALGOLIA_APP_ID'),
'secret' => env('ALGOLIA_SECRET'),
'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET', ''),
],
/*
|--------------------------------------------------------------------------
| TNT Configuration
| Meilisearch Configuration
|--------------------------------------------------------------------------
|
| 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.
| Here you may configure your Meilisearch settings. Meilisearch is an open
| source search engine with minimal configuration. Below, you can state
| the host and key information for your own Meilisearch installation.
|
| See: https://www.meilisearch.com/docs/learn/configuration/instance_options#all-instance-options
|
*/
'tntsearch' => [
'fuzziness' => env('TNTSEARCH_FUZZINESS', false),
'fuzzy' => [
'prefix_length' => 2,
'max_expansions' => 10,
'distance' => 2,
'meilisearch' => [
'host' => env('MEILISEARCH_HOST', 'http://localhost:7700'),
'key' => env('MEILISEARCH_KEY'),
'index-settings' => [
// 'users' => [
// 'filterableAttributes'=> ['id', 'name', 'email'],
// ],
],
'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
],
]
],
/*
@ -91,7 +88,7 @@ return [
*/
'middleware' => [
\Fruitcake\Cors\HandleCors::class, # this line
\Illuminate\Http\Middleware\HandleCors::class
],
/*

View File

@ -16,7 +16,6 @@ use Illuminate\Support\Facades\DB;
use Symfony\Component\Console\Input\ArgvInput;
use Visiosoft\AdvsModule\Adv\Command\DeleteInstaller;
use WidgetSeeder;
use ZipArchive;
class DatabaseSeeder extends Seeder
{
@ -95,7 +94,7 @@ class DatabaseSeeder extends Seeder
$this->call(WidgetSeeder::class);
//Delete Installer
dispatch_now(new DeleteInstaller());
dispatch_sync(new DeleteInstaller());
if (is_null($this->folders->findBy('slug', 'ads_excel'))) {
$disk = $this->disks->findBySlug('local');