close #1989 Fixed: Vendor logo not saved
This commit is contained in:
parent
34632a0152
commit
0c485c990a
@ -6,6 +6,7 @@ use App\Abstracts\Job;
|
||||
use App\Models\Auth\User;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Common\Contact;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CreateContact extends Job
|
||||
{
|
||||
@ -36,6 +37,13 @@ class CreateContact extends Job
|
||||
}
|
||||
|
||||
$this->contact = Contact::create($this->request->all());
|
||||
|
||||
// Upload logo
|
||||
if ($this->request->file('logo')) {
|
||||
$media = $this->getMedia($this->request->file('logo'), Str::plural($this->contact->type));
|
||||
|
||||
$this->contact->attachMedia($media, 'logo');
|
||||
}
|
||||
});
|
||||
|
||||
return $this->contact;
|
||||
|
@ -6,6 +6,7 @@ use App\Abstracts\Job;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\User;
|
||||
use App\Models\Common\Contact;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UpdateContact extends Job
|
||||
{
|
||||
@ -39,6 +40,13 @@ class UpdateContact extends Job
|
||||
$this->createUser();
|
||||
}
|
||||
|
||||
// Upload logo
|
||||
if ($this->request->file('logo')) {
|
||||
$media = $this->getMedia($this->request->file('logo'), Str::plural($this->contact->type));
|
||||
|
||||
$this->contact->attachMedia($media, 'logo');
|
||||
}
|
||||
|
||||
$this->contact->update($this->request->all());
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user