mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
* feat add example receipt "zen"
This commit is contained in:
parent
4485e20725
commit
88f90ff9ae
2 changed files with 90 additions and 0 deletions
72
database/seeders/ExampleReceiptsSeeder.php
Normal file
72
database/seeders/ExampleReceiptsSeeder.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Plugin;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ExampleReceiptsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Plugin::create(
|
||||
[
|
||||
'uuid' => '9e46c6cf-358c-4bfe-8998-436b3a207fec',
|
||||
'name' => 'ÖBB Departures',
|
||||
'user_id' => '1',
|
||||
'data_payload' => null,
|
||||
'data_stale_minutes' => 15,
|
||||
'data_strategy' => 'polling',
|
||||
'polling_url' => 'https://dbf.finalrewind.org/Wien%20Hbf.json?detailed=1&version=3&limit=8&admode=dep&hafas=%C3%96BB&platforms=1%2C2',
|
||||
'polling_verb' => 'get',
|
||||
'polling_header' => null,
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.train',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'train-front',
|
||||
]
|
||||
);
|
||||
|
||||
Plugin::create(
|
||||
[
|
||||
'uuid' => '3b046eda-34e9-4232-b935-c33b989a284b',
|
||||
'name' => 'Weather',
|
||||
'user_id' => '1',
|
||||
'data_payload' => null,
|
||||
'data_stale_minutes' => 60,
|
||||
'data_strategy' => 'polling',
|
||||
'polling_url' => 'https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=48.2083&lon=16.3731',
|
||||
'polling_verb' => 'get',
|
||||
'polling_header' => null,
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.weather',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'sun',
|
||||
]
|
||||
);
|
||||
|
||||
Plugin::create(
|
||||
[
|
||||
'uuid' => '21464b16-5f5a-4099-a967-f5c915e3da54',
|
||||
'name' => 'Zen Quotes',
|
||||
'user_id' => '1',
|
||||
'data_payload' => null,
|
||||
'data_stale_minutes' => 720,
|
||||
'data_strategy' => 'polling',
|
||||
'polling_url' => 'https://zenquotes.io/api/today',
|
||||
'polling_verb' => 'get',
|
||||
'polling_header' => null,
|
||||
'render_markup' => null,
|
||||
'render_markup_view' => 'receipts.zen',
|
||||
'detail_view_route' => null,
|
||||
'icon_url' => null,
|
||||
'flux_icon_name' => 'chat-bubble-bottom-center',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
18
resources/views/receipts/zen.blade.php
Normal file
18
resources/views/receipts/zen.blade.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{{--@dump($data)--}}
|
||||
<x-trmnl::view>
|
||||
<x-trmnl::layout>
|
||||
<x-trmnl::layout class="layout--col">
|
||||
<div class="b-h-gray-1">{{$data[0]['a']}}</div>
|
||||
@if (strlen($data[0]['q']) < 300)
|
||||
<p class="value">{{ $data[0]['q'] }}</p>
|
||||
@else
|
||||
<p class="value--small">{{ $data[0]['q'] }}</p>
|
||||
@endif
|
||||
</x-trmnl::layout>
|
||||
</x-trmnl::layout>
|
||||
|
||||
<div class="title_bar">
|
||||
<img class="image" src="https://img.icons8.com/books"/>
|
||||
<span class="title">Zen Quotes</span>
|
||||
</div>
|
||||
</x-trmnl::view>
|
||||
Loading…
Add table
Add a link
Reference in a new issue