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
* Auth documentation
* Auth documentation
* Main readme
* Field docs
* Rest methods
* Apply fixes from StyleCI (#84)
* Exception handler
* Apply fixes from StyleCI (#85)
* Homepage
* Search documentation
* Apply fixes from StyleCI (#86)
* Main
* Align meta and links
* Apply fixes from StyleCI (#87)
* Format related for details into the according repository
* Remove throw doc.
* Apply fixes from StyleCI (#89)
* Fix test
Copy file name to clipboardExpand all lines: docs/docs/README.md
+39-60Lines changed: 39 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,71 +15,50 @@ Laravel Restify has a few requirements you should be aware of before installing:
15
15
composer require binaryk/laravel-restify
16
16
```
17
17
18
+
## Setup Laravel Restify
19
+
After the instalation, the package requires a setup process, this will publish configuration, provider and will create the
20
+
`app/Restify` directory with an abstract `Repository` and scaffolding a `User` repository you can play with:
21
+
22
+
```shell script
23
+
php artisan restify:setup
24
+
```
25
+
18
26
:::tip Package Stability
19
27
20
-
If you are not able to install Restify into your application because of your `minimum-stability` setting, consider setting your `minimum-stability` option to `dev` and your `prefer-stable` option to `true`. This will allow you to install Laravel restify while still preferring stable package releases for your application.
28
+
If you are not able to install Restify into your application because of your `minimum-stability` setting,
29
+
consider setting your `minimum-stability` option to `dev` and your `prefer-stable` option to `true`.
30
+
This will allow you to install Laravel Restify while still preferring stable package
31
+
releases for your application.
21
32
:::
22
33
23
-
That's it!
24
-
25
-
Next, you may extend the `Binaryk\LaravelRestify\Controllers\RestController` and use its helpers:
26
-
27
-
```php
28
-
class UserController extends RestController
29
-
{
30
-
/**
31
-
* Display a listing of the resource.
32
-
*
33
-
* @return JsonResponse
34
-
*/
35
-
public function index()
36
-
{
37
-
$users = User::all();
38
-
39
-
return $this->respond($users);
40
-
}
41
-
}
34
+
## Quick start
35
+
36
+
Having the package setup and users table migrated, you should be good to perform the first API request:
37
+
38
+
```http request
39
+
GET: /restify-api/users?perPage=10
42
40
```
43
41
44
-
## Authentication service
45
-
46
-
For each API we have to implement the auth module from scratch. With Laravel Restify this is not a pain anymore:
47
-
48
-
```php
49
-
class AuthController extends Binaryk\LaravelRestify\Controllers\RestController
0 commit comments