You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/08-styling/01-overview.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,17 @@ By default, this command will use NPM to install dependencies. If you want to us
128
128
php artisan make:filament-theme --pm=bun
129
129
````
130
130
131
-
This command generates a CSS file in the `resources/css/filament` directory.
131
+
This command will:
132
+
133
+
1. Install the required Tailwind CSS dependencies
134
+
2. Generate a CSS file in`resources/css/filament/{panel}/theme.css`
135
+
3. Attempt to automatically add the theme to your `vite.config.js` input array
136
+
4. Attempt to automatically register `->viteTheme()`in your panel provider
137
+
5. Offer to compile the theme with Vite
138
+
139
+
If the command cannot automatically configure your files (due to non-standard formatting), it will display manual instructions instead. In that case, follow these steps:
140
+
141
+
### Manual configuration
132
142
133
143
Add the theme's CSS file to the Laravel plugin's `input` array in`vite.config.js`:
134
144
@@ -139,7 +149,7 @@ input: [
139
149
]
140
150
```
141
151
142
-
Now, register the Vite-compiled theme CSS file in the panel's provider:
152
+
Register the Vite-compiled theme CSS file in the panel's provider:
143
153
144
154
```php
145
155
use Filament\Panel;
@@ -152,14 +162,14 @@ public function panel(Panel $panel): Panel
152
162
}
153
163
```
154
164
155
-
Finally, compile the theme with Vite:
165
+
Then compile the theme with Vite:
156
166
157
167
```bash
158
168
npm run build
159
169
```
160
170
161
171
<Asidevariant="info">
162
-
Check the command output for the exact file path (e.g., `app/theme.css`), as it may vary depending on your panel's ID.
172
+
Check the command output for the exact file path (e.g., `admin/theme.css`), as it may vary depending on your panel's ID.
163
173
</Aside>
164
174
165
175
You can now customize the theme by editing the CSS file in `resources/css/filament`.
@@ -92,12 +103,32 @@ public function handle(): int
92
103
returnstatic::SUCCESS;
93
104
}
94
105
95
-
$this->components->warn('Action is required to complete the theme setup:');
96
-
$this->components->bulletList([
97
-
"First, add a new item to the Laravel plugin's `input` array in `vite.config.js`: `resources/css/filament/{$this->panel->getId()}/theme.css`.",
98
-
"Next, register the theme in the {$this->panel->getId()} panel provider using `->viteTheme('resources/css/filament/{$this->panel->getId()}/theme.css')`",
99
-
"Finally, run `{$this->pm} run build` to compile the theme.",
100
-
]);
106
+
$pendingActions = [];
107
+
108
+
// Try to register in `vite.config.js`
109
+
if (! $this->registerInViteConfig()) {
110
+
$pendingActions[] = "Add a new item to the Laravel plugin's `input` array in `vite.config.js`: `{$this->themePath}`.";
111
+
}
112
+
113
+
// Try to register in panel provider
114
+
if (! $this->registerInPanelProvider()) {
115
+
$pendingActions[] = "Register the theme in the {$this->panel->getId()} panel provider using `->viteTheme('{$this->themePath}')`";
116
+
}
117
+
118
+
// Show pending manual actions if any
119
+
if (count($pendingActions) > 0) {
120
+
$this->components->warn('Action is required to complete the theme setup:');
121
+
$this->components->bulletList($pendingActions);
122
+
$this->newLine();
123
+
}
124
+
125
+
// Offer to compile the theme
126
+
if (confirm('Would you like to compile the theme now?', default: true)) {
127
+
$this->components->info('Compiling theme...');
128
+
passthru("{$this->pm} run build");
129
+
} else {
130
+
$this->components->info("Run `{$this->pm} run build` to compile the theme.");
131
+
}
101
132
102
133
returnstatic::SUCCESS;
103
134
}
@@ -163,14 +194,140 @@ protected function abortIfNotVite(): void
$this->components->warn('Action is required to complete the theme setup:');
167
201
$this->components->bulletList([
168
-
"It looks like you don't have Vite installed. Please use your asset bundling system of choice to compile `resources/css/filament/{$this->panel->getId()}/theme.css` into `public/css/filament/{$this->panel->getId()}/theme.css`.",
202
+
"It looks like you don't have Vite installed. Please use your asset bundling system of choice to compile `{$this->themePath}` into `{$publicPath}`.",
169
203
"If you're not currently using a bundler, we recommend using Vite. Alternatively, you can use the Tailwind CLI with the following command:",
"Make sure to register the theme in the {$this->panel->getId()} panel provider using `->theme(asset('css/filament/{$this->panel->getId()}/theme.css'))`",
Copy file name to clipboardExpand all lines: packages/spatie-laravel-media-library-plugin/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ The media library file upload supports all the customization options of the [ori
38
38
39
39
### Passing a collection
40
40
41
-
Optionally, you may pass a [`collection()`](https://spatie.be/docs/laravel-medialibrary/working-with-media-collections/simple-media-collections) allows you to group files into categories:
41
+
Optionally, you may pass a [`collection()`](https://spatie.be/docs/laravel-medialibrary/working-with-media-collections/simple-media-collections)that allows you to group files into categories:
42
42
43
43
```php
44
44
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
Copy file name to clipboardExpand all lines: packages/spatie-laravel-tags-plugin/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ You must also [prepare your Eloquent model](https://spatie.be/docs/laravel-tags/
26
26
27
27
## Form component
28
28
29
-
This guide assumes that you've already set up your model attach tags as per [Spatie's documentation](https://spatie.be/docs/laravel-tags/basic-usage/using-tags).
29
+
This guide assumes that you've already set up your model to attach tags as per [Spatie's documentation](https://spatie.be/docs/laravel-tags/basic-usage/using-tags).
30
30
31
31
You may use the field in the same way as the [original tags input](https://filamentphp.com/docs/forms/tags-input) field:
32
32
@@ -36,7 +36,7 @@ use Filament\Forms\Components\SpatieTagsInput;
36
36
SpatieTagsInput::make('tags')
37
37
```
38
38
39
-
Optionally, you may pass a [`type()`](https://spatie.be/docs/laravel-tags/advanced-usage/using-types) allows you to group tags into collections:
39
+
Optionally, you may pass a [`type()`](https://spatie.be/docs/laravel-tags/advanced-usage/using-types)that allows you to group tags into collections:
This is equivalent to including the plugins "inline" via `newChart(..., { plugins: [...] })` when instantiating a Chart.js chart.
340
340
341
-
It's important to initialise the array if it has not been already, before pushing onto it. This ensures that mutliple JavaScript files (especially those from Filament plugins) that register Chart.js plugins do not overwrite each other, regardless of the order they are booted in.
341
+
It's important to initialise the array if it has not been already, before pushing onto it. This ensures that multiple JavaScript files (especially those from Filament plugins) that register Chart.js plugins do not overwrite each other, regardless of the order they are booted in.
342
342
343
343
You can push as many plugins to the array as you would like to install, you do not need a separate file to import each plugin.
0 commit comments