Skip to content

Commit 918d5c5

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 06ae492 + 5e051f8 commit 918d5c5

File tree

590 files changed

+4316
-1228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

590 files changed

+4316
-1228
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ composer.lock
66
docs/dist
77
docs/filament
88
docs/node_modules
9+
docs/preserved-dist
910
docs/src/navigation.json
1011
docs/src/pages
1112
docs/torchlight-cache

app/Http/Controllers/Plugins/ListPluginsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __invoke(GetPluginsListData $getPluginsListData)
3535
'pluginsCount' => Plugin::count(),
3636
'plugins' => $getPluginsListData(),
3737
'featuredPlugins' => $getPluginsListData([
38-
'filament-themes',
38+
'zepfietje-themes',
3939
'kenneth-sese-advanced-tables',
4040
'ralphjsmit-media-library-manager',
4141
]),

app/Http/Controllers/Plugins/ViewPluginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __invoke(GetPluginsListData $getPluginsListData, string $plugin)
2222
->image($plugin->getImageUrl() ?? $plugin->getThumbnailUrl());
2323

2424
$featuredPlugins = [
25-
'filament-themes',
25+
'zepfietje-themes',
2626
'kenneth-sese-advanced-tables',
2727
'ralphjsmit-media-library-manager',
2828
];

app/Models/Article.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function isCompatibleWithLatestVersion(): ?bool
7474
return null;
7575
}
7676

77-
return in_array(3, $this->versions);
77+
return in_array(4, $this->versions);
7878
}
7979

8080
public function getAuthor(): Author

app/Models/Plugin.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ public function getDocUrl(string $version = null): ?string
8585
}
8686

8787
if (filled($this->docs_urls)) {
88-
return $this->docs_urls[$version ?? key($this->docs_urls)] ?? null;
88+
$docsUrls = $this->docs_urls;
89+
krsort($docsUrls);
90+
91+
return $docsUrls[$version ?? array_key_first($docsUrls)] ?? null;
8992
}
9093

9194
return null;
@@ -174,7 +177,7 @@ public function getCategories(): Collection
174177

175178
public function isCompatibleWithLatestVersion(): bool
176179
{
177-
return in_array(3, $this->versions);
180+
return in_array(4, $this->versions);
178181
}
179182

180183
public function getAuthor(): Author

app/Providers/AppServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public function boot(): void
4949
'plugin' => Plugin::class,
5050
]);
5151

52-
URL::forceScheme('https');
52+
if ($this->app->environment('production')) {
53+
URL::forceScheme('https');
54+
}
5355

