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: index.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Larajax is a small AJAX library for Laravel, built to simplify dynamic interacti
4
4
5
5
It lets your HTML call **Laravel controller methods** directly using `data-request`. No public API routes. No duplicated endpoints. Each controller keeps its own actions.
6
6
7
-
You define small, focused handlers and trigger them straight from the view. They behave like API calls but live alongside your page controllers—no separate API layer needed.
7
+
You define small, focused handlers and trigger them straight from the view. They behave like API calls but live alongside your page controllers, with no separate API layer needed.
8
8
9
9
On the browser side, Larajax ships with a **lightweight JavaScript library**. Your markup fires the action. Larajax sends the request and applies the response. You can also call handlers programmatically with `jax.ajax()` when needed.
10
10
@@ -102,6 +102,8 @@ Once actions are local to a page instead of global, a natural question follows
102
102
103
103
### Components Solve Reusability
104
104
105
+
Components allow page-local reuse without introducing shared routes or shared controllers.
106
+
105
107
Every controller supports a `$components` property to define reusable behavior. Any AJAX handlers found in those component classes are automatically registered on the controller that includes them.
106
108
107
109
```php
@@ -185,6 +187,8 @@ Larajax provides a global `ajax()` helper that returns a `Larajax\Classes\AjaxRe
185
187
186
188
Instead of returning raw JSON and handling it manually on the client, you describe the outcome directly in the controller.
187
189
190
+
A handler can return multiple browser instructions in a single response.
0 commit comments