33 lines
730 B
PHP
33 lines
730 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
use Livewire\Component;
|
|
use Illuminate\Support\Str;
|
|
use App\Models\recarga;
|
|
|
|
|
|
class ShowWompi extends Component
|
|
{
|
|
public $monto;
|
|
public $referencia;
|
|
|
|
public function render()
|
|
{
|
|
if (empty($this->referencia)){
|
|
$this->referencia = Str::random(20);
|
|
|
|
$recargas = new recarga;
|
|
$recargas->monto = $this->monto;
|
|
$recargas->reference = $this->referencia;
|
|
$recargas-> status = 'pendiente_wompi';
|
|
$recargas-> usuario_id = auth()->user()->id;
|
|
$recargas-> saldo_id= auth()->user()->saldo->id;
|
|
$recargas->save();
|
|
}
|
|
|
|
|
|
return view('livewire.show-wompi');
|
|
}
|
|
}
|