mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
fix(#12): correct mispelled word recipe
fix(#12): correct mispelled word recipe
This commit is contained in:
parent
302730c81e
commit
f530875210
17 changed files with 93 additions and 46 deletions
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// Correct the typo in render_markup_view for all plugin UUIDs
|
||||
$pluginUuids = [
|
||||
'9e46c6cf-358c-4bfe-8998-436b3a207fec', // ÖBB Departures
|
||||
'3b046eda-34e9-4232-b935-c33b989a284b', // Weather
|
||||
'21464b16-5f5a-4099-a967-f5c915e3da54', // Zen Quotes
|
||||
'8d472959-400f-46ee-afb2-4a9f1cfd521f', // This Day in History
|
||||
'4349fdad-a273-450b-aa00-3d32f2de788d', // Home Assistant
|
||||
];
|
||||
|
||||
foreach ($pluginUuids as $uuid) {
|
||||
DB::table('plugins')
|
||||
->where('uuid', $uuid)
|
||||
->update([
|
||||
'render_markup_view' => DB::raw("REPLACE(render_markup_view, 'receipts.', 'recipes.')"),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// Revert the typo correction if needed
|
||||
$pluginUuids = [
|
||||
'9e46c6cf-358c-4bfe-8998-436b3a207fec', // ÖBB Departures
|
||||
'3b046eda-34e9-4232-b935-c33b989a284b', // Weather
|
||||
'21464b16-5f5a-4099-a967-f5c915e3da54', // Zen Quotes
|
||||
'8d472959-400f-46ee-afb2-4a9f1cfd521f', // This Day in History
|
||||
'4349fdad-a273-450b-aa00-3d32f2de788d', // Home Assistant
|
||||
];
|
||||
|
||||
foreach ($pluginUuids as $uuid) {
|
||||
DB::table('plugins')
|
||||
->where('uuid', $uuid)
|
||||
->update([
|
||||
'render_markup_view' => DB::raw("REPLACE(render_markup_view, 'recipes.', 'receipts.')"),
|
||||
]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -33,7 +33,7 @@ class DatabaseSeeder extends Seeder
|
|||
// Plugin::factory(3)->create();
|
||||
|
||||
$this->call([
|
||||
ExampleReceiptsSeeder::class,
|
||||
ExampleRecipesSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace Database\Seeders;
|
|||
use App\Models\Plugin;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ExampleReceiptsSeeder extends Seeder
|
||||
class ExampleRecipesSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
|
|
@ -24,7 +24,7 @@ class ExampleReceiptsSeeder extends Seeder
|
|||
'polling_verb' => 'get',
|
||||
'polling_header' => null,
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.train',
|
||||
'render_markup_view' => 'recipes.train',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'train-front',
|
||||
|
|
@ -43,7 +43,7 @@ class ExampleReceiptsSeeder extends Seeder
|
|||
'polling_verb' => 'get',
|
||||
'polling_header' => null,
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.weather',
|
||||
'render_markup_view' => 'recipes.weather',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'sun',
|
||||
|
|
@ -62,7 +62,7 @@ class ExampleReceiptsSeeder extends Seeder
|
|||
'polling_verb' => 'get',
|
||||
'polling_header' => null,
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.zen',
|
||||
'render_markup_view' => 'recipes.zen',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'chat-bubble-bottom-center',
|
||||
|
|
@ -81,7 +81,7 @@ class ExampleReceiptsSeeder extends Seeder
|
|||
'polling_verb' => 'get',
|
||||
'polling_header' => null,
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.day-in-history',
|
||||
'render_markup_view' => 'recipes.day-in-history',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'calendar',
|
||||
|
|
@ -100,7 +100,7 @@ class ExampleReceiptsSeeder extends Seeder
|
|||
'polling_verb' => 'get',
|
||||
'polling_header' => 'Authorization: Bearer YOUR_API_KEY',
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.home-assistant',
|
||||
'render_markup_view' => 'recipes.home-assistant',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'thermometer',
|
||||
Loading…
Add table
Add a link
Reference in a new issue