Skip to content
Merged

4.x #868

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Models/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function isCompatibleWithLatestVersion(): ?bool
return null;
}

return in_array(3, $this->versions);
return in_array(4, $this->versions);
}

public function getAuthor(): Author
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function getCategories(): Collection

public function isCompatibleWithLatestVersion(): bool
{
return in_array(3, $this->versions);
return in_array(4, $this->versions);
}

public function getAuthor(): Author
Expand Down
27 changes: 21 additions & 6 deletions app/Support/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use Illuminate\Support\HtmlString;
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use League\CommonMark\Extension\Embed\Bridge\OscaroteroEmbedAdapter;
use League\CommonMark\Extension\Embed\EmbedExtension;
use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension;
use League\CommonMark\Extension\Table\TableExtension;
use League\CommonMark\Extension\TableOfContents\TableOfContentsExtension;
Expand All @@ -17,38 +19,47 @@ class Markdown implements Htmlable, Stringable
{
protected Environment $environment;

public function __construct(protected string $content)
public function __construct(protected string $content, bool $hasTableOfContents = true, protected bool $shouldSanitize = true)
{
$this->environment = new Environment([
'allow_unsafe_links' => false,
'embed' => [
'adapter' => new OscaroteroEmbedAdapter,
'allowed_domains' => ['youtube.com', 'youtube-nocookie.com'],
'fallback' => 'link',
],
'heading_permalink' => [
'html_class' => 'heading-anchor',
'id_prefix' => '',
'fragment_prefix' => '',
'symbol' => '#',
'title' => 'Permalink',
],
'table_of_contents' => [
...$hasTableOfContents ? ['table_of_contents' => [
'html_class' => 'table-of-contents',
'position' => 'top',
'style' => 'bullet',
'min_heading_level' => 2,
'max_heading_level' => 6,
'normalize' => 'relative',
'placeholder' => null,
],
]] : [],
]);

$this->environment->addExtension(new CommonMarkCoreExtension);
$this->environment->addExtension(new EmbedExtension);
$this->environment->addExtension(new TableExtension);
$this->environment->addExtension(new HeadingPermalinkExtension);
$this->environment->addExtension(new TorchlightExtension);
$this->environment->addExtension(new TableOfContentsExtension);

if ($hasTableOfContents) {
$this->environment->addExtension(new TableOfContentsExtension);
}
}

public static function parse(string $text): static
public static function parse(string $text, bool $hasTableOfContents = true, bool $shouldSanitize = true): static
{
$static = app(static::class, ['content' => $text]);
$static = app(static::class, ['content' => $text, 'hasTableOfContents' => $hasTableOfContents, 'shouldSanitize' => $shouldSanitize]);

$static->convert();
$static->removeH1Tags();
Expand Down Expand Up @@ -140,6 +151,10 @@ public function convertVideoToHtml(): static

public function __toString(): string
{
if (! $this->shouldSanitize) {
return $this->content;
}

return str($this->content)->sanitizeHtml();
}

Expand Down
5 changes: 4 additions & 1 deletion build/doctum/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/vendor
/build
/cache
/filament
/vendor
2 changes: 1 addition & 1 deletion build/doctum/doctum.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
'default_opened_level' => 2,
'remote_repository' => new GitHubRemoteRepository('filamentphp/filament', dirname($dir)),
'base_url' => 'https://filamentphp.com/api/%version%/',
]);
]);
170 changes: 170 additions & 0 deletions content/articles/alexandersix-filament-v4-is-stable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
title: "Filament v4 is Stable!"
slug: alexandersix-filament-v4-is-stable
author_slug: alexandersix
publish_date: 2025-08-12
categories: [general]
type_slug: news
---

![Filament v4 is Stable!](/images/content/articles/alexandersix-filament-v4-is-stable/v4-stable.webp)

It's official! As of today, August 12, 2025, Filament v4 is officially stable!
And in large part, that is thanks to our incredible community and all the help
with testing, bug fixing, and overall recommendations. We don't take for granted
all of you and the work you've put in to help us get to where we are today.

