Primer commit proyecto Laravel
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Material;
|
||||
use Livewire\Component;
|
||||
use Livewire\Attributes\On;
|
||||
|
||||
class ModalMaterias extends Component
|
||||
{
|
||||
public $material = null;
|
||||
public $carrera;
|
||||
|
||||
#[On('edit-material')]
|
||||
public function editMaterial($id)
|
||||
{
|
||||
$this->material = Material::findOrFail($id);
|
||||
|
||||
$this->dispatch('open-material-modal');
|
||||
}
|
||||
|
||||
#[On('create-material')]
|
||||
public function createMaterial()
|
||||
{
|
||||
$this->reset('material');
|
||||
$this->dispatch('open-material-modal');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.modal-materias');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user