|
@@ -12,6 +12,7 @@ use App\Repositories\Post\PostRepository;
|
|
|
use Illuminate\Console\Command;
|
|
|
use App\Models\Download;
|
|
|
use Illuminate\Support\Carbon;
|
|
|
+use Illuminate\Support\Facades\Storage;
|
|
|
|
|
|
class Downloads extends Command
|
|
|
{
|
|
@@ -79,9 +80,11 @@ class Downloads extends Command
|
|
|
|
|
|
try {
|
|
|
$this->postRepository->download($filePath, $download->download_type, json_decode($download->params, true));
|
|
|
+ Storage::put($filePath, file_get_contents(public_path($filePath)));
|
|
|
$download->url = $filePath;
|
|
|
$download->download_status = 2;
|
|
|
$download->save();
|
|
|
+ unlink(public_path($filePath));
|
|
|
} catch (\Exception $e) {
|
|
|
$download->download_status = 3;
|
|
|
$download->url = $e->getMessage();
|