Merge branch '3.x' into 4.x

This commit is contained in:
Dan Harrin
2024-10-07 13:56:01 +01:00
6 changed files with 38 additions and 28 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
github: [danharrin, zepfietje]
github: [danharrin]
polar: filamentphp
@@ -142,19 +142,16 @@ DatabaseNotifications::pollingInterval(null);
Alternatively, the package has a native integration with [Laravel Echo](https://laravel.com/docs/broadcasting#client-side-installation). Make sure Echo is installed, as well as a [server-side websockets integration](https://laravel.com/docs/broadcasting#server-side-installation) like Pusher.
Once websockets are set up, after sending a database notification you may dispatch a `DatabaseNotificationsSent` event, which will immediately fetch new notifications for that user:
Once websockets are set up, you can automatically dispatch a `DatabaseNotificationsSent` event by setting the `isEventDispatched` parameter to `true` when sending the notification. This will trigger the immediate fetching of new notifications for the user:
```php
use Filament\Notifications\Events\DatabaseNotificationsSent;
use Filament\Notifications\Notification;
$recipient = auth()->user();
Notification::make()
->title('Saved successfully')
->sendToDatabase($recipient);
event(new DatabaseNotificationsSent($recipient));
->sendToDatabase($recipient, isEventDispatched: true);
```
## Marking database notifications as read
+10
View File
@@ -0,0 +1,10 @@
@layer base {
:root.dark {
color-scheme: dark;
}
/* When scrolling to validation error, do not hide element behind the top bar */
[data-field-wrapper] {
scroll-margin-top: 8rem;
}
}
+5 -14
View File
@@ -1,15 +1,6 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind variants;
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@import 'tailwindcss/variants';
@layer base {
:root.dark {
color-scheme: dark;
}
/* When scrolling to validation error, do not hide element behind the top bar */
[data-field-wrapper] {
scroll-margin-top: 8rem;
}
}
@import 'base.css';
@@ -26,25 +26,37 @@ class MakeIssueCommand extends Command
public function handle(): void
{
$this->openUrlInBrowser('https://github.com/filamentphp/filament/issues/new?' . http_build_query([
$url = 'https://github.com/filamentphp/filament/issues/new?' . http_build_query([
'template' => 'bug_report.yml',
'package-version' => InstalledVersions::getPrettyVersion('filament/support'),
'laravel-version' => InstalledVersions::getPrettyVersion('laravel/framework'),
'livewire-version' => InstalledVersions::getPrettyVersion('livewire/livewire'),
'php-version' => PHP_VERSION,
]));
]);
$result = $this->openUrlInBrowser($url);
if ($result !== 0) {
$this->components->error('An error occurred while trying to open the issue page in your browser.');
$this->output->writeln(' <comment>Please open the following URL in your browser:</>');
$this->output->writeln(' <href="' . $url . '">' . $url . '</>');
}
}
public function openUrlInBrowser(string $url): void
public function openUrlInBrowser(string $url): int
{
$result = -1;
if (PHP_OS_FAMILY === 'Darwin') {
exec('open "' . $url . '"');
exec('open "' . $url . '"', result_code: $result);
}
if (PHP_OS_FAMILY === 'Linux') {
exec('xdg-open "' . $url . '"');
exec('xdg-open "' . $url . '"', result_code: $result);
}
if (PHP_OS_FAMILY === 'Windows') {
exec('start "" "' . $url . '"');
exec('start "" "' . $url . '"', result_code: $result);
}
return $result;
}
}
@@ -44,7 +44,7 @@
<x-filament-tables::cell
class="text-sm font-medium text-gray-950 dark:text-white"
>
<span class="px-3 py-4">
<span class="fi-ta-summary-row-heading px-3 py-4">
{{ $heading }}
</span>
</x-filament-tables::cell>
@@ -92,7 +92,7 @@
>
@if ($loop->first && (! $extraHeadingColumn) && (! $groupsOnly))
<span
class="flex px-3 py-4 text-sm font-medium text-gray-950 dark:text-white"
class="fi-ta-summary-row-heading flex px-3 py-4 text-sm font-medium text-gray-950 dark:text-white"
>
{{ $heading }}
</span>