mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-16 02:24:09 -08:00
21 lines
445 B
PHP
21 lines
445 B
PHP
<?php
|
|
|
|
namespace Tests\Support\Importing;
|
|
|
|
use App\Models\Import;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
trait CleansUpImportFiles
|
|
{
|
|
public function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
Import::created(function (Import $import) {
|
|
$this->beforeApplicationDestroyed(function () use ($import) {
|
|
Storage::delete('private_uploads/imports/' . $import->file_path);
|
|
});
|
|
});
|
|
}
|
|
}
|