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: content/docs/contributing.md
+14
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,17 @@
1
+
---
2
+
title: Contributing
3
+
description: Want to make some contributions. Learn more here.
4
+
prevTitle: 'Custom Components'
5
+
prevURL: '/docs/extend/components'
6
+
prevSlug: 'components'
7
+
slug: 'troubleshooting'
8
+
nextTitle: 'Troubleshooting'
9
+
nextURL: '/docs/troubleshooting'
10
+
nextSlug: 'troubleshooting'
11
+
---
12
+
13
+
# Contributing
14
+
1
15
We welcome all new contributions to this project. If you would like to contribute to this package it will probably be helpful to learn how to setup a local version for working on the DevDojo Auth package.
description: Learn how to override the authentication page components to take full control of how your authentication pages feel and function.
4
+
nextTitle: 'Contributing'
5
+
nextURL: '/docs/contributing'
6
+
nextSlug: 'contributing'
7
+
slug: 'github-action'
8
+
prevTitle: 'Authentication Events'
9
+
prevURL: '/docs/extend/events'
10
+
prevSlug: 'events'
4
11
---
5
12
6
13
# Custom Components
7
14
8
15
## Introduction
9
16
10
-
The DevDojo Auth package allows you to customize its components by providing your own versions. This gives you the flexibility to tailor the authentication experience to fit your application's design and requirements. By adding your own Blade components, you can override the default components provided by the package.
17
+
You can include additional customizations by adding your own Blade components, you can override the default components provided by the package.
11
18
12
19
## Creating Custom Components
13
20
14
21
### Step 1: Publish the Default Components
15
22
16
-
To start with the current components from the Auth package, you can publish them to your application's `resources/views/components/auth` directory.
23
+
To start with the current components from the Auth package, you can publish them to your application's `resources/views/components/auth/elements` directory.
17
24
18
25
```bash
19
26
php artisan vendor:publish --tag=auth:components
20
27
```
21
28
22
-
This command will publish the default components to `resources/views/components/app/elements`.
29
+
This command will publish the default components to `resources/views/components/app/elements`. Any components in this folder can be used as opposed to the default components. This gives you ultimate flexibility on how your authentication will look and feel.
23
30
24
-
### Step 2: Create the Custom Component
31
+
Next, you need to specify which component you want to override.
25
32
26
-
Create a Blade file for your custom component in the `resources/views/components/app/elements` directory. For example, to customize the button component, create the following file:
In your Blade views, use the custom component as follows:
70
-
71
-
```blade
72
-
<x-auth::elements.button>
73
-
Click Me
74
-
</x-auth::elements.button>
75
-
```
58
+
For instance, the above code will now use the `button` component from your local `resources/views/components/auth/elements` folder.
76
59
77
-
This will render the custom button component you created.
60
+
### Step 3: Customize the component
78
61
79
-
## Additional Information
62
+
You can now customize the Blade component as much as you would like. We are utilizing <ahref="https://tailwindcss.com"target="_blank">Tailwind CSS</a> and <ahref="https://alpinejs.dev"target="_blank">AlpineJS</a> within these components, so that is how you can customize styles or functionality.
80
63
81
-
### Customizing Other Components
64
+
##Step 4: Update the Assets
82
65
83
-
You can follow the same process to customize other components provided by the DevDojo Auth package. Simply publish the components, create your custom versions, and register them in your `AppServiceProvider`.
66
+
You may have added some additional Tailwind classes in your custom component that are not included by the default components. To do this, you can run the following command:
> Tip: if you are trying to override styles that are set by Auth itself, for instance the background color, you may have to use !important (ex: !bg-pink-500), although the best process for this would be just to use the `button color` settings in the authentication setup pages.
116
75
117
-
## Conclusion
76
+
## Testing
118
77
119
-
By following these steps, you can easily customize the components of the DevDojo Auth package to fit your application's needs. This flexibility allows you to maintain a consistent design and user experience across your application.
78
+
It's probably best to have your CI setup to run through the authentication functionality whenever you make a new PR. This way if you broke something when adding your own custom component, you will be aware.
0 commit comments