parfum/app/Livewire/Studio/Setting/Profile.php
Yoga Pangestu 700aa8f260 feat(trait): membuat trait untuk toast agar reusable
-mengubah cara menulis toast diubah menjadi memanggil toast yang ada
2025-10-02 20:13:03 +07:00

38 lines
737 B
PHP

<?php
namespace App\Livewire\Studio\Setting;
use App\Livewire\Forms\Studio\Setting\ProfileForm;
use App\Models\Employee;
use App\Traits\WithToast;
use App\Traits\WithUpdatedData;
use Livewire\Attributes\Title;
use Livewire\Component;
#[Title('Profil')]
class Profile extends Component
{
use WithToast, WithUpdatedData;
public ProfileForm $form;
public function mount(Employee $employee)
{
$this->form->setProfile($employee);
}
public function update()
{
$this->form->update();
$this->toast('Profil berhasil diperbarui.');
}
public function render()
{
return view('livewire.studio.setting.profile', [
'pageTitle' => 'Profil',
]);
}
}