Skip to content

Commit

Permalink
Merge pull request #1 from holozaen/laravel-8
Browse files Browse the repository at this point in the history
update to laravel 8 compat
  • Loading branch information
holozaen committed Feb 22, 2021
2 parents adc9278 + 87259e4 commit e51b550
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
24 changes: 20 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"laravel/framework": ">=6.0.0 <9"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"phpunit/phpunit": "^8.0.0",
"orchestra/testbench": "^4.0.0",
"orchestra/database": "^4.0.0"
"laravel/legacy-factories": "^1.1",
"orchestra/testbench": "^6.0.0",
"phpunit/phpunit": "^8.0.0"
},
"autoload": {
"psr-4": {
Expand All @@ -43,5 +42,22 @@
},
"config": {
"sort-packages": true
},
"application": "",
"boundedContext": "",
"boundedContextName": "",
"core": {
"language": "csharp"
},
"interaction": [],
"resources": {
"readModels": {
"production": "",
"development": ""
},
"eventStore": {
"production": "",
"development": ""
}
}
}
7 changes: 1 addition & 6 deletions src/Models/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Feature extends Model
protected $table = 'plan_features';
protected $guarded = [];
protected $casts = [
'limit' => 'Integer'
'limit' => 'int'
];

public function plan(): BelongsTo
Expand All @@ -44,31 +44,26 @@ public function plan(): BelongsTo

public function scopeCode($query, string $code): Builder
{
/** @noinspection PhpUndefinedMethodInspection */
return $query->where('code', $code);
}

public function scopeLimited($query): Builder
{
/** @noinspection PhpUndefinedMethodInspection */
return $query->where('type', self::TYPE_LIMIT)->where('limit', '>', 0);
}

public function scopeUnlimited($query): Builder
{
/** @noinspection PhpUndefinedMethodInspection */
return $query->where('type', self::TYPE_LIMIT)->where('limit', '=', 0);
}

public function scopeFeature($query): Builder
{
/** @noinspection PhpUndefinedMethodInspection */
return $query->where('type', self::TYPE_FEATURE);
}

public function scopeLimitType($query): Builder
{
/** @noinspection PhpUndefinedMethodInspection */
return $query->where('type', self::TYPE_LIMIT);
}

Expand Down

0 comments on commit e51b550

Please sign in to comment.