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 @@ [](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.   @@ -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 {}