Skip to content

Commit 23e03c8

Browse files
committed
feat: add scaffolds docs
1 parent c897b61 commit 23e03c8

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.vitepress/config/sidebar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const sidebar = [
99
{ text: 'Migration Guide', link: '/docs/migrating' },
1010
// { text: 'Functional Mode', link: '/docs/config/functional-mode' },
1111
{ text: 'Modules', link: '/docs/modules' },
12+
{ text: 'Leaf MVC Scaffolding', link: '/docs/mvc/scaffolds' },
1213
],
1314
},
1415
// {

src/docs/mvc/scaffolds.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Application Scaffolding <Badge>Leaf MVC Only</Badge>
2+
3+
Leaf 4 is all about how quickly you can go from idea to a working application, and scaffolding is a big part of that. Leaf MVC comes with a powerful console tool that allows you to scaffold entire features in your application with a single command.
4+
5+
## Authentication
6+
7+
Authentication with Leaf is straightforward and is powered by [Leaf Auth](/docs/auth/) which provides a simple way to authenticate users in your application, plus other essentials like middleware, password hashing, and user management, all out of the box. Leaf MVC's scaffolding tool takes this a step further by allowing you to scaffold an entire authentication system with models, controllers, routes and even views that use your configured frontend tooling.
8+
9+
You can get started using the `scaffold:auth` command:
10+
11+
```bash:no-line-numbers
12+
php leaf scaffold:auth
13+
```
14+
15+
The scaffold:auth command sets up a fully functional authentication system, including:
16+
17+
- User model with a database schema file
18+
- Authentication controllers (login, register, dashboard)
19+
- Authentication routes
20+
- Middleware for route protection
21+
- Views tailored to your frontend setup
22+
- Dashboard tailored to your frontend setup
23+
- Account update example
24+
25+
This is automatically done for you if you choose to install the application starter during installation.
26+
27+
<img src="https://github.com/user-attachments/assets/19080187-e56d-4e4a-beac-cf71c1717647" alt="auth Page" width="100%" class="border border-gray-500 rounded-lg">
28+
29+
## Landing Page
30+
31+
Another annoying starting point for most developers is the landing page. Leaf MVC's scaffolding tool allows you to scaffold a landing page with a single command:
32+
33+
```bash:no-line-numbers
34+
php leaf scaffold:landing-page
35+
```
36+
37+
You get:
38+
39+
- A structured homepage layout
40+
- Sections like hero, features, and footers
41+
- Tailwind for styling + your preferred frontend setup
42+
- Easy customization with Leaf Zero components
43+
44+
<img src="https://github.com/user-attachments/assets/3f078440-a7a1-4586-9239-a738398f9536" alt="lander" width="100%" class="border border-gray-500 rounded-lg">
45+
46+
## Coming Soon page/Waitlist page <Badge type="warning">Coming Soon</Badge>
47+
48+
A waitlist/coming page is the easiest way to put your product out there, generate engagement and get some leads all while your application is still in development. You will be able to scaffold these pages using:
49+
50+
```bash:no-line-numbers
51+
php leaf scaffold:waitlist
52+
53+
# or for coming soon
54+
php leaf scaffold:coming-soon
55+
```
56+
57+
These will give you:
58+
59+
- Structured waitlist/coming soon pages
60+
- Middleware and routes to redirect to waitlist/coming soon page
61+
- Models and schema files for email collection
62+
- Jobs to export waitlist
63+
- Mailers to notify waitlist

0 commit comments

Comments
 (0)