Skip to content

Commit afce403

Browse files
committed
Merge branch '4.x' into 5.x
2 parents bec027a + 01b4cee commit afce403

45 files changed

Lines changed: 1643 additions & 111 deletions

Some content is hidden

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

docs/03-resources/01-overview.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ php artisan make:filament-resource Customer
1818
This will create several files in the `app/Filament/Resources` directory:
1919

2020
```
21-
Customers/
22-
├── CustomerResource.php
23-
├── Pages/
24-
│ ├── CreateCustomer.php
25-
│ ├── EditCustomer.php
26-
│ └── ListCustomers.php
27-
├── Schemas/
28-
│ └── CustomerForm.php
29-
└── Tables/
30-
└── CustomersTable.php
21+
.
22+
+-- Customers
23+
| +-- CustomerResource.php
24+
| +-- Pages
25+
| | +-- CreateCustomer.php
26+
| | +-- EditCustomer.php
27+
| | +-- ListCustomers.php
28+
| +-- Schemas
29+
| | +-- CustomerForm.php
30+
| +-- Tables
31+
| | +-- CustomersTable.php
3132
```
3233

3334
Your new resource class lives in `CustomerResource.php`.

docs/06-navigation/01-overview.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ To customize a navigation item's [icon](../styling/icons), you may override the
3333

3434
```php
3535
use BackedEnum;
36+
use Filament\Support\Icons\Heroicon;
3637

37-
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-document-text';
38+
protected static string | BackedEnum | null $navigationIcon = Heroicon::OutlinedDocumentText;
3839
```
3940

4041
<AutoScreenshot name="panels/navigation/change-icon" alt="Changed navigation item icon" version="3.x" />
@@ -47,8 +48,9 @@ You may assign a navigation [icon](../styling/icons) which will only be used for
4748

4849
```php
4950
use BackedEnum;
51+
use Filament\Support\Icons\Heroicon;
5052

51-
protected static string | BackedEnum | null $activeNavigationIcon = 'heroicon-o-document-text';
53+
protected static string | BackedEnum | null $activeNavigationIcon = Heroicon::OutlinedDocumentText;
5254
```
5355

