✨ Watch episode directly
This commit is contained in:
parent
50c49cd0ef
commit
b5e70aec2e
2 changed files with 41 additions and 1 deletions
|
|
@ -3,7 +3,9 @@
|
|||
namespace App\Data\DataPipes;
|
||||
|
||||
use App\Data\FileData;
|
||||
use App\Data\WatchExport;
|
||||
use Illuminate\Support\Collection;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
use Spatie\LaravelData\DataPipes\DataPipe;
|
||||
use Spatie\LaravelData\Lazy;
|
||||
use Spatie\LaravelData\Optional;
|
||||
|
|
@ -15,7 +17,11 @@ class ReadExportFiles implements DataPipe
|
|||
{
|
||||
public function handle(mixed $payload, DataClass $class, Collection $properties): Collection
|
||||
{
|
||||
if (!$properties->has('files') || !$properties->get('files')->count()) {
|
||||
if (!$properties->has('files')) {
|
||||
$properties['files'] = new DataCollection(WatchExport::class, []);
|
||||
}
|
||||
|
||||
if (!$properties->get('files')->count()) {
|
||||
return $properties;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue