1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00
invoiceninja/app/Http/Livewire/Profile/Settings/NameWebsiteLogo.php
2020-09-24 13:44:56 +02:00

47 lines
994 B
PHP

<?php
namespace App\Http\Livewire\Profile\Settings;
use Livewire\Component;
class NameWebsiteLogo extends Component
{
public $profile;
public $name;
public $website;
public $saved;
public $rules = [
'name' => ['required', 'min:3'],
'website' => ['required', 'url'],
];
public function mount()
{
$this->fill([
'profile' => auth()->user('contact')->client,
'name' => auth()->user('contact')->client->present()->name,
'website' => auth()->user('contact')->client->present()->website,
'saved' => ctrans('texts.save'),
]);
}
public function render()
{
return render('profile.settings.name-website-logo');
}
public function submit()
{
$data = $this->validate($this->rules);
$this->profile
->fill($data)
->save();
$this->saved = ctrans('texts.saved_at', ['time' => now()->toTimeString()]);
}
}