diff --git a/.gitignore b/.gitignore index 30159d2c..3582adbc 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ npm-debug.log yarn-error.log .npmrc /tests/coverage +.zshrc +.npm/ +.composer/ # Ignore public favicon /public/android-chrome-192x192.png diff --git a/app/Models/Customer.php b/app/Models/Customer.php index cbafc5e4..8c4b6e18 100644 --- a/app/Models/Customer.php +++ b/app/Models/Customer.php @@ -500,7 +500,7 @@ class Customer extends Authenticatable implements MustVerifyEmail */ public function recipes(): \Illuminate\Database\Eloquent\Relations\MorphToMany { - return $this->morphedByMany(Recipe::class, 'customerable')->with('products', 'consumptionMoment'); + return $this->morphedByMany(Recipe::class, 'customerable')->with('products', 'consumptionMoment')->withTimestamps(); } /** @@ -510,7 +510,7 @@ class Customer extends Authenticatable implements MustVerifyEmail */ public function products(): \Illuminate\Database\Eloquent\Relations\MorphToMany { - return $this->morphedByMany(Product::class, 'customerable'); + return $this->morphedByMany(Product::class, 'customerable')->withTimestamps(); } /** @@ -520,6 +520,6 @@ class Customer extends Authenticatable implements MustVerifyEmail */ public function surveyAnswers(): \Illuminate\Database\Eloquent\Relations\MorphToMany { - return $this->morphedByMany(SurveysAnswer::class, 'customerable')->with('newsClub'); + return $this->morphedByMany(SurveysAnswer::class, 'customerable')->with('newsClub')->withTimestamps(); } } diff --git a/database/migrations/2025_09_05_161808_alter_customerables_table.php b/database/migrations/2025_09_05_161808_alter_customerables_table.php new file mode 100644 index 00000000..2b515e6c --- /dev/null +++ b/database/migrations/2025_09_05_161808_alter_customerables_table.php @@ -0,0 +1,28 @@ +timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('customerables', function (Blueprint $table) { + $table->dropTimestamps(); + }); + } +};