diff --git a/app/Nova/Episode.php b/app/Nova/Episode.php index f256a0b1..1e59f9c7 100644 --- a/app/Nova/Episode.php +++ b/app/Nova/Episode.php @@ -35,6 +35,7 @@ class Episode extends Resource $lecturer = \App\Models\Lecturer::updateOrCreate(['name' => $model->podcast->title], [ 'team_id' => 1, 'active' => true, + 'website' => $model->podcast->link, ]); $lecturer->addMediaFromUrl($model->podcast->data['image']) ->toMediaCollection('avatar'); diff --git a/app/Nova/Lecturer.php b/app/Nova/Lecturer.php index d3e99306..03ebea32 100644 --- a/app/Nova/Lecturer.php +++ b/app/Nova/Lecturer.php @@ -88,6 +88,13 @@ class Lecturer extends Resource Text::make('Name') ->rules('required', 'string'), + Text::make('Twitter username', 'twitter_username') + ->help(__('Without @')) + ->rules('nullable', 'string'), + + Text::make('Website', 'website') + ->rules('nullable', 'url'), + Markdown::make(__('Subtitle'), 'subtitle') ->help(__('This is the subtitle on the landing page.')), diff --git a/database/migrations/2023_01_18_165507_add_social_links_to_lecturers_table.php b/database/migrations/2023_01_18_165507_add_social_links_to_lecturers_table.php new file mode 100644 index 00000000..b63e944e --- /dev/null +++ b/database/migrations/2023_01_18_165507_add_social_links_to_lecturers_table.php @@ -0,0 +1,32 @@ +string('twitter_username') + ->nullable(); + $table->string('website') + ->nullable(); + }); + } + + /** + * Reverse the migrations. + * @return void + */ + public function down() + { + Schema::table('lecturers', function (Blueprint $table) { + // + }); + } +};