Skip to content

Commit

Permalink
add spatie fractal api package
Browse files Browse the repository at this point in the history
  • Loading branch information
omaralalwisalla committed Nov 13, 2021
1 parent e8d41ac commit b06f404
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ It is a modular application, and a number of modules are installed by default. I
* with Spatie Media Library and conversitions
* with [Yajra DataTables](https://github.com/yajra/laravel-datatables)
* with [infyom Laravel Generator](https://github.com/InfyOmLabs/laravel-generator)
* with [laravel fractal](https://github.com/spatie/laravel-fractal)
* All Stubs are ready to customize
* Notifications for Admin

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

## License

This Project is open sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
This Project is open sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"spatie/laravel-activitylog": "^3.16",
"spatie/laravel-backup": "^6.11",
"spatie/laravel-feed": "^2.7",
"spatie/laravel-fractal": "^5.8",
"spatie/laravel-html": "^2.28",
"spatie/laravel-medialibrary": "^9.0.0",
"spatie/laravel-permission": "^3.17",
Expand Down
143 changes: 141 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions config/fractal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

return [
/*
* The default serializer to be used when performing a transformation. It
* may be left empty to use Fractal's default one. This can either be a
* string or a League\Fractal\Serializer\SerializerAbstract subclass.
*/
'default_serializer' => '',

/* The default paginator to be used when performing a transformation. It
* may be left empty to use Fractal's default one. This can either be a
* string or a League\Fractal\Paginator\PaginatorInterface subclass.
*/
'default_paginator' => '',

/*
* League\Fractal\Serializer\JsonApiSerializer will use this value
* as a prefix for generated links. Set to `null` to disable this.
*/
'base_url' => null,

/*
* If you wish to override or extend the default Spatie\Fractal\Fractal
* instance provide the name of the class you want to use.
*/
'fractal_class' => Spatie\Fractal\Fractal::class,

'auto_includes' => [

/*
* If enabled Fractal will automatically add the includes who's
* names are present in the `include` request parameter.
*/
'enabled' => true,

/*
* The name of key in the request to where we should look for the includes to include.
*/
'request_key' => 'include',
],
];

0 comments on commit b06f404

Please sign in to comment.