Created
February 21, 2024 13:48
-
-
Save davidbirkin/85234aecde6a56be79f044542f4186d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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