From 1ff3ee56c7b8c62ea753b063797198e67185b973 Mon Sep 17 00:00:00 2001 From: Assada Date: Fri, 1 Jul 2022 22:40:34 +0300 Subject: [PATCH] Updated to Laravel 9 --- composer.json | 2 +- src/AchievementsServiceProvider.php | 2 +- src/EntityRelationsAchievements.php | 2 +- src/Migrations/0000_00_00_000000_create_achievements_tables.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 5d8d83f..53e6d29 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,6 @@ }, "require-dev": { "phpunit/phpunit": "^8", - "laravel/laravel": "^6.0|^7.0|^8.0" + "laravel/laravel": "^6.0|^7.0|^8.0|^9.0" } } diff --git a/src/AchievementsServiceProvider.php b/src/AchievementsServiceProvider.php index 284f141..69e69df 100644 --- a/src/AchievementsServiceProvider.php +++ b/src/AchievementsServiceProvider.php @@ -43,7 +43,7 @@ public function boot(): void ); $this->publishes( [ - __DIR__ . '/Migrations/0000_00_00_000000_create_achievements_tables.php' => database_path('migrations') . '/000_00_00_000000_create_achievements_tables.php' + __DIR__ . '/Migrations/0000_00_00_000000_create_achievements_tables.php' => database_path('migrations/000_00_00_000000_create_achievements_tables.php') ], 'migrations' ); diff --git a/src/EntityRelationsAchievements.php b/src/EntityRelationsAchievements.php index bca9996..7e457ef 100644 --- a/src/EntityRelationsAchievements.php +++ b/src/EntityRelationsAchievements.php @@ -22,7 +22,7 @@ trait EntityRelationsAchievements */ public function achievements(): MorphMany { - if (config('achievements.locked_sync')) { + if (config('achievements.locked_sync') && !empty($this->id)) { $this->syncAchievements(); } return $this->morphMany(AchievementProgress::class, 'achiever') diff --git a/src/Migrations/0000_00_00_000000_create_achievements_tables.php b/src/Migrations/0000_00_00_000000_create_achievements_tables.php index fa10a25..fe8c752 100644 --- a/src/Migrations/0000_00_00_000000_create_achievements_tables.php +++ b/src/Migrations/0000_00_00_000000_create_achievements_tables.php @@ -33,7 +33,7 @@ public function up(): void Schema::create( $this->achievementDetailsTableName, static function (Blueprint $table) { - $table->increments('id'); + $table->id(); $table->string('name'); $table->string('description'); $table->unsignedInteger('points')->default(1);