From 1e43aded77e5bb2e27fe7cc022244335343e504f Mon Sep 17 00:00:00 2001 From: Benjamin Nussbaum Date: Wed, 28 Jan 2026 12:10:29 +0100 Subject: [PATCH] chore: update trmnl base url --- .github/FUNDING.yml | 2 +- README.md | 8 ++-- app/Jobs/FetchDeviceModelsJob.php | 4 +- app/Jobs/FirmwarePollJob.php | 4 +- config/services.php | 1 + .../views/livewire/catalog/trmnl.blade.php | 43 ++++++++++++------- .../views/pages/settings/support.blade.php | 2 +- .../views/recipes/home-assistant.blade.php | 8 ++-- .../views/recipes/pollen-forecast-eu.liquid | 4 +- resources/views/recipes/weather.blade.php | 8 ++-- .../vendor/trmnl/components/screen.blade.php | 4 +- .../Console/FirmwareCheckCommandTest.php | 12 ++++-- .../Feature/Jobs/FetchDeviceModelsJobTest.php | 22 +++++----- tests/Feature/Jobs/FirmwarePollJobTest.php | 28 +++++++++--- .../Livewire/Catalog/CatalogTrmnlTest.php | 28 ++++++------ .../PluginRequiredConfigurationTest.php | 4 +- 16 files changed, 109 insertions(+), 73 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6bd92b2..ab2802d 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -custom: ["https://usetrmnl.com/?ref=laravel-trmnl"] +custom: ["https://trmnl.com/?ref=laravel-trmnl"] diff --git a/README.md b/README.md index acb0b5c..3d6d95e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![tests](https://github.com/usetrmnl/byos_laravel/actions/workflows/test.yml/badge.svg)](https://github.com/usetrmnl/byos_laravel/actions/workflows/test.yml) TRMNL BYOS Laravel is a self-hostable implementation of a TRMNL server, built with Laravel. -It allows you to manage TRMNL devices, generate screens using **native plugins** (Screens API, Markup), **recipes** (120+ from the [OSS community catalog](https://bnussbau.github.io/trmnl-recipe-catalog/), 600+ from the [TRMNL catalog](https://usetrmnl.com/recipes), or your own), or the **API**, and can also act as a **proxy** for the native cloud service (Core). With over 40k downloads and 160+ stars, it’s the most popular community-driven BYOS. +It allows you to manage TRMNL devices, generate screens using **native plugins** (Screens API, Markup), **recipes** (120+ from the [OSS community catalog](https://bnussbau.github.io/trmnl-recipe-catalog/), 600+ from the [TRMNL catalog](https://trmnl.com/recipes), or your own), or the **API**, and can also act as a **proxy** for the native cloud service (Core). With over 40k downloads and 160+ stars, it’s the most popular community-driven BYOS. ![Screenshot](README_byos-screenshot.png) ![Screenshot](README_byos-screenshot-dark.png) @@ -15,9 +15,9 @@ It allows you to manage TRMNL devices, generate screens using **native plugins** * πŸ“‘ Device Information – Display battery status, WiFi strength, firmware version, and more. * πŸ” Auto-Join – Automatically detects and adds devices from your local network. * πŸ–₯️ Screen Generation – Supports Plugins (including Mashups), Recipes, API, Markup, or updates via Code. - * Support for TRMNL [Design Framework](https://usetrmnl.com/framework) + * Support for TRMNL [Design Framework](https://trmnl.com/framework) * Compatible open-source recipes are available in the [community catalog](https://bnussbau.github.io/trmnl-recipe-catalog/) - * Import from the [TRMNL community recipe catalog](https://usetrmnl.com/recipes) + * Import from the [TRMNL community recipe catalog](https://trmnl.com/recipes) * Supported Devices * TRMNL OG (1-bit & 2-bit) * SeeedStudio TRMNL 7,5" (OG) DIY Kit @@ -43,7 +43,7 @@ It allows you to manage TRMNL devices, generate screens using **native plugins** ### Support ❀️ This repo is maintained voluntarily by [@bnussbau](https://github.com/bnussbau). -Support the development of this package by purchasing a TRMNL device through the referral link: https://usetrmnl.com/?ref=laravel-trmnl. At checkout, use the code `laravel-trmnl` to receive a $15 discount on your purchase. +Support the development of this package by purchasing a TRMNL device through the referral link: https://trmnl.com/?ref=laravel-trmnl. At checkout, use the code `laravel-trmnl` to receive a $15 discount on your purchase. or diff --git a/app/Jobs/FetchDeviceModelsJob.php b/app/Jobs/FetchDeviceModelsJob.php index 475c5c7..9e148b9 100644 --- a/app/Jobs/FetchDeviceModelsJob.php +++ b/app/Jobs/FetchDeviceModelsJob.php @@ -19,7 +19,7 @@ final class FetchDeviceModelsJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; - private const API_URL = 'https://usetrmnl.com/api/models'; + private const API_URL = '/api/models'; private const PALETTES_API_URL = 'http://usetrmnl.com/api/palettes'; @@ -39,7 +39,7 @@ final class FetchDeviceModelsJob implements ShouldQueue try { $this->processPalettes(); - $response = Http::timeout(30)->get(self::API_URL); + $response = Http::timeout(30)->get(config('services.trmnl.base_url').self::API_URL); if (! $response->successful()) { Log::error('Failed to fetch device models from API', [ diff --git a/app/Jobs/FirmwarePollJob.php b/app/Jobs/FirmwarePollJob.php index c1a2267..7fb45f9 100644 --- a/app/Jobs/FirmwarePollJob.php +++ b/app/Jobs/FirmwarePollJob.php @@ -22,7 +22,9 @@ class FirmwarePollJob implements ShouldQueue public function handle(): void { try { - $response = Http::get('https://usetrmnl.com/api/firmware/latest')->json(); + $firmwareEndpoint = config('services.trmnl.base_url').'/api/firmware/latest'; + + $response = Http::get($firmwareEndpoint)->json(); if (! is_array($response) || ! isset($response['version']) || ! isset($response['url'])) { Log::error('Invalid firmware response format received'); diff --git a/config/services.php b/config/services.php index 82eeeef..4598eb4 100644 --- a/config/services.php +++ b/config/services.php @@ -36,6 +36,7 @@ return [ ], 'trmnl' => [ + 'base_url' => 'https://trmnl.com', 'proxy_base_url' => env('TRMNL_PROXY_BASE_URL', 'https://trmnl.app'), 'proxy_refresh_minutes' => env('TRMNL_PROXY_REFRESH_MINUTES', 15), 'proxy_refresh_cron' => env('TRMNL_PROXY_REFRESH_CRON'), diff --git a/resources/views/livewire/catalog/trmnl.blade.php b/resources/views/livewire/catalog/trmnl.blade.php index 0285669..e522dae 100644 --- a/resources/views/livewire/catalog/trmnl.blade.php +++ b/resources/views/livewire/catalog/trmnl.blade.php @@ -49,10 +49,13 @@ class extends Component try { $cacheKey = 'trmnl_recipes_newest_page_'.$this->page; $response = Cache::remember($cacheKey, 43200, function () { - $response = Http::timeout(10)->get('https://usetrmnl.com/recipes.json', [ - 'sort-by' => 'newest', - 'page' => $this->page, - ]); + $response = Http::timeout(10)->get( + config('services.trmnl.base_url').'/recipes.json', + [ + 'sort-by' => 'newest', + 'page' => $this->page, + ] + ); if (! $response->successful()) { throw new RuntimeException('Failed to fetch TRMNL recipes'); @@ -86,11 +89,14 @@ class extends Component try { $cacheKey = 'trmnl_recipes_search_'.md5($term).'_page_'.$this->page; $response = Cache::remember($cacheKey, 300, function () use ($term) { - $response = Http::get('https://usetrmnl.com/recipes.json', [ - 'search' => $term, - 'sort-by' => 'newest', - 'page' => $this->page, - ]); + $response = Http::get( + config('services.trmnl.base_url').'/recipes.json', + [ + 'search' => $term, + 'sort-by' => 'newest', + 'page' => $this->page, + ] + ); if (! $response->successful()) { throw new RuntimeException('Failed to search TRMNL recipes'); @@ -155,7 +161,7 @@ class extends Component abort_unless(auth()->user() !== null, 403); try { - $zipUrl = "https://usetrmnl.com/api/plugin_settings/{$recipeId}/archive"; + $zipUrl = config('services.trmnl.base_url')."/api/plugin_settings/{$recipeId}/archive"; $recipe = collect($this->recipes)->firstWhere('id', $recipeId); @@ -183,16 +189,21 @@ class extends Component $this->previewData = []; try { - $response = Http::timeout(10)->get("https://usetrmnl.com/recipes/{$recipeId}.json"); + $response = Http::timeout(10)->get( + config('services.trmnl.base_url')."/recipes/{$recipeId}.json" + ); if ($response->successful()) { $item = $response->json()['data'] ?? []; $this->previewData = $this->mapRecipe($item); } else { // Fallback to searching for the specific recipe if single endpoint doesn't exist - $response = Http::timeout(10)->get('https://usetrmnl.com/recipes.json', [ - 'search' => $recipeId, - ]); + $response = Http::timeout(10)->get( + config('services.trmnl.base_url').'/recipes.json', + [ + 'search' => $recipeId, + ] + ); if ($response->successful()) { $data = $response->json()['data'] ?? []; @@ -240,7 +251,9 @@ class extends Component 'installs' => data_get($item, 'stats.installs'), 'forks' => data_get($item, 'stats.forks'), ], - 'detail_url' => isset($item['id']) ? ('https://usetrmnl.com/recipes/'.$item['id']) : null, + 'detail_url' => isset($item['id']) + ? config('services.trmnl.base_url').'/recipes/'.$item['id'] + : null, ]; } }; ?> diff --git a/resources/views/pages/settings/support.blade.php b/resources/views/pages/settings/support.blade.php index bf3d088..a4e24fc 100644 --- a/resources/views/pages/settings/support.blade.php +++ b/resources/views/pages/settings/support.blade.php @@ -29,7 +29,7 @@ new class extends Component {}
{{ __('Referral link') }}
diff --git a/resources/views/recipes/home-assistant.blade.php b/resources/views/recipes/home-assistant.blade.php index 4e52a9e..42985ef 100644 --- a/resources/views/recipes/home-assistant.blade.php +++ b/resources/views/recipes/home-assistant.blade.php @@ -12,7 +12,7 @@
+ src="{{ config('services.trmnl.base_url') }}/images/plugins/weather/wi-thermometer.svg">
@@ -28,7 +28,7 @@
- {{-- --}} + {{-- --}}
{{ $weatherEntity['attributes']['wind_speed'] }} {{ $weatherEntity['attributes']['wind_speed_unit'] }} @@ -39,7 +39,7 @@
- {{-- --}} + {{-- --}}
{{ $weatherEntity['attributes']['humidity'] }}% @@ -50,7 +50,7 @@
- {{-- --}} + {{-- --}}
{{ Str::title($weatherEntity['state']) }} diff --git a/resources/views/recipes/pollen-forecast-eu.liquid b/resources/views/recipes/pollen-forecast-eu.liquid index e3c2ddc..1dce28f 100644 --- a/resources/views/recipes/pollen-forecast-eu.liquid +++ b/resources/views/recipes/pollen-forecast-eu.liquid @@ -1,5 +1,5 @@ - - + +
diff --git a/resources/views/recipes/weather.blade.php b/resources/views/recipes/weather.blade.php index 0d8045f..be49361 100644 --- a/resources/views/recipes/weather.blade.php +++ b/resources/views/recipes/weather.blade.php @@ -5,7 +5,7 @@
+ src="{{ config('services.trmnl.base_url') }}/images/plugins/weather/wi-thermometer.svg">
@@ -21,7 +21,7 @@
- {{-- --}} + {{-- --}}
- {{-- --}} + {{-- --}}
{{Arr::get($data, 'properties.timeseries.0.data.instant.details.relative_humidity', 'N/A')}}% @@ -44,7 +44,7 @@
- {{-- --}} + {{-- --}}
@else + href="{{ config('services.trmnl.base_url') }}/css/{{ config('trmnl-blade.framework_version', '1.2.0') }}/plugins.css"> @endif @if (config('trmnl-blade.framework_js_url')) @else - + @endif {{ $title ?? config('app.name') }} diff --git a/tests/Feature/Console/FirmwareCheckCommandTest.php b/tests/Feature/Console/FirmwareCheckCommandTest.php index 459a035..289ff2f 100644 --- a/tests/Feature/Console/FirmwareCheckCommandTest.php +++ b/tests/Feature/Console/FirmwareCheckCommandTest.php @@ -17,8 +17,10 @@ test('firmware check command has correct signature', function (): void { test('firmware check command runs without errors', function (): void { // Mock the firmware API response + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'version' => '1.0.0', 'url' => 'https://example.com/firmware.bin', ], 200), @@ -33,8 +35,10 @@ test('firmware check command runs without errors', function (): void { test('firmware check command runs with download flag', function (): void { // Mock the firmware API response + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'version' => '1.0.0', 'url' => 'https://example.com/firmware.bin', ], 200), @@ -57,8 +61,10 @@ test('firmware check command runs with download flag', function (): void { test('firmware check command can run successfully', function (): void { // Mock the firmware API response + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'version' => '1.0.0', 'url' => 'https://example.com/firmware.bin', ], 200), diff --git a/tests/Feature/Jobs/FetchDeviceModelsJobTest.php b/tests/Feature/Jobs/FetchDeviceModelsJobTest.php index f0be135..f74a6fd 100644 --- a/tests/Feature/Jobs/FetchDeviceModelsJobTest.php +++ b/tests/Feature/Jobs/FetchDeviceModelsJobTest.php @@ -29,7 +29,7 @@ test('fetch device models job can be dispatched', function (): void { test('fetch device models job handles successful api response', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => [ [ 'name' => 'test-model', @@ -82,7 +82,7 @@ test('fetch device models job handles successful api response', function (): voi test('fetch device models job handles multiple device models', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => [ [ 'name' => 'model-1', @@ -136,7 +136,7 @@ test('fetch device models job handles multiple device models', function (): void test('fetch device models job handles empty data array', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => [], ], 200), ]); @@ -158,7 +158,7 @@ test('fetch device models job handles empty data array', function (): void { test('fetch device models job handles missing data field', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'message' => 'No data available', ], 200), ]); @@ -180,7 +180,7 @@ test('fetch device models job handles missing data field', function (): void { test('fetch device models job handles non-array data', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => 'invalid-data', ], 200), ]); @@ -202,7 +202,7 @@ test('fetch device models job handles non-array data', function (): void { test('fetch device models job handles api failure', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'error' => 'Internal Server Error', ], 500), ]); @@ -227,7 +227,7 @@ test('fetch device models job handles api failure', function (): void { test('fetch device models job handles network exception', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => function (): void { + config('services.trmnl.base_url').'/api/models' => function (): void { throw new Exception('Network connection failed'); }, ]); @@ -249,7 +249,7 @@ test('fetch device models job handles network exception', function (): void { test('fetch device models job handles device model with missing name', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => [ [ 'label' => 'Model without name', @@ -280,7 +280,7 @@ test('fetch device models job handles device model with missing name', function test('fetch device models job handles device model with partial data', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => [ [ 'name' => 'minimal-model', @@ -329,7 +329,7 @@ test('fetch device models job updates existing device model', function (): void Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => [ [ 'name' => 'existing-model', @@ -372,7 +372,7 @@ test('fetch device models job updates existing device model', function (): void test('fetch device models job handles processing exception for individual model', function (): void { Http::fake([ 'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200), - 'usetrmnl.com/api/models' => Http::response([ + config('services.trmnl.base_url').'/api/models' => Http::response([ 'data' => [ [ 'name' => 'valid-model', diff --git a/tests/Feature/Jobs/FirmwarePollJobTest.php b/tests/Feature/Jobs/FirmwarePollJobTest.php index 74c3cf7..4861d4d 100644 --- a/tests/Feature/Jobs/FirmwarePollJobTest.php +++ b/tests/Feature/Jobs/FirmwarePollJobTest.php @@ -10,8 +10,10 @@ beforeEach(function (): void { }); test('it creates new firmware record when polling', function (): void { + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'version' => '1.0.0', 'url' => 'https://example.com/firmware.bin', ], 200), @@ -32,8 +34,10 @@ test('it updates existing firmware record when polling', function (): void { 'latest' => true, ]); + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'version' => '1.0.0', 'url' => 'https://new-url.com/firmware.bin', ], 200), @@ -52,8 +56,10 @@ test('it marks previous firmware as not latest when new version is found', funct 'latest' => true, ]); + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'version' => '1.1.0', 'url' => 'https://example.com/firmware.bin', ], 200), @@ -66,8 +72,10 @@ test('it marks previous firmware as not latest when new version is found', funct }); test('it handles connection exception gracefully', function (): void { + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => function (): void { + $baseUrl.'/api/firmware/latest' => function (): void { throw new ConnectionException('Connection failed'); }, ]); @@ -79,8 +87,10 @@ test('it handles connection exception gracefully', function (): void { }); test('it handles invalid response gracefully', function (): void { + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response(null, 200), + $baseUrl.'/api/firmware/latest' => Http::response(null, 200), ]); (new FirmwarePollJob)->handle(); @@ -90,8 +100,10 @@ test('it handles invalid response gracefully', function (): void { }); test('it handles missing version in response gracefully', function (): void { + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'url' => 'https://example.com/firmware.bin', ], 200), ]); @@ -103,8 +115,10 @@ test('it handles missing version in response gracefully', function (): void { }); test('it handles missing url in response gracefully', function (): void { + $baseUrl = config('services.trmnl.base_url'); + Http::fake([ - 'https://usetrmnl.com/api/firmware/latest' => Http::response([ + $baseUrl.'/api/firmware/latest' => Http::response([ 'version' => '1.0.0', ], 200), ]); diff --git a/tests/Feature/Livewire/Catalog/CatalogTrmnlTest.php b/tests/Feature/Livewire/Catalog/CatalogTrmnlTest.php index 536f6ad..32fcd94 100644 --- a/tests/Feature/Livewire/Catalog/CatalogTrmnlTest.php +++ b/tests/Feature/Livewire/Catalog/CatalogTrmnlTest.php @@ -8,7 +8,7 @@ use Livewire\Livewire; it('loads newest TRMNL recipes on mount', function (): void { Http::fake([ - 'usetrmnl.com/recipes.json*' => Http::response([ + config('services.trmnl.base_url').'/recipes.json*' => Http::response([ 'data' => [ [ 'id' => 123, @@ -33,7 +33,7 @@ it('loads newest TRMNL recipes on mount', function (): void { it('shows preview button when screenshot_url is provided', function (): void { Http::fake([ - 'usetrmnl.com/recipes.json*' => Http::response([ + config('services.trmnl.base_url').'/recipes.json*' => Http::response([ 'data' => [ [ 'id' => 123, @@ -57,7 +57,7 @@ it('shows preview button when screenshot_url is provided', function (): void { it('searches TRMNL recipes when search term is provided', function (): void { Http::fake([ // First call (mount -> newest) - 'usetrmnl.com/recipes.json?*' => Http::sequence() + config('services.trmnl.base_url').'/recipes.json?*' => Http::sequence() ->push([ 'data' => [ [ @@ -98,7 +98,7 @@ it('installs plugin successfully when user is authenticated', function (): void $user = User::factory()->create(); Http::fake([ - 'usetrmnl.com/recipes.json*' => Http::response([ + config('services.trmnl.base_url').'/recipes.json*' => Http::response([ 'data' => [ [ 'id' => 123, @@ -110,7 +110,7 @@ it('installs plugin successfully when user is authenticated', function (): void ], ], ], 200), - 'usetrmnl.com/api/plugin_settings/123/archive*' => Http::response('fake zip content', 200), + config('services.trmnl.base_url').'/api/plugin_settings/123/archive*' => Http::response('fake zip content', 200), ]); $this->actingAs($user); @@ -125,7 +125,7 @@ it('installs plugin successfully when user is authenticated', function (): void it('shows error when user is not authenticated', function (): void { Http::fake([ - 'usetrmnl.com/recipes.json*' => Http::response([ + config('services.trmnl.base_url').'/recipes.json*' => Http::response([ 'data' => [ [ 'id' => 123, @@ -151,7 +151,7 @@ it('shows error when plugin installation fails', function (): void { $user = User::factory()->create(); Http::fake([ - 'usetrmnl.com/recipes.json*' => Http::response([ + config('services.trmnl.base_url').'/recipes.json*' => Http::response([ 'data' => [ [ 'id' => 123, @@ -163,7 +163,7 @@ it('shows error when plugin installation fails', function (): void { ], ], ], 200), - 'usetrmnl.com/api/plugin_settings/123/archive*' => Http::response('invalid zip content', 200), + config('services.trmnl.base_url').'/api/plugin_settings/123/archive*' => Http::response('invalid zip content', 200), ]); $this->actingAs($user); @@ -178,7 +178,7 @@ it('shows error when plugin installation fails', function (): void { it('previews a recipe with async fetch', function (): void { Http::fake([ - 'usetrmnl.com/recipes.json*' => Http::response([ + config('services.trmnl.base_url').'/recipes.json*' => Http::response([ 'data' => [ [ 'id' => 123, @@ -190,7 +190,7 @@ it('previews a recipe with async fetch', function (): void { ], ], ], 200), - 'usetrmnl.com/recipes/123.json' => Http::response([ + config('services.trmnl.base_url').'/recipes/123.json' => Http::response([ 'data' => [ 'id' => 123, 'name' => 'Weather Chum Updated', @@ -216,7 +216,7 @@ it('previews a recipe with async fetch', function (): void { it('supports pagination and loading more recipes', function (): void { Http::fake([ - 'usetrmnl.com/recipes.json?sort-by=newest&page=1' => Http::response([ + config('services.trmnl.base_url').'/recipes.json?sort-by=newest&page=1' => Http::response([ 'data' => [ [ 'id' => 1, @@ -229,7 +229,7 @@ it('supports pagination and loading more recipes', function (): void { ], 'next_page_url' => '/recipes.json?page=2', ], 200), - 'usetrmnl.com/recipes.json?sort-by=newest&page=2' => Http::response([ + config('services.trmnl.base_url').'/recipes.json?sort-by=newest&page=2' => Http::response([ 'data' => [ [ 'id' => 2, @@ -258,7 +258,7 @@ it('supports pagination and loading more recipes', function (): void { it('resets pagination when search term changes', function (): void { Http::fake([ - 'usetrmnl.com/recipes.json?sort-by=newest&page=1' => Http::sequence() + config('services.trmnl.base_url').'/recipes.json?sort-by=newest&page=1' => Http::sequence() ->push([ 'data' => [['id' => 1, 'name' => 'Initial 1']], 'next_page_url' => '/recipes.json?page=2', @@ -267,7 +267,7 @@ it('resets pagination when search term changes', function (): void { 'data' => [['id' => 3, 'name' => 'Initial 1 Again']], 'next_page_url' => null, ]), - 'usetrmnl.com/recipes.json?search=weather&sort-by=newest&page=1' => Http::response([ + config('services.trmnl.base_url').'/recipes.json?search=weather&sort-by=newest&page=1' => Http::response([ 'data' => [['id' => 2, 'name' => 'Weather Result']], 'next_page_url' => null, ]), diff --git a/tests/Feature/PluginRequiredConfigurationTest.php b/tests/Feature/PluginRequiredConfigurationTest.php index 51e1b76..5f46321 100644 --- a/tests/Feature/PluginRequiredConfigurationTest.php +++ b/tests/Feature/PluginRequiredConfigurationTest.php @@ -227,7 +227,7 @@ test('hasMissingRequiredConfigurationFields returns true when required xhrSelect 'field_type' => 'xhrSelect', 'name' => 'Baseball Team', 'description' => 'Select your team', - 'endpoint' => 'https://usetrmnl.com/custom_plugin_example_xhr_select.json', + 'endpoint' => config('services.trmnl.base_url').'/custom_plugin_example_xhr_select.json', // Not marked as optional, so it's required ], ], @@ -252,7 +252,7 @@ test('hasMissingRequiredConfigurationFields returns false when required xhrSelec 'field_type' => 'xhrSelect', 'name' => 'Baseball Team', 'description' => 'Select your team', - 'endpoint' => 'https://usetrmnl.com/custom_plugin_example_xhr_select.json', + 'endpoint' => config('services.trmnl.base_url').'/custom_plugin_example_xhr_select.json', // Not marked as optional, so it's required ], ],