mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
add podcasts
This commit is contained in:
@@ -37,8 +37,10 @@ class Episode extends Resource
|
||||
'active' => true,
|
||||
'website' => $model->podcast->link,
|
||||
]);
|
||||
if ($model->podcast->data['image']) {
|
||||
$lecturer->addMediaFromUrl($model->podcast->data['image'])
|
||||
->toMediaCollection('avatar');
|
||||
}
|
||||
$library = \App\Models\Library::firstOrCreate(
|
||||
[
|
||||
'name' => 'Podcasts'
|
||||
@@ -56,8 +58,10 @@ class Episode extends Resource
|
||||
]);
|
||||
$libraryItem->syncTagsWithType(is_array($request->tags) ? $request->tags : str($request->tags)->explode('-----'),
|
||||
'library_item');
|
||||
if ($model->data['image']) {
|
||||
$libraryItem->addMediaFromUrl($model->data['image'])
|
||||
->toMediaCollection('main');
|
||||
}
|
||||
$library->libraryItems()
|
||||
->attach($libraryItem);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user