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,
|
'active' => true,
|
||||||
'website' => $model->podcast->link,
|
'website' => $model->podcast->link,
|
||||||
]);
|
]);
|
||||||
$lecturer->addMediaFromUrl($model->podcast->data['image'])
|
if ($model->podcast->data['image']) {
|
||||||
->toMediaCollection('avatar');
|
$lecturer->addMediaFromUrl($model->podcast->data['image'])
|
||||||
|
->toMediaCollection('avatar');
|
||||||
|
}
|
||||||
$library = \App\Models\Library::firstOrCreate(
|
$library = \App\Models\Library::firstOrCreate(
|
||||||
[
|
[
|
||||||
'name' => 'Podcasts'
|
'name' => 'Podcasts'
|
||||||
@@ -56,8 +58,10 @@ class Episode extends Resource
|
|||||||
]);
|
]);
|
||||||
$libraryItem->syncTagsWithType(is_array($request->tags) ? $request->tags : str($request->tags)->explode('-----'),
|
$libraryItem->syncTagsWithType(is_array($request->tags) ? $request->tags : str($request->tags)->explode('-----'),
|
||||||
'library_item');
|
'library_item');
|
||||||
$libraryItem->addMediaFromUrl($model->data['image'])
|
if ($model->data['image']) {
|
||||||
->toMediaCollection('main');
|
$libraryItem->addMediaFromUrl($model->data['image'])
|
||||||
|
->toMediaCollection('main');
|
||||||
|
}
|
||||||
$library->libraryItems()
|
$library->libraryItems()
|
||||||
->attach($libraryItem);
|
->attach($libraryItem);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user