Skip to content

Commit b8e1342

Browse files
committed
wip
1 parent 2f189e6 commit b8e1342

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ $projectsProLimit->decrementBy(3);
9292
###### Possible values for "reset_frequency" column
9393

9494
- null
95-
- "every second"
95+
- "every second" // works in Laravel >= 10
9696
- "every minute"
9797
- "every hour"
9898
- "every day"
@@ -155,18 +155,18 @@ $user->resetLimit($projectsStandardLimit);
155155

156156
#### All available methods
157157

158-
| Method | Return Type | Parameters |
159-
| ---------------- | ----------- | ------------------------------------------------------------------------------------------ |
160-
| setLimit | bool | string\|LimitContract $limit, <br> ?string $plan = null, <br> float\|int $usedAmount = 0.0 |
161-
| unsetLimit | bool | string\|LimitContract $limit, <br> ?string $plan = null |
162-
| isLimitSet | bool | string\|LimitContract $limit, <br> ?string $plan = null |
163-
| useLimit | bool | string\|LimitContract $limit, <br> ?string $plan = null, <br> float\|int $amount = 1.0 |
164-
| unuseLimit | bool | string\|LimitContract $limit, <br> ?string $plan = null, <br> float\|int $amount = 1.0 |
165-
| resetLimit | bool | string\|LimitContract $limit, <br> ?string $plan = null |
166-
| hasEnoughLimit | bool | string\|LimitContract $limit, <br> ?string $plan = null |
167-
| usedLimit | float | string\|LimitContract $limit, <br> ?string $plan = null |
168-
| remainingLimit | float | string\|LimitContract $limit, <br> ?string $plan = null |
169-
| limitUsageReport | array | string\|LimitContract\|null $limit = null, <br> ?string $plan = null |
158+
| Method | Return Type | Parameters |
159+
| ---------------- | ----------- | ---------------------------------------------------------------------------------- |
160+
| setLimit | bool | string\|Limit $limit, <br> ?string $plan = null, <br> float\|int $usedAmount = 0.0 |
161+
| unsetLimit | bool | string\|Limit $limit, <br> ?string $plan = null |
162+
| isLimitSet | bool | string\|Limit $limit, <br> ?string $plan = null |
163+
| useLimit | bool | string\|Limit $limit, <br> ?string $plan = null, <br> float\|int $amount = 1.0 |
164+
| unuseLimit | bool | string\|Limit $limit, <br> ?string $plan = null, <br> float\|int $amount = 1.0 |
165+
| resetLimit | bool | string\|Limit $limit, <br> ?string $plan = null |
166+
| hasEnoughLimit | bool | string\|Limit $limit, <br> ?string $plan = null |
167+
| usedLimit | float | string\|Limit $limit, <br> ?string $plan = null |
168+
| remainingLimit | float | string\|Limit $limit, <br> ?string $plan = null |
169+
| limitUsageReport | array | string\|Limit\|null $limit = null, <br> ?string $plan = null |
170170

171171
#### All available commands
172172

@@ -207,10 +207,10 @@ Add `limit:reset` command to the console kernel.
207207
protected function schedule(Schedule $schedule)
208208
{
209209
...
210-
// Laravel 8 & 9
210+
// Laravel < 10
211211
$schedule->command('limit:reset')->everyMinute();
212212

213-
// Laravel 10 & 11
213+
// Laravel >= 10
214214
$schedule->command('limit:reset')->everySecond();
215215
...
216216
}

src/Traits/HasLimits.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function remainingLimit(string|LimitContract $name, ?string $plan = null)
161161
return $limit->allowed_amount - $limit->pivot->used_amount;
162162
}
163163

164-
public function getModelLimit(string|LimitContract $name, ?string $plan = null)
164+
public function getModelLimit(string|LimitContract $name, ?string $plan = null): LimitContract
165165
{
166166
$limit = app(LimitContract::class)::findByName($name, $plan);
167167

0 commit comments

Comments
 (0)