5456
<AutoScreenshot name="panels/navigation/active-icon" alt="Different navigation item icon when active" version="3.x" />
@@ -154,6 +156,7 @@ You may customize navigation groups by calling `navigationGroups()` in the [conf
154156
```php
155157
use Filament\Navigation\NavigationGroup;
156158
use Filament\Panel;
159+
use Filament\Support\Icons\Heroicon;
157160

158161
public function panel(Panel $panel): Panel
159162
{
@@ -162,13 +165,13 @@ public function panel(Panel $panel): Panel
162165
->navigationGroups([
163166
NavigationGroup::make()
164167
->label('Shop')
165-
->icon('heroicon-o-shopping-cart'),
168+
->icon(Heroicon::OutlinedShoppingCart),
166169
NavigationGroup::make()
167170
->label('Blog')
168-
->icon('heroicon-o-pencil'),
171+
->icon(Heroicon::OutlinedPencil),
169172
NavigationGroup::make()
170173
->label(fn (): string => __('navigation.settings'))
171-
->icon('heroicon-o-cog-6-tooth')
174+
->icon(Heroicon::OutlinedCog6Tooth)
172175
->collapsed(),
173176
]);
174177
}
@@ -199,10 +202,11 @@ You may disable this behavior by calling `collapsible(false)` on the `Navigation
199202

200203
```php
201204
use Filament\Navigation\NavigationGroup;
205+
use Filament\Support\Icons\Heroicon;
202206

203207
NavigationGroup::make()
204208
->label('Settings')
205-
->icon('heroicon-o-cog-6-tooth')
209+
->icon(Heroicon::OutlinedCog6Tooth)
206210
->collapsible(false);
207211
```
208212

@@ -285,7 +289,10 @@ enum NavigationGroup implements HasLabel
285289
You can also implement the `HasIcon` interface on the enum class, to define a custom icon for each group:
286290

287291
```php
292+
use BackedEnum;
288293
use Filament\Support\Contracts\HasIcon;
294+
use Filament\Support\Icons\Heroicon;
295+
use Illuminate\Contracts\Support\Htmlable;
289296

290297
enum NavigationGroup implements HasIcon
291298
{
@@ -295,12 +302,12 @@ enum NavigationGroup implements HasIcon
295302

296303
case Settings;
297304

298-
public function getIcon(): ?string
305+
public function getIcon(): string | BackedEnum | Htmlable | null
299306
{
300307
return match ($this) {
301-
self::Shop => 'heroicon-o-shopping-cart',
302-
self::Blog => 'heroicon-o-pencil',
303-
self::Settings => 'heroicon-o-cog-6-tooth',
308+
self::Shop => Heroicon::OutlinedShoppingCart,
309+
self::Blog => Heroicon::OutlinedPencil,
310+
self::Settings => Heroicon::OutlinedCog6Tooth,
304311
};
305312
}
306313
}
@@ -358,6 +365,7 @@ To register new navigation items, you can use the [configuration](../panel-confi
358365
use Filament\Navigation\NavigationItem;
359366
use Filament\Pages\Dashboard;
360367
use Filament\Panel;
368+
use Filament\Support\Icons\Heroicon;
361369
use function Filament\Support\original_request;
362370

363371
public function panel(Panel $panel): Panel
@@ -367,7 +375,7 @@ public function panel(Panel $panel): Panel
367375
->navigationItems([
368376
NavigationItem::make('Analytics')
369377
->url('https://filament.pirsch.io', shouldOpenInNewTab: true)
370-
->icon('heroicon-o-presentation-chart-line')
378+
->icon(Heroicon::OutlinedPresentationChartLine)
371379
->group('Reports')
372380
->sort(3),
373381
NavigationItem::make('dashboard')
@@ -472,6 +480,7 @@ use Filament\Navigation\NavigationBuilder;
472480
use Filament\Navigation\NavigationItem;
473481
use Filament\Pages\Dashboard;
474482
use Filament\Panel;
483+
use Filament\Support\Icons\Heroicon;
475484
use function Filament\Support\original_request;
476485

477486
public function panel(Panel $panel): Panel
@@ -481,7 +490,7 @@ public function panel(Panel $panel): Panel
481490
->navigation(function (NavigationBuilder $builder): NavigationBuilder {
482491
return $builder->items([
483492
NavigationItem::make('Dashboard')
484-
->icon('heroicon-o-home')
493+
->icon(Heroicon::OutlinedHome)
485494
->isActiveWhen(fn (): bool => original_request()->routeIs('filament.admin.pages.dashboard'))
486495
->url(fn (): string => Dashboard::getUrl()),
487496
...UserResource::getNavigationItems(),

docs/06-navigation/04-clusters.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,20 @@ protected static ?string $cluster = SettingsCluster::class;
6969
When using clusters, it is recommended that you move all of your resources and pages into a directory with the same name as the cluster. For example, here is a directory structure for a panel that uses a cluster called `Settings`, containing a `ColorResource` and two custom pages:
7070

7171
```
72-
Clusters/
73-
└── Settings/
74-
├── SettingsCluster.php
75-
├── Pages/
76-
│ ├── ManageBranding.php
77-
│ └── ManageNotifications.php
78-
└── Resources/
79-
└── Colors/
80-
├── ColorResource.php
81-
└── Pages/
82-
├── CreateColor.php
83-
├── EditColor.php
84-
└── ListColors.php
72+
.
73+
+-- Clusters
74+
| +-- Settings
75+
| | +-- SettingsCluster.php
76+
| | +-- Pages
77+
| | | +-- ManageBranding.php
78+
| | | +-- ManageNotifications.php
79+
| | +-- Resources
80+
| | | +-- Colors
81+
| | | | +-- ColorResource.php
82+
| | | | +-- Pages
83+
| | | | | +-- CreateColor.php
84+
| | | | | +-- EditColor.php
85+
| | | | | +-- ListColors.php
8586
```
8687

8788
This is a recommendation, not a requirement. You can structure your panel however you like, as long as the resources and pages in your cluster use the [`$cluster`](#adding-resources-and-pages-to-a-cluster) property. This is just a suggestion to help you keep your panel organized.

docs/09-advanced/05-modular-architecture.md

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ php artisan make:module alerts
4141
This scaffolds a module structure:
4242

4343
```
44-
app-modules/alerts/
45-
├── composer.json
46-
├── src/
47-
│ └── Providers/
48-
│ └── AlertsServiceProvider.php
49-
├── routes/
50-
├── resources/
51-
├── database/
52-
└── tests/
44+
.
45+
+-- app-modules
46+
| +-- alerts
47+
| | +-- composer.json
48+
| | +-- src
49+
| | | +-- Providers
50+
| | | | +-- AlertsServiceProvider.php
51+
| | +-- routes
52+
| | +-- resources
53+
| | +-- database
54+
| | +-- tests
5355
```
5456

5557
### Configuring the module's composer.json
@@ -191,37 +193,39 @@ This approach lets you configure each plugin instance differently based on the p
191193
A well-organized module with Filament integration might look like this:
192194

193195
```
194-
app-modules/alerts/
195-
├── composer.json
196-
├── config/
197-
│ └── alerts.php
198-
├── database/
199-
│ ├── factories/
200-
│ ├── migrations/
201-
│ └── seeders/
202-
├── resources/
203-
│ └── views/
204-
│ └── filament/
205-
│ └── pages/
206-
├── routes/
207-
│ └── web.php
208-
├── src/
209-
│ ├── AlertsPlugin.php
210-
│ ├── Filament/
211-
│ │ ├── Pages/
212-
│ │ ├── Resources/
213-
│ │ │ └── Alerts/
214-
│ │ │ ├── AlertResource.php
215-
│ │ │ └── Pages/
216-
│ │ │ ├── CreateAlert.php
217-
│ │ │ ├── EditAlert.php
218-
│ │ │ └── ListAlerts.php
219-
│ │ └── Widgets/
220-
│ ├── Models/
221-
│ │ └── Alert.php
222-
│ └── Providers/
223-
│ └── AlertsServiceProvider.php
224-
└── tests/
196+
.
197+
+-- app-modules
198+
| +-- alerts
199+
| | +-- composer.json
200+
| | +-- config
201+
| | | +-- alerts.php
202+
| | +-- database
203+
| | | +-- factories
204+
| | | +-- migrations
205+
| | | +-- seeders
206+
| | +-- resources
207+
| | | +-- views
208+
| | | | +-- filament
209+
| | | | | +-- pages
210+
| | +-- routes
211+
| | | +-- web.php
212+
| | +-- src
213+
| | | +-- AlertsPlugin.php
214+
| | | +-- Filament
215+
| | | | +-- Pages
216+
| | | | +-- Resources
217+
| | | | | +-- Alerts
218+
| | | | | | +-- AlertResource.php
219+
| | | | | | +-- Pages
220+
| | | | | | | +-- CreateAlert.php
221+
| | | | | | | +-- EditAlert.php
222+
| | | | | | | +-- ListAlerts.php
223+
| | | | +-- Widgets
224+
| | | +-- Models
225+
| | | | +-- Alert.php
226+
| | | +-- Providers
227+
| | | | +-- AlertsServiceProvider.php
228+
| | +-- tests
225229
```
226230

227231
## Sharing resources between panels

packages/actions/resources/lang/lt/delete.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@
5454
'title' => 'Ištrinta',
5555
],
5656

57+
'deleted_partial' => [
58+
'title' => 'Ištrinta :count iš :total',
59+
'missing_authorization_failure_message' => 'Neturite leidimo ištrinti :count.',
60+
'missing_processing_failure_message' => ':count negalėjo būti ištrinta.',
61+
],
62+
63+
'deleted_none' => [
64+
'title' => 'Nepavyko ištrinti',
65+
'missing_authorization_failure_message' => 'Neturite leidimo ištrinti :count.',
66+
'missing_processing_failure_message' => ':count negalėjo būti ištrinta.',
67+
],
68+
5769
],
5870

5971
],

packages/actions/resources/lang/lt/export.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414

1515
'label' => 'Stulpeliai',
1616

17+
'actions' => [
18+
19+
'select_all' => [
20+
'label' => 'Pažymėti visus',
21+
],
22+
23+
'deselect_all' => [
24+
'label' => 'Atžymėti visus',
25+
],
26+
27+
],
28+
1729
'form' => [
1830

1931
'is_enabled' => [
@@ -65,6 +77,11 @@
6577
'body' => 'Negalite eksportuoti daugiau nei 1 eilutės vienu metu.|Negalite eksportuoti daugiau nei :count eilučių vienu metu.',
6678
],
6779

80+
'no_columns' => [
81+
'title' => 'Nepasirinkti stulpeliai',
82+
'body' => 'Prašome pasirinkti bent vieną stulpelį eksportui.',
83+
],
84+
6885
'started' => [
6986
'title' => 'Eksportas pradėtas',
7087
'body' => 'Eksportas pradėtas ir 1 eilutė bus apdorota fone.|Eksportas pradėtas ir :count eilutės bus apdorotos fone.',

packages/actions/resources/lang/lt/force-delete.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@
5454
'title' => 'Ištrinta',
5555
],
5656

57+
'deleted_partial' => [
58+
'title' => 'Ištrinta :count iš :total',
59+
'missing_authorization_failure_message' => 'Neturite leidimo ištrinti :count.',
60+
'missing_processing_failure_message' => ':count negalėjo būti ištrinta.',
61+
],
62+
63+
'deleted_none' => [
64+
'title' => 'Nepavyko ištrinti',
65+
'missing_authorization_failure_message' => 'Neturite leidimo ištrinti :count.',
66+
'missing_processing_failure_message' => ':count negalėjo būti ištrinta.',
67+
],
68+
5769
],
5870

5971
],

packages/actions/resources/lang/lt/import.php

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

1313
'file' => [
1414
'label' => 'Failas',
15+
1516
'placeholder' => 'Įkelti CSV failą',
17+
18+
'rules' => [
19+
'duplicate_columns' => '{0} Failas neturi turėti daugiau nei vieną tuščią stulpelio antraštę.|{1,*} Failas neturi turėti pasikartojančių stulpelio antraščių: :columns.',
20+
],
1621
],
1722

1823
'columns' => [
@@ -72,6 +77,7 @@
7277
'file_name' => 'import-:import_id-:csv_name-failed-rows',
7378
'error_header' => 'klaida',
7479
'system_error' => 'Sistemos klaida, susisiekite su klientų aptarnavimu.',
80+
'column_mapping_required_for_new_record' => 'Stulpelis :attribute nebuvo susietas su failo stulpeliu, tačiau jis yra būtinas naujiems įrašams kurti.',
7581
],
7682

7783
];
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
return [
4+
5+
'throttled' => [
6+
'title' => 'Per daug bandymų',
7+
'body' => 'Prašome bandyti dar kartą po :seconds sekundžių.',
8+
],
9+
10+
];

0 commit comments

Comments
 (0)