Skip to content

Commit

Permalink
Fix file
Browse files Browse the repository at this point in the history
  • Loading branch information
wdda committed May 21, 2023
1 parent 27e9d4d commit 9758094
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 26 deletions.
25 changes: 0 additions & 25 deletions .bash_history

This file was deleted.

36 changes: 36 additions & 0 deletions app/Jobs/MakeManifestJob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Jobs;

use App\Models\Resources\Files;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class MakeManifestJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}

/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Files::makeManifest();
}
}
3 changes: 2 additions & 1 deletion app/Models/Resources/Files.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace App\Models\Resources;

use App\Jobs\MakeManifestJob;
use Exception;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Collection;
Expand Down Expand Up @@ -84,7 +85,7 @@ public static function create($folderName, UploadedFile $file, $fileName): array
$status = Storage::putFileAs($folderPath, $file, $fileName);
}

self::makeManifest();
MakeManifestJob::dispatch();

return compact('status', 'error');
}
Expand Down

0 comments on commit 9758094

Please sign in to comment.