test
This commit is contained in:
@@ -10,7 +10,6 @@ use App\Http\Requests\Dashboard\Partner\Store as StoreRequest;
|
||||
|
||||
use App\Jobs\Dashboard\Partner\Store as StoreJob;
|
||||
use App\Jobs\Dashboard\Partner\Update as UpdateJob;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Controller extends ExController
|
||||
@@ -48,19 +47,8 @@ class Controller extends ExController
|
||||
public function update(UpdateRequest $request, Partner $partner)
|
||||
{
|
||||
if ($request->hasFile('image')) {
|
||||
if (env('FILESYSTEM_DISK') == 's3') {
|
||||
// delete old image from s3
|
||||
Storage::disk('s3')->delete($partner->image);
|
||||
} else {
|
||||
// detele old image
|
||||
$imagePath = public_path($partner->image);
|
||||
|
||||
if (File::exists($imagePath)) {
|
||||
File::delete($imagePath);
|
||||
}
|
||||
}
|
||||
|
||||
$path = $request->file('image')->store('uploads/partners');
|
||||
Storage::delete($partner->image);
|
||||
$path = $request->file('image')->store('uploads/partners');
|
||||
} else {
|
||||
$path = $partner->image;
|
||||
}
|
||||
@@ -75,17 +63,7 @@ class Controller extends ExController
|
||||
{
|
||||
$this->authorize('delete', 'partners');
|
||||
|
||||
if (env('FILESYSTEM_DISK') == 's3') {
|
||||
// delete old image from s3
|
||||
Storage::disk('s3')->delete($partner->image);
|
||||
} else {
|
||||
$imagePath = public_path($partner->image);
|
||||
|
||||
if (File::exists($imagePath)) {
|
||||
File::delete($imagePath);
|
||||
}
|
||||
}
|
||||
|
||||
Storage::delete($partner->image);
|
||||
$partner->delete();
|
||||
|
||||
$this->info(trans('admin.messages.deleted'));
|
||||
|
||||
Reference in New Issue
Block a user