baopham / laravel-dynamodb

Eloquent syntax for DynamoDB
https://packagist.org/packages/baopham/dynamodb
MIT License
490 stars 127 forks source link

DynamoDbModel constructor is not calling the `initializeTraits()` method like the parent #261

Open nelson6e65 opened 1 year ago

nelson6e65 commented 1 year ago

Describe the bug DynamoDbModel is no calling initializeTraits() method, introduced in 5.7 (https://github.com/laravel/framework/blob/5.7/src/Illuminate/Database/Eloquent/Model.php#L168).

Current package constructor implementation: https://github.com/baopham/laravel-dynamodb/blob/963811691313124e7562a02aefdcc31fdbd75e78/src/DynamoDbModel.php#L70-L79

This should be solved, without BC, by just calling the base constructor:

 public function __construct(array $attributes = []) 
 { 
     parent::__construct($attributes); 

     $this->setupDynamoDb(); 
 } 

Schema

-

Debug info

-

Version info

nelson6e65 commented 6 months ago