@omnitend/dashboard-for-laravel 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +397 -0
- package/dist/components/base/DAccordion.vue.d.ts +12 -0
- package/dist/components/base/DAccordionItem.vue.d.ts +12 -0
- package/dist/components/base/DAlert.vue.d.ts +12 -0
- package/dist/components/base/DAvatar.vue.d.ts +12 -0
- package/dist/components/base/DBadge.vue.d.ts +12 -0
- package/dist/components/base/DBreadcrumb.vue.d.ts +12 -0
- package/dist/components/base/DButton.vue.d.ts +29 -0
- package/dist/components/base/DButtonGroup.vue.d.ts +12 -0
- package/dist/components/base/DButtonToolbar.vue.d.ts +12 -0
- package/dist/components/base/DCard.vue.d.ts +12 -0
- package/dist/components/base/DCarousel.vue.d.ts +12 -0
- package/dist/components/base/DCarouselSlide.vue.d.ts +12 -0
- package/dist/components/base/DCol.vue.d.ts +12 -0
- package/dist/components/base/DCollapse.vue.d.ts +12 -0
- package/dist/components/base/DContainer.vue.d.ts +12 -0
- package/dist/components/base/DDropdown.vue.d.ts +12 -0
- package/dist/components/base/DDropdownDivider.vue.d.ts +2 -0
- package/dist/components/base/DDropdownItem.vue.d.ts +12 -0
- package/dist/components/base/DForm.vue.d.ts +12 -0
- package/dist/components/base/DFormCheckbox.vue.d.ts +12 -0
- package/dist/components/base/DFormGroup.vue.d.ts +12 -0
- package/dist/components/base/DFormInput.vue.d.ts +2 -0
- package/dist/components/base/DFormInvalidFeedback.vue.d.ts +12 -0
- package/dist/components/base/DFormRadio.vue.d.ts +12 -0
- package/dist/components/base/DFormSelect.vue.d.ts +12 -0
- package/dist/components/base/DFormSpinbutton.vue.d.ts +12 -0
- package/dist/components/base/DFormTags.vue.d.ts +12 -0
- package/dist/components/base/DFormText.vue.d.ts +12 -0
- package/dist/components/base/DFormTextarea.vue.d.ts +2 -0
- package/dist/components/base/DImage.vue.d.ts +12 -0
- package/dist/components/base/DInputGroup.vue.d.ts +12 -0
- package/dist/components/base/DLink.vue.d.ts +12 -0
- package/dist/components/base/DListGroup.vue.d.ts +12 -0
- package/dist/components/base/DListGroupItem.vue.d.ts +12 -0
- package/dist/components/base/DModal.vue.d.ts +12 -0
- package/dist/components/base/DNav.vue.d.ts +12 -0
- package/dist/components/base/DNavItem.vue.d.ts +12 -0
- package/dist/components/base/DNavbar.vue.d.ts +12 -0
- package/dist/components/base/DNavbarBrand.vue.d.ts +12 -0
- package/dist/components/base/DNavbarNav.vue.d.ts +12 -0
- package/dist/components/base/DNavbarToggle.vue.d.ts +12 -0
- package/dist/components/base/DOffcanvas.vue.d.ts +12 -0
- package/dist/components/base/DOverlay.vue.d.ts +12 -0
- package/dist/components/base/DPagination.vue.d.ts +2 -0
- package/dist/components/base/DPlaceholder.vue.d.ts +12 -0
- package/dist/components/base/DPopover.vue.d.ts +12 -0
- package/dist/components/base/DProgress.vue.d.ts +12 -0
- package/dist/components/base/DRow.vue.d.ts +12 -0
- package/dist/components/base/DSpinner.vue.d.ts +2 -0
- package/dist/components/base/DTab.vue.d.ts +12 -0
- package/dist/components/base/DTable.vue.d.ts +26 -0
- package/dist/components/base/DTabs.vue.d.ts +12 -0
- package/dist/components/base/DToast.vue.d.ts +12 -0
- package/dist/components/base/DToaster.vue.d.ts +12 -0
- package/dist/components/base/DTooltip.vue.d.ts +12 -0
- package/dist/components/extended/DXBasicForm.vue.d.ts +39 -0
- package/dist/components/extended/DXDashboard.vue.d.ts +52 -0
- package/dist/components/extended/DXDashboardNavbar.vue.d.ts +53 -0
- package/dist/components/extended/DXDashboardSidebar.vue.d.ts +37 -0
- package/dist/components/extended/DXForm.vue.d.ts +31 -0
- package/dist/components/extended/DXTable.vue.d.ts +190 -0
- package/dist/composables/defineForm.d.ts +35 -0
- package/dist/composables/useForm.d.ts +46 -0
- package/dist/composables/useToast.d.ts +1 -0
- package/dist/dashboard-for-laravel.js +17748 -0
- package/dist/dashboard-for-laravel.js.map +1 -0
- package/dist/dashboard-for-laravel.umd.cjs +11 -0
- package/dist/dashboard-for-laravel.umd.cjs.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/style.css +5 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/navigation.d.ts +17 -0
- package/dist/utils/api.d.ts +30 -0
- package/docs/public/api-reference.json +1932 -0
- package/docs/public/docs-map.md +85 -0
- package/docs/public/llms.txt +110 -0
- package/package.json +116 -0
- package/resources/css/theme.scss +219 -0
- package/resources/js/components/base/DAccordion.vue +21 -0
- package/resources/js/components/base/DAccordionItem.vue +14 -0
- package/resources/js/components/base/DAlert.vue +14 -0
- package/resources/js/components/base/DAvatar.vue +21 -0
- package/resources/js/components/base/DBadge.vue +14 -0
- package/resources/js/components/base/DBreadcrumb.vue +21 -0
- package/resources/js/components/base/DButton.vue +58 -0
- package/resources/js/components/base/DButtonGroup.vue +21 -0
- package/resources/js/components/base/DButtonToolbar.vue +21 -0
- package/resources/js/components/base/DCard.vue +35 -0
- package/resources/js/components/base/DCarousel.vue +21 -0
- package/resources/js/components/base/DCarouselSlide.vue +14 -0
- package/resources/js/components/base/DCol.vue +14 -0
- package/resources/js/components/base/DCollapse.vue +34 -0
- package/resources/js/components/base/DContainer.vue +14 -0
- package/resources/js/components/base/DDropdown.vue +16 -0
- package/resources/js/components/base/DDropdownDivider.vue +7 -0
- package/resources/js/components/base/DDropdownItem.vue +14 -0
- package/resources/js/components/base/DForm.vue +21 -0
- package/resources/js/components/base/DFormCheckbox.vue +14 -0
- package/resources/js/components/base/DFormGroup.vue +11 -0
- package/resources/js/components/base/DFormInput.vue +7 -0
- package/resources/js/components/base/DFormInvalidFeedback.vue +16 -0
- package/resources/js/components/base/DFormRadio.vue +21 -0
- package/resources/js/components/base/DFormSelect.vue +14 -0
- package/resources/js/components/base/DFormSpinbutton.vue +21 -0
- package/resources/js/components/base/DFormTags.vue +21 -0
- package/resources/js/components/base/DFormText.vue +16 -0
- package/resources/js/components/base/DFormTextarea.vue +7 -0
- package/resources/js/components/base/DImage.vue +21 -0
- package/resources/js/components/base/DInputGroup.vue +21 -0
- package/resources/js/components/base/DLink.vue +21 -0
- package/resources/js/components/base/DListGroup.vue +21 -0
- package/resources/js/components/base/DListGroupItem.vue +14 -0
- package/resources/js/components/base/DModal.vue +11 -0
- package/resources/js/components/base/DNav.vue +14 -0
- package/resources/js/components/base/DNavItem.vue +14 -0
- package/resources/js/components/base/DNavbar.vue +21 -0
- package/resources/js/components/base/DNavbarBrand.vue +14 -0
- package/resources/js/components/base/DNavbarNav.vue +14 -0
- package/resources/js/components/base/DNavbarToggle.vue +14 -0
- package/resources/js/components/base/DOffcanvas.vue +11 -0
- package/resources/js/components/base/DOverlay.vue +21 -0
- package/resources/js/components/base/DPagination.vue +7 -0
- package/resources/js/components/base/DPlaceholder.vue +21 -0
- package/resources/js/components/base/DPopover.vue +21 -0
- package/resources/js/components/base/DProgress.vue +21 -0
- package/resources/js/components/base/DRow.vue +14 -0
- package/resources/js/components/base/DSpinner.vue +7 -0
- package/resources/js/components/base/DTab.vue +14 -0
- package/resources/js/components/base/DTable.vue +62 -0
- package/resources/js/components/base/DTabs.vue +21 -0
- package/resources/js/components/base/DToast.vue +16 -0
- package/resources/js/components/base/DToaster.vue +16 -0
- package/resources/js/components/base/DTooltip.vue +21 -0
- package/resources/js/components/extended/DXBasicForm.vue +177 -0
- package/resources/js/components/extended/DXDashboard.vue +208 -0
- package/resources/js/components/extended/DXDashboardNavbar.vue +112 -0
- package/resources/js/components/extended/DXDashboardSidebar.vue +233 -0
- package/resources/js/components/extended/DXForm.vue +44 -0
- package/resources/js/components/extended/DXTable.vue +1345 -0
- package/resources/js/composables/defineForm.ts +78 -0
- package/resources/js/composables/useForm.ts +272 -0
- package/resources/js/composables/useToast.ts +1 -0
- package/resources/js/index.ts +118 -0
- package/resources/js/types/index.ts +61 -0
- package/resources/js/types/navigation.ts +19 -0
- package/resources/js/utils/api.ts +182 -0
- package/scripts/mcp-server.mjs +359 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Omni Tend
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
# Laravel Dashboard
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@omnitend/dashboard-for-laravel)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://github.com/omnitend/dashboard-for-laravel)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
|
|
8
|
+
A full-stack package for building Laravel dashboards with Vue 3, Inertia.js, and Bootstrap Vue Next.
|
|
9
|
+
|
|
10
|
+
## Documentation
|
|
11
|
+
|
|
12
|
+
📚 **[Browse Components](https://github.com/omnitend/dashboard-for-laravel/tree/main/docs/src/pages/components)** | 📦 **[NPM Package](https://www.npmjs.com/package/@omnitend/dashboard-for-laravel)**
|
|
13
|
+
|
|
14
|
+
- [Getting Started Guide](https://github.com/omnitend/dashboard-for-laravel/blob/main/docs/src/pages/guide/getting-started.md)
|
|
15
|
+
- [Installation Guide](https://github.com/omnitend/dashboard-for-laravel/blob/main/docs/src/pages/guide/installation.md)
|
|
16
|
+
- [Component API Reference](https://github.com/omnitend/dashboard-for-laravel/tree/main/docs/src/pages/components)
|
|
17
|
+
- [Form System Guide](https://github.com/omnitend/dashboard-for-laravel/blob/main/docs/src/pages/guide/forms.md)
|
|
18
|
+
- [Theming Guide](https://github.com/omnitend/dashboard-for-laravel/blob/main/docs/src/pages/guide/theming.md)
|
|
19
|
+
- [TypeScript Guide](https://github.com/omnitend/dashboard-for-laravel/blob/main/docs/src/pages/guide/typescript.md)
|
|
20
|
+
- [Examples & Patterns](https://github.com/omnitend/dashboard-for-laravel/blob/main/docs/src/pages/examples/common-patterns.md)
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **Form System**: Type-safe form handling with validation
|
|
25
|
+
- **Data Tables**: Paginated data tables with customizable columns
|
|
26
|
+
- **Navigation**: Responsive sidebar navigation
|
|
27
|
+
- **API Client**: Type-safe HTTP client with Laravel integration
|
|
28
|
+
- **Laravel Helpers**: Backend utilities for consistent API responses
|
|
29
|
+
- **MCP Server**: Query documentation via AI agents ([setup guide](MCP_SERVER.md))
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
### NPM Package
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @omnitend/dashboard-for-laravel
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Composer Package
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
composer require omnitend/dashboard-for-laravel
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Frontend Usage
|
|
46
|
+
|
|
47
|
+
### Forms
|
|
48
|
+
|
|
49
|
+
#### Using `defineForm` (Recommended)
|
|
50
|
+
|
|
51
|
+
The `defineForm` helper provides type-safe form definitions with minimal boilerplate:
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<template>
|
|
55
|
+
<DXForm
|
|
56
|
+
:form="loginForm"
|
|
57
|
+
submit-text="Login"
|
|
58
|
+
submit-loading-text="Logging in..."
|
|
59
|
+
@submit="handleLogin"
|
|
60
|
+
/>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup lang="ts">
|
|
64
|
+
import { defineForm, DXForm } from "@omnitend/dashboard-for-laravel";
|
|
65
|
+
|
|
66
|
+
const loginForm = defineForm([
|
|
67
|
+
{
|
|
68
|
+
key: "email",
|
|
69
|
+
type: "email",
|
|
70
|
+
label: "Email",
|
|
71
|
+
placeholder: "Enter your email",
|
|
72
|
+
required: true,
|
|
73
|
+
default: "",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: "password",
|
|
77
|
+
type: "password",
|
|
78
|
+
label: "Password",
|
|
79
|
+
required: true,
|
|
80
|
+
default: "",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: "remember",
|
|
84
|
+
type: "checkbox",
|
|
85
|
+
label: "Remember me",
|
|
86
|
+
default: false,
|
|
87
|
+
},
|
|
88
|
+
] as const);
|
|
89
|
+
|
|
90
|
+
const handleLogin = async () => {
|
|
91
|
+
await loginForm.form.post<{ redirect?: string }>("/login", {
|
|
92
|
+
onSuccess: (data) => {
|
|
93
|
+
window.location.href = data.redirect || "/dashboard";
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Using `useForm` Directly
|
|
101
|
+
|
|
102
|
+
For more control, use `useForm` and `DXBasicForm`:
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<template>
|
|
106
|
+
<DXBasicForm
|
|
107
|
+
:form="form"
|
|
108
|
+
:fields="fields"
|
|
109
|
+
@submit="handleSubmit"
|
|
110
|
+
/>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<script setup lang="ts">
|
|
114
|
+
import { useForm, DXBasicForm, type FieldDefinition } from "@omnitend/dashboard-for-laravel";
|
|
115
|
+
|
|
116
|
+
const form = useForm({
|
|
117
|
+
name: "",
|
|
118
|
+
email: "",
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const fields: FieldDefinition[] = [
|
|
122
|
+
{ key: "name", type: "text", label: "Name", required: true },
|
|
123
|
+
{ key: "email", type: "email", label: "Email", required: true },
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
const handleSubmit = async () => {
|
|
127
|
+
await form.post("/api/users");
|
|
128
|
+
};
|
|
129
|
+
</script>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### Supported Field Types
|
|
133
|
+
|
|
134
|
+
- Text inputs: `text`, `email`, `password`, `number`, `url`, `tel`, `date`, `datetime-local`, `time`
|
|
135
|
+
- `textarea`
|
|
136
|
+
- `select` (requires `options` prop)
|
|
137
|
+
- `checkbox`
|
|
138
|
+
- `radio` (requires `options` prop)
|
|
139
|
+
|
|
140
|
+
#### Form Methods
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
// Submit methods
|
|
144
|
+
await form.post("/api/users", options);
|
|
145
|
+
await form.put("/api/users/1", options);
|
|
146
|
+
await form.patch("/api/users/1", options);
|
|
147
|
+
await form.delete("/api/users/1", options);
|
|
148
|
+
|
|
149
|
+
// Form state
|
|
150
|
+
form.processing; // boolean
|
|
151
|
+
form.errors; // ValidationErrors
|
|
152
|
+
form.hasErrors; // computed boolean
|
|
153
|
+
form.recentlySuccessful; // boolean
|
|
154
|
+
|
|
155
|
+
// Form methods
|
|
156
|
+
form.reset(); // Reset to initial values
|
|
157
|
+
form.clearErrors(); // Clear all errors
|
|
158
|
+
form.clearError("email"); // Clear specific field error
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Data Tables
|
|
162
|
+
|
|
163
|
+
```vue
|
|
164
|
+
<template>
|
|
165
|
+
<DXTable
|
|
166
|
+
title="Users"
|
|
167
|
+
:items="users"
|
|
168
|
+
:fields="fields"
|
|
169
|
+
:pagination="pagination"
|
|
170
|
+
@page-change="fetchUsers"
|
|
171
|
+
>
|
|
172
|
+
<!-- Custom cell rendering -->
|
|
173
|
+
<template #cell(created_at)="{ item }">
|
|
174
|
+
{{ formatDate(item.created_at) }}
|
|
175
|
+
</template>
|
|
176
|
+
</DXTable>
|
|
177
|
+
</template>
|
|
178
|
+
|
|
179
|
+
<script setup lang="ts">
|
|
180
|
+
import { ref } from "vue";
|
|
181
|
+
import { DXTable, type PaginationData, type TableField } from "@omnitend/dashboard-for-laravel";
|
|
182
|
+
|
|
183
|
+
interface User {
|
|
184
|
+
id: number;
|
|
185
|
+
name: string;
|
|
186
|
+
email: string;
|
|
187
|
+
created_at: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const users = ref<User[]>([]);
|
|
191
|
+
const pagination = ref<PaginationData>({
|
|
192
|
+
currentPage: 1,
|
|
193
|
+
perPage: 15,
|
|
194
|
+
total: 0,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const fields: TableField[] = [
|
|
198
|
+
{ key: "id", label: "ID", sortable: true },
|
|
199
|
+
{ key: "name", label: "Name", sortable: true },
|
|
200
|
+
{ key: "email", label: "Email" },
|
|
201
|
+
{ key: "created_at", label: "Created" },
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
const fetchUsers = async (page: number = 1) => {
|
|
205
|
+
// Fetch logic here
|
|
206
|
+
};
|
|
207
|
+
</script>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Dashboard Layout
|
|
211
|
+
|
|
212
|
+
```vue
|
|
213
|
+
<template>
|
|
214
|
+
<DXDashboard
|
|
215
|
+
:navigation="navigation"
|
|
216
|
+
:current-url="currentUrl"
|
|
217
|
+
title="My App"
|
|
218
|
+
page-title="Dashboard"
|
|
219
|
+
:user="user"
|
|
220
|
+
>
|
|
221
|
+
<!-- Page content goes here -->
|
|
222
|
+
<DCard>
|
|
223
|
+
<h1>Welcome to the Dashboard</h1>
|
|
224
|
+
</DCard>
|
|
225
|
+
</DXDashboard>
|
|
226
|
+
</template>
|
|
227
|
+
|
|
228
|
+
<script setup lang="ts">
|
|
229
|
+
import { DXDashboard, DCard, type Navigation } from "@omnitend/dashboard-for-laravel";
|
|
230
|
+
|
|
231
|
+
const navigation: Navigation = [
|
|
232
|
+
{
|
|
233
|
+
label: "Main",
|
|
234
|
+
items: [
|
|
235
|
+
{ label: "Dashboard", url: "/dashboard" },
|
|
236
|
+
{ label: "Users", url: "/users" },
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
label: "Settings",
|
|
241
|
+
items: [
|
|
242
|
+
{ label: "Profile", url: "/profile" },
|
|
243
|
+
{ label: "Logout", url: "/logout" },
|
|
244
|
+
],
|
|
245
|
+
},
|
|
246
|
+
];
|
|
247
|
+
|
|
248
|
+
const currentUrl = "/dashboard";
|
|
249
|
+
const user = { name: "John Doe", email: "john@example.com" };
|
|
250
|
+
</script>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Backend Usage
|
|
254
|
+
|
|
255
|
+
### Form Request
|
|
256
|
+
|
|
257
|
+
```php
|
|
258
|
+
<?php
|
|
259
|
+
|
|
260
|
+
namespace App\Http\Requests;
|
|
261
|
+
|
|
262
|
+
use OmniTend\LaravelDashboard\Http\Requests\BaseFormRequest;
|
|
263
|
+
|
|
264
|
+
class StoreUserRequest extends BaseFormRequest
|
|
265
|
+
{
|
|
266
|
+
public function rules(): array
|
|
267
|
+
{
|
|
268
|
+
return [
|
|
269
|
+
'name' => ['required', 'string', 'max:255'],
|
|
270
|
+
'email' => ['required', 'email', 'unique:users'],
|
|
271
|
+
'password' => ['required', 'min:8'],
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
protected function getValidationMessage($validator): string
|
|
276
|
+
{
|
|
277
|
+
return 'Please check your input and try again.';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### API Responses
|
|
283
|
+
|
|
284
|
+
```php
|
|
285
|
+
<?php
|
|
286
|
+
|
|
287
|
+
namespace App\Http\Controllers;
|
|
288
|
+
|
|
289
|
+
use App\Http\Controllers\Controller;
|
|
290
|
+
use OmniTend\LaravelDashboard\Traits\HasApiResponses;
|
|
291
|
+
|
|
292
|
+
class UserController extends Controller
|
|
293
|
+
{
|
|
294
|
+
use HasApiResponses;
|
|
295
|
+
|
|
296
|
+
public function store(StoreUserRequest $request)
|
|
297
|
+
{
|
|
298
|
+
$user = User::create($request->validated());
|
|
299
|
+
|
|
300
|
+
return $this->success($user, 'User created successfully', 201);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
public function destroy(User $user)
|
|
304
|
+
{
|
|
305
|
+
$user->delete();
|
|
306
|
+
|
|
307
|
+
return $this->success(null, 'User deleted successfully');
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Paginated Resources
|
|
313
|
+
|
|
314
|
+
```php
|
|
315
|
+
<?php
|
|
316
|
+
|
|
317
|
+
namespace App\Http\Controllers;
|
|
318
|
+
|
|
319
|
+
use App\Models\User;
|
|
320
|
+
use OmniTend\LaravelDashboard\Http\Resources\PaginatedResource;
|
|
321
|
+
|
|
322
|
+
class UserController extends Controller
|
|
323
|
+
{
|
|
324
|
+
public function index()
|
|
325
|
+
{
|
|
326
|
+
$users = User::paginate(15);
|
|
327
|
+
|
|
328
|
+
return new PaginatedResource($users);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Development
|
|
334
|
+
|
|
335
|
+
### Building the Package
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
npm run build
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Type Checking
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
npm run typecheck
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Watching for Changes
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
npm run dev
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Documentation
|
|
354
|
+
|
|
355
|
+
The documentation site is built with **Astro** + Vue 3 + vue-docgen-cli.
|
|
356
|
+
|
|
357
|
+
#### Run Documentation Site Locally
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
# Start Astro dev server
|
|
361
|
+
npm run docs:dev
|
|
362
|
+
|
|
363
|
+
# Build documentation site
|
|
364
|
+
npm run docs:build
|
|
365
|
+
|
|
366
|
+
# Preview built documentation
|
|
367
|
+
npm run docs:preview
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### Generate Component API Documentation
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
# Generate markdown docs from component source
|
|
374
|
+
npm run docs:generate
|
|
375
|
+
|
|
376
|
+
# Generate and build all documentation
|
|
377
|
+
npm run docs:all
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
#### Documentation Features
|
|
381
|
+
|
|
382
|
+
- **Astro** - Fast, modern static site generator with Vue 3 support
|
|
383
|
+
- **vue-docgen-cli** - Auto-generates API docs from component source
|
|
384
|
+
- **Markdown-based** - Easy to edit and maintain
|
|
385
|
+
- **Live Vue components** - Can embed interactive examples
|
|
386
|
+
- **Works with Vite 6** - No version conflicts
|
|
387
|
+
|
|
388
|
+
## Requirements
|
|
389
|
+
|
|
390
|
+
- PHP ^8.2
|
|
391
|
+
- Laravel ^11.0|^12.0
|
|
392
|
+
- Vue ^3.4.0
|
|
393
|
+
- Bootstrap Vue Next ^0.40.8
|
|
394
|
+
|
|
395
|
+
## License
|
|
396
|
+
|
|
397
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ButtonVariant, Size } from "bootstrap-vue-next";
|
|
2
|
+
type LinkVariant = "link-primary" | "link-secondary" | "link-success" | "link-danger" | "link-warning" | "link-info" | "link-light" | "link-dark";
|
|
3
|
+
interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* The visual style variant of the button
|
|
6
|
+
* @default 'primary'
|
|
7
|
+
*/
|
|
8
|
+
variant?: ButtonVariant | LinkVariant | null;
|
|
9
|
+
/**
|
|
10
|
+
* The size of the button
|
|
11
|
+
* @default 'md'
|
|
12
|
+
*/
|
|
13
|
+
size?: Size;
|
|
14
|
+
}
|
|
15
|
+
declare var __VLS_7: string | number, __VLS_8: {};
|
|
16
|
+
type __VLS_Slots = {} & {
|
|
17
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
20
|
+
variant: ButtonVariant | LinkVariant | null;
|
|
21
|
+
size: Size;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: string | number, __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|