Skip to content

Commit b06f404

Browse files
author
omaralalwisalla
committed
add spatie fractal api package
1 parent e8d41ac commit b06f404

File tree

4 files changed

+186
-3
lines changed

4 files changed

+186
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ It is a modular application, and a number of modules are installed by default. I
109109
* with Spatie Media Library and conversitions
110110
* with [Yajra DataTables](https://github.com/yajra/laravel-datatables)
111111
* with [infyom Laravel Generator](https://github.com/InfyOmLabs/laravel-generator)
112+
* with [laravel fractal](https://github.com/spatie/laravel-fractal)
112113
* All Stubs are ready to customize
113114
* Notifications for Admin
114115

@@ -194,4 +195,4 @@ OR Contact by [ Email ](mailto:[email protected])
194195

195196
## License
196197

197-
This Project is open sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
198+
This Project is open sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"spatie/laravel-activitylog": "^3.16",
3838
"spatie/laravel-backup": "^6.11",
3939
"spatie/laravel-feed": "^2.7",
40+
"spatie/laravel-fractal": "^5.8",
4041
"spatie/laravel-html": "^2.28",
4142
"spatie/laravel-medialibrary": "^9.0.0",
4243
"spatie/laravel-permission": "^3.17",

composer.lock

Lines changed: 141 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/fractal.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
return [
4+
/*
5+
* The default serializer to be used when performing a transformation. It
6+
* may be left empty to use Fractal's default one. This can either be a
7+
* string or a League\Fractal\Serializer\SerializerAbstract subclass.
8+
*/
9+
'default_serializer' => '',
10+
11+
/* The default paginator to be used when performing a transformation. It
12+
* may be left empty to use Fractal's default one. This can either be a
13+
* string or a League\Fractal\Paginator\PaginatorInterface subclass.
14+
*/
15+
'default_paginator' => '',
16+
17+
/*
18+
* League\Fractal\Serializer\JsonApiSerializer will use this value
19+
* as a prefix for generated links. Set to `null` to disable this.
20+
*/
21+
'base_url' => null,
22+
23+
/*
24+
* If you wish to override or extend the default Spatie\Fractal\Fractal
25+
* instance provide the name of the class you want to use.
26+
*/
27+
'fractal_class' => Spatie\Fractal\Fractal::class,
28+
29+
'auto_includes' => [
30+
31+
/*
32+
* If enabled Fractal will automatically add the includes who's
33+
* names are present in the `include` request parameter.
34+
*/
35+
'enabled' => true,
36+
37+
/*
38+
* The name of key in the request to where we should look for the includes to include.
39+
*/
40+
'request_key' => 'include',
41+
],
42+
];

0 commit comments

Comments
 (0)