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: DOCS.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,35 @@
1
1
# SproutPHP Documentation
2
2
3
+
## [v0.1.7-beta.1] - 2024-06-09
4
+
5
+
### New Features & Improvements
6
+
7
+
-**Dynamic Route Parameters:** Define routes with parameters (e.g., `/user/{id}`, `/blog/{slug}`) for flexible CRUD and API endpoints.
8
+
-**Robust CSRF Protection:** Middleware-based CSRF protection for all state-changing requests (forms, AJAX, HTMX). Use `{{ csrf_field()|raw }}` in forms and `{{ csrf_token() }}` for AJAX/HTMX headers. All tokens use the `_csrf_token` session key.
9
+
-**SPA-like Interactivity with HTMX:** Use HTMX attributes for seamless, partial updates (e.g., form submissions, file uploads) and request indicators (spinners). Example:
10
+
```html
11
+
<form
12
+
hx-post="/validation-test"
13
+
hx-target="#form-container"
14
+
hx-swap="innerHTML"
15
+
hx-indicator="#spinner"
16
+
hx-trigger="submit delay:500ms"
17
+
>
18
+
...
19
+
</form>
20
+
```
21
+
-**Private File Handling:** Upload files to private storage (not web-accessible). Download private files only via internal controller methods (no direct links). Example:
22
+
```php
23
+
// Upload
24
+
Storage::put($file, '', 'private');
25
+
// Download (controller)
26
+
$path = Storage::path($filename, 'private');
27
+
```
28
+
-**Storage Improvements:** Storage paths are now always resolved relative to the project root. Public/private separation, symlink support for serving public files, and compatibility with the PHP built-in server for downloads.
29
+
-**UI/UX:** Two-column grid for validation and file upload forms, spinner/indicator support, and SPA feel for user interactions.
30
+
31
+
---
32
+
3
33
## Included by Default
4
34
5
35
-**HTMX** for modern, interactive UIs (already loaded in your base template)
@@ -543,6 +573,7 @@ To make uploaded files accessible via the web, create a symlink:
543
573
```bash
544
574
php sprout symlink:create
545
575
```
576
+
546
577
- This links `public/storage` to `storage/app/public`.
547
578
- On Windows, a directory junction is created for compatibility.
548
579
@@ -577,6 +608,7 @@ if ($request->hasFile('avatar')) {
577
608
```
578
609
579
610
### Notes
611
+
580
612
- Always use the `Storage` helper for uploads and URLs.
581
613
- The storage root is now absolute for reliability.
582
614
- No need to set or override the storage root in `.env` unless you have a custom setup.
0 commit comments