Changeset View
Changeset View
Standalone View
Standalone View
src/app/Policy/RateLimit.php
- This file was added.
<?php | |||||
namespace App\Policy; | |||||
use Illuminate\Database\Eloquent\Model; | |||||
class RateLimit extends Model | |||||
{ | |||||
protected $fillable = [ | |||||
'user_id', | |||||
'owner_id', | |||||
'recipient_hash', | |||||
'recipient_count' | |||||
]; | |||||
protected $table = 'policy_ratelimit'; | |||||
machniak: We should add protected $keyType = 'bigint'; here. | |||||
public function owner() | |||||
{ | |||||
$this->belongsTo('App\User'); | |||||
} | |||||
public function user() | |||||
{ | |||||
$this->belongsTo('App\User'); | |||||
} | |||||
/** | |||||
* determines whether or not the account was ever paid for | |||||
*/ | |||||
public static function hasPaid() | |||||
{ | |||||
Done Inline ActionsCan be removed? mollekopf: Can be removed? | |||||
return false; | |||||
} | |||||
/** | |||||
* determines whether or not the account is in its trial period | |||||
*/ | |||||
public static function isTrial() | |||||
{ | |||||
Done Inline ActionsCan be removed? mollekopf: Can be removed? | |||||
return true; | |||||
} | |||||
/** | |||||
* determines whether a threshold is met | |||||
*/ | |||||
public static function surpassesThreshold() | |||||
{ | |||||
Done Inline ActionsCan be removed? mollekopf: Can be removed? | |||||
return true; | |||||
} | |||||
} |
We should add protected $keyType = 'bigint'; here.