Skip to content

Commit 7d7f929

Browse files
committed
More extensive configuration documentation
1 parent d886627 commit 7d7f929

File tree

6 files changed

+63
-24
lines changed

6 files changed

+63
-24
lines changed

config/blade-components.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
| - Without: <x-btn></x-btn>
1616
| - With: <x-df-btn></x-df-btn>
1717
|
18+
| @see https://blade-components.com/docs/configuration#preventing-collisions
19+
|
1820
*/
1921

2022
'prefix' => null,
@@ -27,6 +29,8 @@
2729
| All components, including their backing class, that should be
2830
| registered during runtime.
2931
|
32+
| @see https://blade-components.com/docs/configuration#publishing-configuration
33+
|
3034
*/
3135

3236
'components' => [

docs/10-installation.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,3 @@ Blade Colors is automatically installed with Blade Components. After installatio
7171
#### Theme customization
7272

7373
Blade Components implements the ["default theme"](https://github.com/distortedfusion/blade-colors/blob/master/src/Themes/DefaultTheme.php) offered by [Blade Colors](https://distortedfusion.com/docs/distortedfusion/blade-colors/getting-started). You can customize this to your liking, for a detailed explanation please refer to the [theming](/docs/theming) documentation.
74-
75-
## Publishing Configuration
76-
77-
You can publish the package configuration using the following command:
78-
79-
```bash
80-
php artisan vendor:publish --tag=blade-components-config
81-
```
82-
83-
Publishing the package configuration allows you to disable or add components.
84-
85-
## Publishing Views
86-
87-
You can publish the package views using the following command:
88-
89-
```bash
90-
php artisan vendor:publish --tag=blade-components-views
91-
```
92-
93-
After publishing you can modify the views from your application's `/resources/views/vendor/blade-components` directory.

docs/20-configuration.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Configuration
3+
description: Exclude components trough configuration, prevent collisions, and customize components by publishing their views.
4+
---
5+
6+
## Publishing configuration
7+
8+
All components, and their aliases, offered by Blade Components are configured in the [`blade-components.php`](https://github.com/distortedfusion/blade-components/blob/master/config/blade-components.php) configuration file. You can exclude certain components by removing them from the `components` entry after publishing the configuration file.
9+
10+
> [!NOTE]
11+
> It's possible to change the alias used by a component from the same configuration file. However, this isn't recommended as new components added in future releases might overlap.
12+
13+
You can publish the package configuration using the following command:
14+
15+
```bash
16+
php artisan vendor:publish --tag=blade-components-config
17+
```
18+
19+
Publishing the package configuration allows you to disable or add components.
20+
21+
### Preventing collisions
22+
23+
To prevent collisions with your own components, it's possible to prefix all components offered by Blade Components with a prefix.
24+
25+
After publishing the configuration file set the `prefix` entry to the prefix you would like to use.
26+
27+
```php
28+
<?php
29+
30+
return [
31+
32+
'prefix' => null,
33+
34+
];
35+
```
36+
37+
```html
38+
<!-- Without prefix, default behavior -->
39+
<x-btn>Button</x-btn>
40+
41+
<!-- With a prefix set to `df` -->
42+
<x-df-btn>Button</x-df-btn>
43+
```
44+
45+
## Publishing views
46+
47+
If you would like to make more impactful modifications to a component, the recommended approach is to publish the components view file to your application.
48+
49+
You can publish the packaged views using the following command:
50+
51+
```bash
52+
php artisan vendor:publish --tag=blade-components-views
53+
```
54+
55+
After publishing you can modify the views from your application's `/resources/views/vendor/blade-components` directory.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Every detail is built for speed and consistency, so you can create
66
```blade-component
77
<x-docs.components-toc />
88
```
9-
## Form Components
9+
## Form components
1010

1111
A collection of Blade form components designed to streamline the creation of user-friendly, accessible, and visually appealing forms in Laravel applications.
1212

docs/30-forms.md renamed to docs/40-forms.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343

4444
Please refer to the [Tailwind CSS documentation](https://tailwindcss.com/docs/installation) if you don't have Tailwind CSS installed already.
4545

46-
## Publishing Configuration
46+
## Publishing configuration
4747

4848
You can publish the package configuration using the following command:
4949

@@ -53,9 +53,9 @@ php artisan vendor:publish --tag=blade-forms-config
5353

5454
Publishing the package configuration allows you to disable or add components.
5555

56-
## Publishing Views
56+
## Publishing views
5757

58-
You can publish the package views using the following command:
58+
You can publish the packaged views using the following command:
5959

6060
```bash
6161
php artisan vendor:publish --tag=blade-forms-views
File renamed without changes.

0 commit comments

Comments
 (0)