Skip to content

Commit 8b598be

Browse files
committed
Merge branch 'main' into mobile-v2-docs
2 parents bbffdc9 + dceb83a commit 8b598be

File tree

7 files changed

+99
-10
lines changed

7 files changed

+99
-10
lines changed

app/Filament/Resources/ArticleResource.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use App\Filament\Resources\ArticleResource\Actions\PreviewAction;
66
use App\Filament\Resources\ArticleResource\Actions\PublishAction;
7-
use App\Filament\Resources\ArticleResource\Actions\ScheduleAction;
87
use App\Filament\Resources\ArticleResource\Actions\UnpublishAction;
98
use App\Filament\Resources\ArticleResource\Pages;
109
use App\Models\Article;
@@ -80,10 +79,6 @@ public static function table(Table $table): Table
8079
->searchable()
8180
->sortable(),
8281

83-
TextColumn::make('excerpt')
84-
->searchable()
85-
->limit(50),
86-
8782
TextColumn::make('author.name')
8883
->label('Author')
8984
->searchable()
@@ -106,7 +101,6 @@ public static function table(Table $table): Table
106101
Tables\Actions\EditAction::make()->url(fn ($record) => static::getUrl('edit', ['record' => $record->id])),
107102
UnpublishAction::make('unpublish'),
108103
PublishAction::make('publish'),
109-
ScheduleAction::make('schedule'),
110104
]),
111105
])
112106
->bulkActions([

app/Filament/Resources/ArticleResource/Actions/PublishAction.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
namespace App\Filament\Resources\ArticleResource\Actions;
44

55
use App\Models\Article;
6+
use Filament\Forms\Components\DateTimePicker;
7+
use Filament\Forms\Components\Radio;
68
use Filament\Tables\Actions\Action;
9+
use Illuminate\Support\Carbon;
710

811
class PublishAction extends Action
912
{
@@ -12,8 +15,31 @@ protected function setUp(): void
1215
$this
1316
->label('Publish')
1417
->icon('heroicon-o-newspaper')
15-
->action(fn (Article $article) => $article->publish())
1618
->visible(fn (Article $article) => ! $article->isPublished())
17-
->requiresConfirmation();
19+
->form([
20+
Radio::make('publish_type')
21+
->label('Publish Options')
22+
->options([
23+
'now' => 'Publish Now',
24+
'schedule' => 'Schedule for Later',
25+
])
26+
->default('now')
27+
->live()
28+
->required(),
29+
DateTimePicker::make('published_at')
30+
->label('Published At')
31+
->displayFormat('M j, Y H:i')
32+
->seconds(false)
33+
->afterOrEqual('now')
34+
->visible(fn ($get) => $get('publish_type') === 'schedule')
35+
->required(fn ($get) => $get('publish_type') === 'schedule'),
36+
])
37+
->action(function (Article $article, array $data) {
38+
if ($data['publish_type'] === 'now') {
39+
$article->publish();
40+
} else {
41+
$article->publish(Carbon::parse($data['published_at']));
42+
}
43+
});
1844
}
1945
}

app/Filament/Resources/ArticleResource/Pages/EditArticle.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,40 @@ protected function afterSave(): void
2626
protected function getHeaderActions(): array
2727
{
2828
return [
29+
Actions\Action::make('preview')
30+
->label('Preview')
31+
->icon('heroicon-o-eye')
32+
->url(fn () => route('article', $this->record))
33+
->openUrlInNewTab(),
34+
Actions\Action::make('publish')
35+
->label('Publish')
36+
->icon('heroicon-o-newspaper')
37+
->visible(fn () => ! $this->record->isPublished())
38+
->form([
39+
\Filament\Forms\Components\Radio::make('publish_type')
40+
->label('Publish Options')
41+
->options([
42+
'now' => 'Publish Now',
43+
'schedule' => 'Schedule for Later',
44+
])
45+
->default('now')
46+
->live()
47+
->required(),
48+
\Filament\Forms\Components\DateTimePicker::make('published_at')
49+
->label('Published At')
50+
->displayFormat('M j, Y H:i')
51+
->seconds(false)
52+
->afterOrEqual('now')
53+
->visible(fn ($get) => $get('publish_type') === 'schedule')
54+
->required(fn ($get) => $get('publish_type') === 'schedule'),
55+
])
56+
->action(function (array $data) {
57+
if ($data['publish_type'] === 'now') {
58+
$this->record->publish();
59+
} else {
60+
$this->record->publish(\Illuminate\Support\Carbon::parse($data['published_at']));
61+
}
62+
}),
2963
Actions\DeleteAction::make(),
3064
];
3165
}

config/filament.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
return [
44

5-
'users' => str_getcsv(env('FILAMENT_USERS') ?: ''),
5+
'users' => str_getcsv(env('FILAMENT_USERS') ?: '', escape: ''),
66

77
/*
88
|--------------------------------------------------------------------------

resources/views/components/home/partners.blade.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class="text-2xl font-bold text-gray-800 lg:text-3xl dark:text-white"
4040
<div class="mt-5 flex flex-wrap gap-5 lg:mt-7 lg:flex-nowrap">
4141
{{-- Featured partners --}}
4242
<div
43-
class="grid w-full grid-cols-1 gap-5 md:grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] lg:w-auto lg:grid-cols-1"
43+
class="grid w-full grid-cols-1 gap-5 md:grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] lg:w-4/5 lg:grid-cols-1"
4444
aria-label="Featured partners of the NativePHP project"
4545
>
4646
<x-home.featured-partner-card
@@ -61,6 +61,24 @@ class="text-black dark:text-white"
6161
customer experiences.
6262
</x-slot>
6363
</x-home.featured-partner-card>
64+
65+
<x-home.featured-partner-card
66+
partnerName="Web Mavens"
67+
tagline="Build Secure, Scalable Web Apps"
68+
href="https://www.webmavens.com/?ref=nativephp"
69+
>
70+
<x-slot:logo>
71+
<x-sponsors.logos.webmavens
72+
class="dark:fill-white"
73+
aria-hidden="true"
74+
/>
75+
</x-slot>
76+
77+
<x-slot:description>
78+
Laravel Partners crafting secure, SOC 2–ready apps with NativePHP and modern web technologies.
79+
Trusted by healthcare and enterprise teams, and friendly to startups too.
80+
</x-slot>
81+
</x-home.featured-partner-card>
6482
<x-home.featured-partner-card
6583
partnerName="Laradevs"
6684
tagline="Hire the best Laravel developers anywhere"

resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ class="block h-auto max-h-8 max-w-full text-black dark:text-white"
1212
<span class="sr-only">Nexcalia</span>
1313
</a>
1414

15+
<a
16+
href="https://www.webmavens.com/?ref=nativephp"
17+
title="Learn more about Web Mavens"
18+
aria-label="Visit Web Mavens website"
19+
class="inline-grid h-16 w-full shrink-0 place-items-center rounded-2xl bg-gray-100 px-5 transition duration-200 hover:bg-gray-200/70 hover:ring-1 hover:ring-black/60 dark:bg-mirage dark:hover:bg-haiti dark:hover:ring-cloud"
20+
rel="noopener sponsored"
21+
>
22+
<x-sponsors.logos.webmavens
23+
class="block h-auto max-h-8 max-w-full dark:fill-white"
24+
aria-hidden="true"
25+
/>
26+
<span class="sr-only">Web Mavens</span>
27+
</a>
28+
1529
<a
1630
href="https://laradevs.com/?ref=nativephp"
1731
title="Learn more about Laradevs"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<svg {{ $attributes }} version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 545 78" fill="#263c8f">
2+
<path d="m64.8 3.6h17.6l-8 70.4h-22.9q-1.7-9.2-3-17.8-1.3-8.7-2.6-19.1-0.5 4.2-1 8.1-0.5 3.9-0.9 7.1-0.4 3.1-1.2 8.7-0.8 5.7-1.9 13h-22.7l-8.2-70.4h17.8l1.9 24.6 1.9 23.6q0.3-6.7 1-13.9 0.6-7.3 1.7-16.5 1.1-9.2 2.3-17.8h19.1q0.2 1.7 1.9 23.2l2.1 26.8q1.4-25.6 5.1-50zm28.9 70.4v-70.3h30.5v14.1h-12.3v13.3h11.5v13.3h-11.5v15.5h13.4v14.1zm44.6 0v-70.4h18.3q8.8 0 13.1 1.4 4.4 1.3 7.2 5.5 2.6 4.1 2.6 13.2 0 6.2-1.8 8.5-2.1 2.6-7.7 3.8 6.4 1.5 8.7 4.7 2.2 3.2 2.2 10.3v6.4q0 7.4-1.6 10.6-1.7 3.6-5.2 4.7-3.7 1.3-14.6 1.3zm18.2-58.3v15.7q0.8-0.1 1.9-0.1 2.7 0 3.4-1.4 0.8-1.3 0.8-7.5 0-3.4-0.6-4.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