chore: code styling via pint
This commit is contained in:
@@ -5,7 +5,8 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Meta extends Model {
|
||||
class Meta extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
@@ -13,9 +14,11 @@ class Meta extends Model {
|
||||
'value',
|
||||
];
|
||||
|
||||
public function incrementMeta($value = 1) {
|
||||
public function incrementMeta($value = 1)
|
||||
{
|
||||
$this->value = $this->value + $value;
|
||||
$this->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,8 +27,10 @@ class Meta extends Model {
|
||||
$meta = Meta::where('key', 'email_ids_created')->first();
|
||||
if ($meta) {
|
||||
$meta->incrementMeta($value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,24 +39,30 @@ class Meta extends Model {
|
||||
$meta = Meta::where('key', 'messages_received')->first();
|
||||
if ($meta) {
|
||||
$meta->incrementMeta($value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getEmailIdsCreated() {
|
||||
public static function getEmailIdsCreated()
|
||||
{
|
||||
$meta = Meta::where('key', 'email_ids_created')->first();
|
||||
if ($meta) {
|
||||
return $meta->value;
|
||||
}
|
||||
return "NaN";
|
||||
|
||||
return 'NaN';
|
||||
}
|
||||
|
||||
public static function getMessagesReceived() {
|
||||
public static function getMessagesReceived()
|
||||
{
|
||||
$meta = Meta::where('key', 'messages_received')->first();
|
||||
if ($meta) {
|
||||
return $meta->value;
|
||||
}
|
||||
return "NaN";
|
||||
|
||||
return 'NaN';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user