diff --git a/app/Jobs/CacheOrdinalsCollectionStats.php b/app/Jobs/CacheOrdinalsCollectionStats.php index c8133d5..1dce5ae 100644 --- a/app/Jobs/CacheOrdinalsCollectionStats.php +++ b/app/Jobs/CacheOrdinalsCollectionStats.php @@ -37,6 +37,9 @@ public function handle(): void $model = new FloorPrice; $model->symbol = $response->json('symbol'); + $model->owners = $response->json('owners'); + $model->supply = $response->json('supply'); + $model->listed = $response->json('totalListed'); $model->price_in_sats = $response->json('floorPrice'); $model->save(); } diff --git a/app/Models/FloorPrice.php b/app/Models/FloorPrice.php index 14e034f..303ba69 100644 --- a/app/Models/FloorPrice.php +++ b/app/Models/FloorPrice.php @@ -7,4 +7,10 @@ class FloorPrice extends Model { const UPDATED_AT = null; + + protected $casts = [ + 'owners' => 'integer', + 'supply' => 'integer', + 'listed' => 'integer', + ]; } diff --git a/database/migrations/2024_12_21_072800_add_owners_and_supply_to_floor_prices_table.php b/database/migrations/2024_12_21_072800_add_owners_and_supply_to_floor_prices_table.php new file mode 100644 index 0000000..d3461eb --- /dev/null +++ b/database/migrations/2024_12_21_072800_add_owners_and_supply_to_floor_prices_table.php @@ -0,0 +1,28 @@ +integer('owners')->unsigned()->nullable()->after('symbol'); + $table->integer('supply')->unsigned()->nullable()->after('owners'); + $table->integer('listed')->unsigned()->nullable()->after('supply'); + }); + } + + public function down(): void + { + Schema::table('floor_prices', function (Blueprint $table) { + $table->dropColumn([ + 'owners', + 'supply', + 'listed', + ]); + }); + } +};