Skip to content

Instantly share code, notes, and snippets.

@davidbirkin
Created February 21, 2024 13:48
Show Gist options
  • Save davidbirkin/85234aecde6a56be79f044542f4186d7 to your computer and use it in GitHub Desktop.
Save davidbirkin/85234aecde6a56be79f044542f4186d7 to your computer and use it in GitHub Desktop.
<?php
namespace App\Livewire\Company;
use App\Models\Company;
use Livewire\Component;
class UpdateBaseCompanyDetails extends Component
{
public Company $company;
public $name = '';
public $email = '';
public $website = '';
public $logo = '';
public $showSuccessIndicator = false;
public function mount()
{
$this->company = Company::where('team_id', auth()->user()->team_id)->first();
$this->name = $this->company->name;
$this->email = $this->company->email;
$this->website = $this->company->website;
$this->logo = $this->company->logo;
}
public function render()
{
return view('livewire.company.update-base-company-details');
}
public function save()
{
$this->company->update([
'name' => $this->name,
'email' => $this->email,
'website' => $this->website,
'logo' => $this->logo
]);
$this->showSuccessIndicator = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment