Agregando documentos
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -10,4 +11,18 @@ class Efectivo extends Model
|
||||
use HasUlids;
|
||||
|
||||
protected $table = 'efectivos';
|
||||
|
||||
public function getTotal(): Attribute {
|
||||
return Attribute::get(function () {
|
||||
return $this->veinte_mil
|
||||
+ $this->diez_mil
|
||||
+ $this->cinco_mil
|
||||
+ $this->dos_mil
|
||||
+ $this->mil
|
||||
+ $this->quinientos
|
||||
+ $this->cien
|
||||
+ $this->cincuenta
|
||||
+ $this->diez;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user