Skip to content

Commit fcadfd4

Browse files
committed
Reference
1 parent bed1dce commit fcadfd4

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

api/api.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/reference.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# API Reference
2+
3+
## Common Attribute Reference
4+
5+
The following are core attributes that you will reach for commonly.
6+
7+
Attribute | Description
8+
--------- | ------------
9+
[data-request](#) | Makes a request to a given AJAX handler
10+
[data-request-data](#) | Supplies postback data with the request
11+
[data-request-trigger](#) | The event that triggers the request
12+
13+
## Additional Attribute Reference
14+
15+
All other attributes are specified below.
16+
17+
Attribute | Description
18+
--------- | ------------
19+
[data-request-query](#) | Supplies query data with the request and modifies the URL
20+
[data-request-confirm](#) | Displays a confirmation message before sending the request.
21+
[data-request-before-update](#) | Execute JavaScript before the page contents are updated.
22+
[data-request-success](#) | Execute JavaScript on a successful request.
23+
[data-request-error](#) | Execute JavaScript on a failed request.
24+
[data-request-complete](#) | Execute JavaScript on every completed request.
25+
[data-request-cancel](#) | Execute JavaScript if the user aborts the request or cancels it via a confirmation dialog.

guide/getting-started.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ npm i larajax
1111

1212
```php
1313
// Controller
14-
public function onSave() {
14+
public function onSave()
15+
{
1516
// ...
1617
return ['#message' => view('partials.message')];
1718
}
1819
```
1920

2021
## What problem are we solving?
2122

22-
Primarily it is API access. We often need to define two types of endpoints, pages that render to the browser and API endpoints that perform actions (usually RESTful).
23+
Primarily Larajax is useful for defining _internal_ APIs that are defined and consumed by the same application. We often need to define two types of endpoints, pages that render to the browser and API endpoints that perform actions (usually RESTful).
2324

24-
The problem with RESTful endpoints is they can quickly get disorganised, since they are global to the application by default. For example, a simple profile page may look like this:
25+
The problem with using RESTful endpoints as internal APIs is they can quickly get disorganised, since they are global to the application by default. For example, a simple profile page may look like this:
2526

2627
```php
2728
Route::get('/user-profile', ...);

0 commit comments

Comments
 (0)