Skip to content

Commit 71122c7

Browse files
committed
fixes
1 parent c4ba7f7 commit 71122c7

9 files changed

Lines changed: 9 additions & 24 deletions

File tree

config/subscribable.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22

33
// Config for yuges/subscribable
44

5-
use Yuges\Package\Enums\KeyType;
6-
75
return [
86
/*
97
* FQCN (Fully Qualified Class Name) of the models to use for subscriptions
108
*/
119
'models' => [
1210
'plan' => [
13-
'key' => KeyType::Ulid,
11+
'key' => Yuges\Package\Enums\KeyType::BigInteger,
1412
'class' => Yuges\Subscribable\Models\Plan::class,
1513
],
1614
'feature' => [
17-
'key' => KeyType::Ulid,
15+
'key' => Yuges\Package\Enums\KeyType::BigInteger,
1816
'class' => Yuges\Subscribable\Models\Feature::class,
1917
],
2018
'subscriber' => [
21-
'key' => KeyType::Ulid,
19+
'key' => Yuges\Package\Enums\KeyType::BigInteger,
2220
'default' => [
2321
'class' => \App\Models\User::class,
2422
],
@@ -29,7 +27,7 @@
2927
],
3028
],
3129
'subscribable' => [
32-
'key' => KeyType::Ulid,
30+
'key' => Yuges\Package\Enums\KeyType::BigInteger,
3331
'default' => [
3432
'class' => \App\Models\User::class,
3533
],
@@ -40,7 +38,7 @@
4038
],
4139
],
4240
'subscription' => [
43-
'key' => KeyType::Ulid,
41+
'key' => Yuges\Package\Enums\KeyType::BigInteger,
4442
'class' => Yuges\Subscribable\Models\Subscription::class,
4543
],
4644
],

database/migrations/create_features_table.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function up(): void
2626
$table->string('name');
2727

2828
$table->timestamps();
29-
$table->softDeletes();
3029
});
3130
}
3231
};

database/migrations/create_plans_table.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public function up(): void
3434

3535
$table->timestamp('expired_at')->nullable();
3636
$table->timestamps();
37-
$table->softDeletes();
3837
});
3938
}
4039
};

database/migrations/create_subscriptions_table.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function up(): void
3535

3636
$table->timestamp('expired_at')->nullable();
3737
$table->timestamps();
38-
$table->softDeletes();
3938
});
4039
}
4140
};

src/Models/Feature.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
namespace Yuges\Subscribable\Models;
44

55
use Yuges\Package\Models\Model;
6-
use Illuminate\Database\Eloquent\Concerns\HasUlids;
76
use Illuminate\Database\Eloquent\Factories\HasFactory;
87

98
class Feature extends Model
109
{
11-
use
12-
HasUlids,
13-
HasFactory;
10+
use HasFactory;
1411

1512
protected $table = 'features';
1613

src/Models/Plan.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
namespace Yuges\Subscribable\Models;
44

55
use Yuges\Package\Models\Model;
6-
use Illuminate\Database\Eloquent\Concerns\HasUlids;
76
use Illuminate\Database\Eloquent\Factories\HasFactory;
87

98
class Plan extends Model
109
{
11-
use
12-
HasUlids,
13-
HasFactory;
10+
use HasFactory;
1411

1512
protected $table = 'plans';
1613

src/Models/Subscription.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
use Yuges\Package\Models\Model;
66
use Yuges\Subscribable\Traits\HasSubscriber;
77
use Yuges\Subscribable\Traits\HasSubscribable;
8-
use Illuminate\Database\Eloquent\Concerns\HasUlids;
98
use Illuminate\Database\Eloquent\Factories\HasFactory;
109

1110
class Subscription extends Model
1211
{
1312
use
14-
HasUlids,
1513
HasFactory,
1614
HasSubscriber,
1715
HasSubscribable;

tests/src/Stubs/Migrations/create_channels_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ public function up(): void
1919
}
2020

2121
Schema::create($this->table, function (Blueprint $table) {
22-
$table->key(KeyType::Ulid);
22+
$table->key(KeyType::BigInteger);
2323

2424
$table->string('name');
2525

2626
$table->timestamps();
27-
$table->softDeletes();
2827
});
2928
}
3029
};

tests/src/Stubs/Models/Channel.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
use Yuges\Package\Models\Model;
66
use Yuges\Subscribable\Interfaces\Subscriber;
77
use Yuges\Subscribable\Interfaces\Subscribable;
8-
use Illuminate\Database\Eloquent\Concerns\HasUlids;
98
use Yuges\Subscribable\Traits\HasSubscriptionsAndCanSubscribe;
109

1110
class Channel extends Model implements Subscriber, Subscribable
1211
{
13-
use HasUlids, HasSubscriptionsAndCanSubscribe;
12+
use HasSubscriptionsAndCanSubscribe;
1413

1514
protected $table = 'channels';
1615

0 commit comments

Comments
 (0)