show_worldwide added

This commit is contained in:
Benjamin Takats
2022-12-15 15:46:07 +01:00
parent bf6c281342
commit 2b28685b9a
4 changed files with 38 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ class BitcoinEventTable extends DataTableComponent
public function builder(): Builder
{
return BitcoinEvent::query()
->whereHas('venue.city.country', fn($query) => $query->where('code', $this->country));
->whereHas('venue.city.country', fn($query) => $query->where('code', $this->country))
->orWhere('show_worldwide', true);
}
}

View File

@@ -8,6 +8,7 @@ use Ebess\AdvancedNovaMediaLibrary\Fields\Images;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
@@ -61,6 +62,9 @@ class BitcoinEvent extends Resource
Images::make(__('Logo'), 'logo')
->conversionOnIndexView('thumb'),
Boolean::make(__('Show worldwide'), 'show_worldwide')
->help(__('If checked, the event will be shown everywhere.')),
DateTime::make(__('From'), 'from')
->step(CarbonInterval::minutes(15))
->displayUsing(fn($value) => $value->asDateTime())

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
* @return void
*/
public function up()
{
Schema::table('bitcoin_events', function (Blueprint $table) {
$table->boolean('show_worldwide')
->default(false);
});
}
/**
* Reverse the migrations.
* @return void
*/
public function down()
{
Schema::table('bitcoin_events', function (Blueprint $table) {
//
});
}
};

View File

@@ -1,4 +1,6 @@
{
"Show worldwide": "Länderunabhängig anzeigen",
"If checked, the event will be shown everywhere.": "Wenn aktiviert, wird das Event überall angezeigt.",
"Orange Pill Book Case": "Wie viele Bitcoin-Bücher hast du hinzu gefügt?",
"Title": "Titel",
"Book": "Buch",