diff --git a/app/Http/Livewire/Tables/BitcoinEventTable.php b/app/Http/Livewire/Tables/BitcoinEventTable.php index d33225c8..ab2ce38a 100644 --- a/app/Http/Livewire/Tables/BitcoinEventTable.php +++ b/app/Http/Livewire/Tables/BitcoinEventTable.php @@ -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); } } diff --git a/app/Nova/BitcoinEvent.php b/app/Nova/BitcoinEvent.php index 7ae1b3dc..e034f63d 100644 --- a/app/Nova/BitcoinEvent.php +++ b/app/Nova/BitcoinEvent.php @@ -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()) diff --git a/database/migrations/2022_12_15_144111_add_show_worldwide_field_to_bitcoin_events_table.php b/database/migrations/2022_12_15_144111_add_show_worldwide_field_to_bitcoin_events_table.php new file mode 100644 index 00000000..4e672511 --- /dev/null +++ b/database/migrations/2022_12_15_144111_add_show_worldwide_field_to_bitcoin_events_table.php @@ -0,0 +1,30 @@ +boolean('show_worldwide') + ->default(false); + }); + } + + /** + * Reverse the migrations. + * @return void + */ + public function down() + { + Schema::table('bitcoin_events', function (Blueprint $table) { + // + }); + } +}; diff --git a/lang/de.json b/lang/de.json index d08d27f7..7479498c 100644 --- a/lang/de.json +++ b/lang/de.json @@ -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",