CTRL + ALT + L
This commit is contained in:
parent
feb3f10074
commit
6e398c3ddf
|
@ -246,20 +246,22 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||
/**
|
||||
* @description Returns the Users "out of Credits" time
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
* @return string
|
||||
*/
|
||||
public function outOfCredits()
|
||||
{
|
||||
$usage = $this->creditUsage();
|
||||
$credits = $this->credits;
|
||||
$timeLeft = number_format(($credits*30)/$usage);
|
||||
$timeLeft = number_format(($credits * 30) / $usage);
|
||||
$unit = "days";
|
||||
|
||||
if($timeLeft < 1){
|
||||
$timeLeft = number_format(($credits*30)/$usage*24,2);
|
||||
if ($timeLeft < 1) {
|
||||
$timeLeft = number_format(($credits * 30) / $usage * 24, 2);
|
||||
$unit = "hours";
|
||||
}
|
||||
return $timeLeft." ".$unit;
|
||||
return $timeLeft . " " . $unit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue