Skip to content

Commit 0a3b76e

Browse files
committed
update README
1 parent b2070d1 commit 0a3b76e

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,62 @@
4242
<h3>πŸ”” Package for easily attaching subscriptions to Laravel eloquent models</h3>
4343
</div>
4444

45+
<br>
46+
4547
# πŸ’Ώ Installation
4648

49+
### β†’ Composer
50+
4751
You can install the package via composer:
4852

4953
```
5054
composer require yuges-code/laravel-subscribable
5155
```
5256

57+
### β†’ Publishing Config
58+
59+
Publishing the config file (config/subscribable.php) is optional:
60+
61+
```
62+
php artisan vendor:publish --provider="Yuges\Subscribable\Providers\SubscribableServiceProvider" --tag="subscribable-config"
63+
```
64+
65+
### β†’ Publishing Migrations
66+
67+
You need to publish the migration to create the subscriptions table:
68+
69+
```
70+
php artisan vendor:publish --provider="Yuges\Subscribable\Providers\SubscribableServiceProvider" --tag="subscribable-migrations"
71+
```
72+
73+
### β†’ Running Migrations
74+
75+
After that, you need to run migrations:
76+
77+
```
78+
php artisan migrate
79+
```
80+
81+
<br>
82+
5383
# πŸ§ͺ Running Tests
5484

85+
### β†’ PHPUnit tests
86+
5587
To run tests, run the following command:
5688

5789
```
5890
composer test
5991
```
6092

93+
<br>
94+
6195
# βš–οΈ License
6296

6397
The MIT License (MIT). Please see [License File](LICENSE) for more information.
6498

99+
<br>
100+
65101
# πŸ™†πŸΌβ€β™‚οΈ Authors Information
66102

67103
Created in 2025 by:

β€Žsrc/Traits/HasSubscriptions.phpβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function subscriptions(): MorphMany
2828

2929
public function subscribableSubscriptions(): MorphMany
3030
{
31-
return $this->morphMany(Config::getSubscriptionClass(), 'subscribable');
31+
return $this->morphMany(Config::getSubscriptionClass(Subscription::class), 'subscribable');
3232
}
3333

3434
public function latestSubscription(): MorphOne

0 commit comments

Comments
Β (0)