5456
RateLimiter::for('vpn_api', function (CheckIfIpIsVpn $job): Limit {
5557
if (

app/Support/Markdown.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use Illuminate\Support\HtmlString;
77
use League\CommonMark\Environment\Environment;
88
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
9+
use League\CommonMark\Extension\Embed\Bridge\OscaroteroEmbedAdapter;
10+
use League\CommonMark\Extension\Embed\EmbedExtension;
911
use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension;
1012
use League\CommonMark\Extension\Table\TableExtension;
1113
use League\CommonMark\Extension\TableOfContents\TableOfContentsExtension;
@@ -17,38 +19,47 @@ class Markdown implements Htmlable, Stringable
1719
{
1820
protected Environment $environment;
1921

20-
public function __construct(protected string $content)
22+
public function __construct(protected string $content, bool $hasTableOfContents = true, protected bool $shouldSanitize = true)
2123
{
2224
$this->environment = new Environment([
2325
'allow_unsafe_links' => false,
26+
'embed' => [
27+
'adapter' => new OscaroteroEmbedAdapter,
28+
'allowed_domains' => ['youtube.com', 'youtube-nocookie.com'],
29+
'fallback' => 'link',
30+
],
2431
'heading_permalink' => [
2532
'html_class' => 'heading-anchor',
2633
'id_prefix' => '',
2734
'fragment_prefix' => '',
2835
'symbol' => '#',
2936
'title' => 'Permalink',
3037
],
31-
'table_of_contents' => [
38+
...$hasTableOfContents ? ['table_of_contents' => [
3239
'html_class' => 'table-of-contents',
3340
'position' => 'top',
3441
'style' => 'bullet',
3542
'min_heading_level' => 2,
3643
'max_heading_level' => 6,
3744
'normalize' => 'relative',
3845
'placeholder' => null,
39-
],
46+
]] : [],
4047
]);
4148

4249
$this->environment->addExtension(new CommonMarkCoreExtension);
50+
$this->environment->addExtension(new EmbedExtension);
4351
$this->environment->addExtension(new TableExtension);
4452
$this->environment->addExtension(new HeadingPermalinkExtension);
4553
$this->environment->addExtension(new TorchlightExtension);
46-
$this->environment->addExtension(new TableOfContentsExtension);
54+
55+
if ($hasTableOfContents) {
56+
$this->environment->addExtension(new TableOfContentsExtension);
57+
}
4758
}
4859

49-
public static function parse(string $text): static
60+
public static function parse(string $text, bool $hasTableOfContents = true, bool $shouldSanitize = true): static
5061
{
51-
$static = app(static::class, ['content' => $text]);
62+
$static = app(static::class, ['content' => $text, 'hasTableOfContents' => $hasTableOfContents, 'shouldSanitize' => $shouldSanitize]);
5263

5364
$static->convert();
5465
$static->removeH1Tags();
@@ -140,6 +151,10 @@ public function convertVideoToHtml(): static
140151

141152
public function __toString(): string
142153
{
154+
if (! $this->shouldSanitize) {
155+
return $this->content;
156+
}
157+
143158
return str($this->content)->sanitizeHtml();
144159
}
145160

build/doctum/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
/vendor
1+
/build
2+
/cache
3+
/filament
4+
/vendor

build/doctum/doctum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
'default_opened_level' => 2,
2727
'remote_repository' => new GitHubRemoteRepository('filamentphp/filament', dirname($dir)),
2828
'base_url' => 'https://filamentphp.com/api/%version%/',
29-
]);
29+
]);
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
---
2+
title: "All About the Filament v4 Beta Release"
3+
slug: alexandersix-all-about-the-filament-v4-beta-release
4+
author_slug: alexandersix
5+
publish_date: 2025-04-25
6+
categories: [general]
7+
type_slug: news
8+
---
9+
10+
![All about the Filament v4 Beta release](/images/content/articles/alexandersix-all-about-the-filament-v4-beta-release/v4-beta-release.webp)
11+
12+
## It's time for v4 Beta details
13+
14+
We've had a lot of exciting news come from the Filament project over the past
15+
few years, but none has been more avidly requested than news on the v4
16+
release. Well, today, in this post, we're going to drop some exciting details
17+
about the v4 Beta that will be released in the near future. Get excited,
18+
because it's almost time!
19+
20+
## Filament v4
21+
22+
Filament v4 is the biggest, most feature-packed release that Filament has
23+
ever had. Honestly, until I looked hard into all of the features that are
24+
being released, I was pretty skeptical of that. After all, Filament v3
25+
was a MASSIVE release that was over 100 minor versions in the making!
26+
We're pumped for all of you in the Filament community to get your hands
27+
on v4 and let us know what you think of all the hard work that the team
28+
has poured into this latest major release!
29+
30+
Before we get to the launch details (ooooh the suspense!), let's talk a bit
31+
about some of the features that the team is most excited about that are
32+
coming in Filament v4:
33+
34+
### Nested Resources
35+
36+
One of the longest-running requests that we've received for Filament is
37+
to build nested resources right into Filament. Now, with v4, we've done
38+
just that!
39+
40+
For those who may have never heard of nested resources, what these will
41+
allow you to do is operate on a given Filament resource within the context
42+
of a parent resource. For example, when working on a learning-management
43+
system, you'd likely have a `CourseResource` class to back your `Course`
44+
model. Within a `Course`, you'd also likely have many related `Lesson`
45+
objects that contain the actual lesson material.
46+
47+
Previously, in v3, you could edit related `Lesson` records via a modal
48+
within the `CourseResource`. This would open a modal with a form where
49+
you could make your adjustments. However, in the case of something like
50+
a `Lesson`, a simple modal form may not actually be enough. Instead, you
51+
may have preferred to edit a `Lesson` in the context of its related
52+
`Course`, but in a full page. Now, in v4, nested resources allow you to
53+
do these edits of a child resource in the context of its parent.
54+
55+
Creating a nested resource is easy--you use the `make:filament-resource`
56+
command as you would to create a normal resource, but you tack on
57+
the `--nested` flag. Once done, you will end up with a `Resource`
58+
class that is connected to its parent resource and can be edited
59+
in the context of its parent.
60+
61+
We're really excited about this addition, and we hope that it's
62+
a simple, enjoyable solution that you can use in your Filament applications!
63+
64+
### Multi-Factor Authentication
65+
66+
For a long time, the Panel package within Filament has included an authentication
67+
system for logging in, registering, etc. Without any tweaks, this system
68+
has worked extremely well for lots of applications. However, while a
69+
standard email/password only authentication system works for many apps, we
70+
fully acknowledge that there's a need for more layers of security built
71+
in for other types of applications.
72+
73+
In general, we consider multi-factor authentication to be almost a
74+
necessity in the modern era of application authentication, so in an
75+
effort to help developers build more secure applications, we've done
76+
the heavy lifting for you!
77+
78+
In the interest of giving developers more options, we have upgraded our
79+
authentication system for v4 to include multi-factor authentication as an
80+
option out of the box! When MFA is enabled by the application developer,
81+
users will need to take an additional step when registering and logging
82+
into the application to set up multi factor auth. You can allow users to
83+
use either the Google two-factor auth system (ex: Google Authenticator) or
84+
the email code authentication system (ex: sending a one-time password to
85+
the given email address).
86+
87+
That's it! All you have to do is enable the system and Filament will
88+
do the work for you! No setting up the MFA registration UI, no managing
89+
the MFA authentication flow; it's all taken care of with the flip of a switch.
90+
91+
### Static Table Data
92+
93+
Another common request that we've heard a lot over the years is allowing
94+
developers to use Filament tables with data that isn't backed by a `Model`
95+
class. In the past, our recommendation has been to create a "Model" backed
96+
by [Sushi](https://usesushi.dev/), but this doesn't work in all situations.
97+
98+
Because of this, we have spent a lot of time going back to the drawing
99+
board for Filament's tables, and they are now able to take in static, non-Model
100+
data and display them with all of the same features and niceties that you
101+
know and love from the existing Filament tables package!
102+
103+
To add static data to a Filament table, it's as simple as passing an array
104+
of the data that you'd like to display into the `records()` method that
105+
is now present on the `Table` object. Once you've done that, Filament
106+
will render out whatever data you passed in. Nice and simple!
107+
108+
### Unified Schemas & Actions
109+
110+
While we were ripping out the Filament Tables package and rebuilding it
111+
for static data, we figured it was a good time to perform some restructuring
112+
of the Forms, Infolists, and Actions as well.
113+
114+
In v3, Form components live in the `Forms` namespace and Infolist components
115+
live in the `Infolist` namespace. However, as we stepped back and looked
116+
at these two systems, we noticed that they have a lot in common and could
117+
benefit a lot by being intertwined. So, in v4 we have migrated all Form
118+
and Infolist components into the `Schema` namespace. This means that you'll
119+
have one less namespace to worry about, but more importantly, you can now
120+
mix and match Form and Infolist components in the same Schema area!
121+
122+
In a similar vein, in Filament v3, Actions have always been a bit of a tripping
123+
hazard for developers of all levels. When going to use an Action, it was
124+
fairly common to start typing out the `Action` class into your code editor,
125+
just to have it autocomplete the import for the _wrong_ `Action` class.
126+
Additionally, when creating custom Actions, it was far too easy to accidentally
127+
extend the wrong Action or to need to create multiples of the same Action
128+
just to use it in a Form, Infolist, Table, etc. To combat all of this, we
129+
have updated Actions to (almost) all extend from the same base Action class.
130+
This then means that you'll practically never import the wrong Action class
131+
again, and, more importantly, you can now create Actions that are reusable
132+
across multiple different Filament packages (Forms, Infolists, Tables, etc.).
133+
134+
### Performance Improvements
135+
136+
Last, but certainly not least, the team has been hard at work knocking
137+
out some incredible performance improvements within the Filament codebase.
138+
We've scoured each and every class to figure out where the biggest bottlenecks
139+
existed in v3, and in doing so, we have seen **MASSIVE** performance boost
140+
in specific applications when upgrading to Filament v4. There's a lot of
141+
technical details surrounding these performance enhancements that we'll
142+
likely need to make an entirely separate post about, but when you get your
143+
hands on v4, let us know if you notice your applications running more quickly
144+
after the upgrade!
145+
146+
## The announcement we've all been waiting for
147+
148+
Speaking of getting our hands on the v4 Beta, by reading all of the way
149+
through this post (I _know_ you didn't just skip down here, right?), I think
150+
you've earned the right to know that the Filament team has officially settled
151+
on a v4 Beta release date.
152+
153+
You won't have to wait much longer, because we will be releasing the Filament v4 Beta on June 10, 2025 at [Laravel Live UK](https://laravellive.uk)!
154+
155+
We're so excited for you all to get your hands on v4 and let us know. Remember
156+
that this upcoming release **IS STILL JUST A BETA**, so we don't recommend
157+
using this in any production or otherwise mission-critical applications.
158+
159+
What are you most excited for in v4? Hit us up on Twitter or Bluesky
160+
and let us know what you're looking forward to most!

0 commit comments

Comments
 (0)