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
Many of the example codes in this document are querying to [DynamoDB's official sample data](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleData.LoadData.html). If you want to try these codes with actual DynamoDB tables, it's handy to load them to your tables before.
132
+
Many of the example codes in this document are querying to [DynamoDB's official sample data](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AppendixSampleTables.html). If you want to try these codes with actual DynamoDB tables, it's handy to load them to your tables before.
133
133
134
134
## Model
135
135
@@ -224,18 +224,13 @@ You also can override the `scan()` method to fit your needs, such as filtering m
224
224
```php
225
225
public static function scan($exclusiveStartKey = null, $sort = 'asc', $limit = 50)
Please refer to [Query Builder](#query-builder) for the details.
348
343
349
344
## Authentication with model
350
345
351
-
We can create a Custom User Provider to authenticate with DynamoDB. For the detail, please refer to [Laravel's official document](https://laravel.com/docs/8.x/authentication#adding-custom-user-providers).
346
+
We can create a Custom User Provider to authenticate with DynamoDB. For the detail, please refer to [Laravel's official document](https://laravel.com/docs/authentication#adding-custom-user-providers).
352
347
353
348
To use authentication with the model, the model should implement `Illuminate\Contracts\Auth\Authenticatable` contract. In this section, we'll use the example `User` model above.
354
349
@@ -460,7 +455,6 @@ $connection = new Kitar\Dynamodb\Connection([
460
455
]);
461
456
462
457
$result = $connection->table('Thread')->scan();
463
-
464
458
```
465
459
466
460
If we query through the model, we don't need to specify the table name, and the response will be the model instance(s).
@@ -475,7 +469,7 @@ $threads = Thread::scan();
475
469
476
470
```php
477
471
$response = DB::table('ProductCatalog')
478
-
->getItem(['Id' => 101]);
472
+
->getItem(['Id' => 101]);
479
473
```
480
474
481
475
> Instead of marshaling manually, pass a plain array. `Kitar\Dynamodb\Query\Grammar` will automatically marshal them before querying.
@@ -529,8 +523,8 @@ We can specify Projection Expressions in the same manner as the original `select
If you are using Query Builder through model, you can access to `exclusiveStartKey` by:
714
708
715
709
```php
716
710
$products = ProductCatalog::limit(5)->scan();
717
711
712
+
$products->getLastEvaluatedKey(); // array
713
+
```
714
+
715
+
Alternatively, you can achieve the same result using individual models; however, please be aware that this approach is planned to be deprecated in versions subsequent to v2.x.
0 commit comments