mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
fixed uploaded attachment not removed
This commit is contained in:
committed by
Mohit Panjwani
parent
f34dac9d3f
commit
8ba84f68c7
@ -71,6 +71,9 @@ class CompanyController extends Controller
|
||||
|
||||
$data = json_decode($request->company_logo);
|
||||
|
||||
if (isset($request->is_company_logo_removed) && (bool) $request->is_company_logo_removed) {
|
||||
$company->clearMediaCollection('logo');
|
||||
}
|
||||
if ($data) {
|
||||
$company = Company::find($request->header('company'));
|
||||
|
||||
@ -98,6 +101,9 @@ class CompanyController extends Controller
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
if (isset($request->is_admin_avatar_removed) && (bool) $request->is_admin_avatar_removed) {
|
||||
$user->clearMediaCollection('admin_avatar');
|
||||
}
|
||||
if ($user && $request->hasFile('admin_avatar')) {
|
||||
$user->clearMediaCollection('admin_avatar');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user