Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Jul 24, 2024
1 parent 076acbf commit 06a66eb
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
24 changes: 20 additions & 4 deletions docs/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,34 @@ The Filament Panel Builder pre-installs the [Form Builder](/docs/forms), [Table

## Improving Filament panel performance

### Caching Blade Icons
### Optimizing Filament for production

You may wish to consider running `php artisan icons:cache` locally, and also in your deployment script. This is because Filament uses the [Blade Icons](https://blade-ui-kit.com/blade-icons) package, which can be much more performant when cached.
To optimize Filament for production, you should run the following command in your deployment script:

### Caching Filament components
```bash
php artisan filament:optimize
```

This command will [cache the Filament components](#caching-filament-components) and additionally the [Blade icons](#caching-blade-icons), which can significantly improve the performance of your Filament panels. This command is a shorthand for the commands `php artisan filament:cache-components` and `php artisan icons:cache`.

To clear the caches at once, you can run:

```bash
php artisan filament:optimize-clear
```

#### Caching Filament components

You may also wish to consider running `php artisan filament:cache-components` in your deployment script, especially if you have large numbers of components (resources, pages, widgets, relation managers, custom Livewire components, etc.). This will create cache files in the `bootstrap/cache/filament` directory of your application, which contain indexes for each type of component. This can significantly improve the performance of Filament in some apps, as it reduces the number of files that need to be scanned and auto-discovered for components.
If you're not using the [`filament:optimize` command](#optimizing-filament-for-production), you may wish to consider running `php artisan filament:cache-components` in your deployment script, especially if you have large numbers of components (resources, pages, widgets, relation managers, custom Livewire components, etc.). This will create cache files in the `bootstrap/cache/filament` directory of your application, which contain indexes for each type of component. This can significantly improve the performance of Filament in some apps, as it reduces the number of files that need to be scanned and auto-discovered for components.

However, if you are actively developing your app locally, you should avoid using this command, as it will prevent any new components from being discovered until the cache is cleared or rebuilt.

You can clear the cache at any time without rebuilding it by running `php artisan filament:clear-cached-components`.

#### Caching Blade Icons

If you're not using the [`filament:optimize` command](#optimizing-filament-for-production), you may wish to consider running `php artisan icons:cache` locally, and also in your deployment script. This is because Filament uses the [Blade Icons](https://blade-ui-kit.com/blade-icons) package, which can be much more performant when cached.

### Enabling OPcache on your server

From the [Laravel Forge documentation](https://forge.laravel.com/docs/servers/php.html#opcache):
Expand Down
29 changes: 29 additions & 0 deletions docs/06-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,35 @@ public function panel(Panel $panel): Panel
}
```

## Customizing the width of the sidebar

You can customize the width of the sidebar by passing it to the `sidebarWidth()` method in the [configuration](configuration):

```php
use Filament\Panel;

public function panel(Panel $panel): Panel
{
return $panel
// ...
->sidebarWidth('40rem');
}
```

Additionally, if you are using the `sidebarCollapsibleOnDesktop()` method, you can customize width of the collapsed icons by using the `collapsedSidebarWidth()` method in the [configuration](configuration):

```php
use Filament\Panel;

public function panel(Panel $panel): Panel
{
return $panel
// ...
->sidebarCollapsibleOnDesktop()
->collapsedSidebarWidth('9rem');
}
```

## Advanced navigation customization

The `navigation()` method can be called from the [configuration](configuration). It allows you to build a custom navigation that overrides Filament's automatically generated items. This API is designed to give you complete control over the navigation.
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/no/pages/auth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'form' => [

'email' => [
'label' => 'E-postedresse',
'label' => 'E-postadresse',
],

'password' => [
Expand Down

0 comments on commit 06a66eb

Please sign in to comment.