Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Filament/Pages/Settings/GeneralPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function form(Form $form): Form
Forms\Components\Section::make('Site Settings')
->schema([
Forms\Components\TextInput::make('site_name')
->maxLength(50)
->required()
->disabled()
->helperText(new HtmlString('⚠️ DEPRECATED: Use <code>APP_NAME</code> environment variable.'))
->columnSpanFull(),
Forms\Components\Toggle::make('public_dashboard_enabled')
->label('Public dashboard'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Listeners\Webhook;

use App\Events\SpeedtestCompleted;
use App\Settings\GeneralSettings;
use App\Settings\NotificationSettings;
use Illuminate\Support\Facades\Log;
use Spatie\WebhookServer\WebhookCall;
Expand All @@ -15,8 +14,6 @@ class SendSpeedtestCompletedNotification
*/
public function handle(SpeedtestCompleted $event): void
{
$generalSettings = new GeneralSettings();

$notificationSettings = new NotificationSettings();

if (! $notificationSettings->webhook_enabled) {
Expand All @@ -38,7 +35,7 @@ public function handle(SpeedtestCompleted $event): void
->url($url['url'])
->payload([
'result_id' => $event->result->id,
'site_name' => $generalSettings->site_name,
'site_name' => config('app.name'),
'ping' => $event->result->ping,
'download' => $event->result->downloadBits,
'upload' => $event->result->uploadBits,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Events\SpeedtestCompleted;
use App\Helpers\Number;
use App\Settings\GeneralSettings;
use App\Settings\NotificationSettings;
use App\Settings\ThresholdSettings;
use Illuminate\Support\Facades\Log;
Expand Down Expand Up @@ -33,8 +32,6 @@ public function handle(SpeedtestCompleted $event): void
return;
}

$generalSettings = new GeneralSettings();

$thresholdSettings = new ThresholdSettings();

if (! $thresholdSettings->absolute_enabled) {
Expand Down Expand Up @@ -68,7 +65,7 @@ public function handle(SpeedtestCompleted $event): void
->url($url['url'])
->payload([
'result_id' => $event->result->id,
'site_name' => $generalSettings->site_name,
'site_name' => config('app.name'),
'metrics' => $failed,
])
->doNotSign()
Expand Down
3 changes: 3 additions & 0 deletions app/Settings/GeneralSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class GeneralSettings extends Settings
/** @var string[] */
public $speedtest_server;

/**
* @deprecated Use APP_NAME environment variable.
*/
public string $site_name;

public string $time_format;
Expand Down
2 changes: 1 addition & 1 deletion app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function absolutePingThresholdFailed(float $threshold, float $ping): bool
* @deprecated
*
* @param string $data
* @return bool
* @return bool
*/
if (! function_exists('json_validate')) {
function json_validate($data)
Expand Down