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
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
8
+
A Laravel package for extracting data from Eloquent models and their relationships with flexible configuration options. This package provides a simple and intuitive way to extract structured data from your models, making it perfect for API responses, data exports, or any scenario where you need to transform model data into a specific format.
The extractor leverages Laravel's relationship system to automatically include related data based on your configuration, while providing fine-grained control over which fields are included or excluded from the extraction process.
13
13
14
-
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
14
+
You can use the available options inside config file:
15
15
16
-
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
16
+
```php
17
+
use NaimSolong\DataExtractor\Extract;
18
+
19
+
// Option
20
+
(new Extract)
21
+
->option('User')
22
+
->queryId(4)
23
+
->toSql();
24
+
25
+
// Source
26
+
(new Extract)
27
+
->source('session')
28
+
->queryId(3)
29
+
->toSql();
30
+
```
31
+
32
+
Or you can use model that you have queried:
33
+
34
+
```php
35
+
use NaimSolong\DataExtractor\Extract;
36
+
use App\Models\User;
37
+
38
+
// Extract directly
39
+
(new Extract)
40
+
->toSql(
41
+
User::get()
42
+
);
43
+
```
17
44
18
45
## Installation
19
46
@@ -23,13 +50,6 @@ You can install the package via composer:
0 commit comments