If you haven't been keeping up with the news regarding the v4 beta, or if you're
new to Filament as of version 4, you'll be very happy to know that we have
added in some incredible updates, new features, and overall performance enhancements
to help you build even more incredible applications with Filament. There are
WAY too many to list out here, but for a full rundown of the major updates present
in v4, you can check out this incredible article written by the Filament Core Team's
very own Leandro: ["What's new in Filament v4?"](https://filamentphp.com/content/leandrocfe-whats-new-in-filament-v4)

## What to expect from our favorite updates

We're very excited about the v4 release, so to celebrate, we wanted to share a
few of our favorite features and what you can expect from them when using the
new v4 release!

### Performance Enhancements

You know we couldn't make a list of our favorite updates without touching
on the performance enhancements in v4. Whether you're building a brand-new,
greenfield application on v4 or updating an older version of Filament to v4,
you'll immediately notice some nice speed boosts across your application.

Out of the box, without any adjustments or code changes, you'll immediately
receive a noticeable performance improvement when using Filament's tables!
We have done a lot of work optimizing how the rendering code runs,
and during our internal testing, we see improvements of around 3x for large
datasets!

In addition, we've also added in a custom partial rendering solution that
will allow you to skip expensive component re-renders when they are not needed.
These improvements don't come for free, but they are opt-in with the use of
methods like `partiallyRenderComponentsAfterStateUpdated()` and
`skipRenderAfterStateUpdated()`. There's more to dig into here, so take a
look at the [documentation for partial rendering](https://filamentphp.com/docs/4.x/forms/overview#field-partial-rendering)
for more information on what each of these methods do, specifically.

If video content is more your speed (ha!), take a look at
[this video from Nuno](https://www.youtube.com/watch?v=uJfFURplMQg) where
he and Dan dive more deeply into the performance improvements found in v4!

### Schemas

Ever wanted to easily combine Filament's form fields, infolist entries,
layout components, and prime components (the basic building blocks of
most applications)? Previously, this was a bit of a pain to handle, but
in v4, we've squished all of these together into what we're calling "Schemas"
to more easily allow you to mix and match these different components
together to create truly custom, ergonomic server-driven UIs. You can
consider this a familiar and easy-to-understand re-imagining of how to
combine the building blocks that Filament provides into something that
works exactly as you (and your users) would expect in your app.

For a full list of the available Schema components and more information
about how they're used in general, [check out the documentation](https://filamentphp.com/docs/4.x/schemas/overview#introduction)!

For those of you who prefer to glance at some code, here's an example
schema direct from the documentation! You can see that, within the
same schema (`form`, in this example), we're using components that were
previously located in the Layout, Infolist, and Form namespaces!

```php
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Components\Section;

$schema
->components([
Grid::make(2)
->schema([
Section::make('Details')
->schema([
TextInput::make('name'),
Select::make('position')
->options([
'developer' => 'Developer',
'designer' => 'Designer',
]),
Checkbox::make('is_admin'),
]),
Section::make('Auditing')
->schema([
TextEntry::make('created_at')
->dateTime(),
TextEntry::make('updated_at')
->dateTime(),
]),
]),
])
```

Hopefully this starts the gears turning in your brain! We're
so excited to see what people are capable of with this new, simple
to use system in place in v4.

### Custom Data Tables

I mean, it's about time, right?

In all seriousness, we're so excited about our new table implementation
and the fact that it now allows arbitrary, non-Model-backed data to be
displayed! Now it's just as simple as giving your Filament Table an array
of data to be shown, and we handle the rest for you. No more wrestling with
the underlying Filament components or deferring to Sushi (a great package
in its own right, though) to add custom data to your tables!

The best part is that in this new implementation, custom data, whether
hard-coded, retrieved from an external API, or gleaned from anywhere else,
receives all the same niceties that typical Model-backed data gets. This
means your custom data can be paginated, searched, sorted, and it can
even have Actions attached to it!

For more information, check our our [custom data documentation](https://filamentphp.com/docs/4.x/tables/custom-data)!

### Actions, Actions, Actions

This one is a short one, but a very, very sweet one.

Admit it, we've all done it before: we've wanted to add an Action
somewhere in our Filament application, but we imported the _wrong_
Action type from the _wrong_ namespace. It's not a hard error to
fix, but it's incredibly irritating when it happens.

In v4, this is an issue (mostly) of the past!

We have now unified all of the action classes, so instead of needing
to specifically use the `Action` class that corresponds to your
given context, all actions now use a single `Filament\Actions`
namespace. And, in addition to Action imports being much easier now,
this also means that you can more easily create portable Actions
which can be reused across different contexts (Forms, Infolists, Tables, etc.).

## There's more where that came from

These are just a small handful of the incredible updates that have
been packed into the v4 release.

We're probably a bit biased in saying it, but we think this is easily
one of the greatest Filament releases to date! You can read all about
the update in the documentation or in Leandro's v4 overview post,
but in my opinion, the best way to see what's available is to give it
a try for yourself! Installation is as easy as ever, and the upgrade
path from v3 -> v4 is simple and almost entirely automated thanks to
our custom upgrade scripts (think Laravel Shift, but for Filament).

Once again, we have to give a huge thank you to the entire community
for their constant encouragement and support, as well as for their
contributions to this release. Filament wouldn't be half the project
it is today without all of you, and we're eternally grateful to have
you along for the ride.

Give v4 a whirl, and let us know what you think! We'd love to hear from
you in the Filament Discord server, especially if you're building
something that you're proud of using Filament!
2 changes: 1 addition & 1 deletion content/articles/alexandersix-meet-the-team-hassan.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: alexandersix-meet-the-team-hassan
author_slug: alexandersix
publish_date: 2025-03-29
categories: [general]
type_slug: news
type_slug: article
---

![Meet the Team: Hassan Zahirnia](/images/content/articles/alexandersix-meet-the-team-hassan/meet-the-team-hassan.webp)
Expand Down
2 changes: 1 addition & 1 deletion content/articles/alexandersix-meet-the-team-kenneth.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: alexandersix-meet-the-team-kenneth-sese
author_slug: alexandersix
publish_date: 2025-01-30
categories: [general]
type_slug: news
type_slug: article
---

![Meet the Team: Kenneth Sese](/images/content/articles/alexandersix-meet-the-team-kenneth/meet-the-team-kenneth.webp)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
---
title: Filament v4 Beta - Feature Overview
slug: leandrocfe-filament-v4-beta-feature-overview
title: What's new in Filament v4? - Feature Overview
slug: leandrocfe-whats-new-in-filament-v4
author_slug: leandrocfe
publish_date: 2025-06-09
publish_date: 2025-08-12
categories: [general]
type_slug: article
versions: [3,4]
versions: [4]
---

![Filament v4 Beta - Feature Overview](/images/content/articles/leandrocfe-filament-v4-beta-feature-overview/v4-beta-feature-overview.webp)
![What's new in Filament v4](/images/content/articles/leandrocfe-whats-new-in-filament-v4/v4-whats-new.webp)

## Introduction

The **Filament v4 Beta** is here with a range of powerful, helpful updates. It's faster, easier to use, and gives you more control when building applications. In this article, we highlight what's new and how these changes can improve your workflow!
**Filament v4** is here with a range of powerful, helpful updates. It's faster, easier to use, and gives you more control when building applications. In this article, we highlight what's new and how these changes can improve your workflow!

To upgrade your app to Filament v4 beta, please read the [upgrade guide](https://filamentphp.com/docs/4.x/upgrade-guide). To install Filament v4 into a new app, please visit the [installation guide](https://filamentphp.com/docs/4.x/introduction/installation).

> You are currently viewing the features for Filament `4.x`, which is currently in `beta` and is not `stable`. Breaking changes may be introduced to releases during the beta period. Please report any issues you encounter on [GitHub](https://github.com/filamentphp/filament/issues/new).

> Looking for the current stable version? Visit the [3.x documentation](https://filamentphp.com/docs/3.x).
To upgrade your app to Filament v4, please read the [upgrade guide](https://filamentphp.com/docs/4.x/upgrade-guide). To install Filament v4 into a new app, please visit the [installation guide](https://filamentphp.com/docs/4.x/introduction/installation).

## Highlights

Expand All @@ -34,6 +30,10 @@ There are many new features and improvements in Filament v4 Beta, but here are s
- [**Improved bulk action system**](#bulk-actions): Authorize individual records in bulk actions, use notifications to inform users of bulk action results with success and failure counts grouped by failure reason, and benefit from improved performance through chunked processing of selected records.
- [**Restructured documentation**](https://filamentphp.com/docs/4.x): The Filament documentation has been restructured to provide a clearer overview of the features and how they work together. The new documentation includes more examples, cross-references, and explanations of how features work internally.

[Dennis Koch](https://github.com/pxlrbt) gave a great presentation demoing and explaining many of these new features recently. You can watch it here:

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/8qyV696TALA?si=sOAf8O5vrW8aQ3ny" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## General

### Improved performance
Expand Down Expand Up @@ -490,10 +490,9 @@ This gives you full control over the user experience when something goes wrong.

## Conclusion

Filament v4 Beta brings a wide range of improvements designed to make your development experience faster, more consistent, and easier to maintain. Since it's still in `beta`, now is the perfect time to explore the new features and share feedback.
If you need a `stable` version, refer to the [3.x documentation](https://filamentphp.com/docs/3.x).
Filament v4 brings a wide range of improvements designed to make your development experience faster, more consistent, and easier to maintain.

To upgrade your app to Filament v4 beta, please read the [upgrade guide](https://filamentphp.com/docs/4.x/upgrade-guide). To install Filament v4 into a new app, please visit the [installation guide](https://filamentphp.com/docs/4.x/introduction/installation).
To upgrade your app to Filament v4, please read the [upgrade guide](https://filamentphp.com/docs/4.x/upgrade-guide). To install Filament v4 into a new app, please visit the [installation guide](https://filamentphp.com/docs/4.x/introduction/installation).

Special thanks to [Dan Harrin](https://github.com/danharrin) for his incredible work on Filament v4!

Expand Down
Loading