twitter_username added

This commit is contained in:
Benjamin Takats
2023-01-18 18:00:33 +01:00
parent 4bc57ac7b1
commit 33f16f6d8f
3 changed files with 40 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ class Episode extends Resource
$lecturer = \App\Models\Lecturer::updateOrCreate(['name' => $model->podcast->title], [ $lecturer = \App\Models\Lecturer::updateOrCreate(['name' => $model->podcast->title], [
'team_id' => 1, 'team_id' => 1,
'active' => true, 'active' => true,
'website' => $model->podcast->link,
]); ]);
$lecturer->addMediaFromUrl($model->podcast->data['image']) $lecturer->addMediaFromUrl($model->podcast->data['image'])
->toMediaCollection('avatar'); ->toMediaCollection('avatar');

View File

@@ -88,6 +88,13 @@ class Lecturer extends Resource
Text::make('Name') Text::make('Name')
->rules('required', 'string'), ->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') Markdown::make(__('Subtitle'), 'subtitle')
->help(__('This is the subtitle on the landing page.')), ->help(__('This is the subtitle on the landing page.')),

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
* @return void
*/
public function up()
{
Schema::table('lecturers', function (Blueprint $table) {
$table->string('twitter_username')
->nullable();
$table->string('website')
->nullable();
});
}
/**
* Reverse the migrations.
* @return void
*/
public function down()
{
Schema::table('lecturers', function (Blueprint $table) {
//
});
}
};