Fix issues saving syndication targets

This commit is contained in:
Jonny Barnes 2022-10-24 17:18:04 +01:00
parent def69f4038
commit c9106b5b8b
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
2 changed files with 49 additions and 0 deletions

View file

@ -45,6 +45,12 @@ class SyndicationTargetsController extends Controller
$validated = $request->validate([ $validated = $request->validate([
'uid' => 'required|string', 'uid' => 'required|string',
'name' => 'required|string', 'name' => 'required|string',
'service_name' => 'nullable|string',
'service_url' => 'nullable|string',
'service_photo' => 'nullable|string',
'user_name' => 'nullable|string',
'user_url' => 'nullable|string',
'user_photo' => 'nullable|string',
]); ]);
SyndicationTarget::create($validated); SyndicationTarget::create($validated);
@ -77,6 +83,12 @@ class SyndicationTargetsController extends Controller
$validated = $request->validate([ $validated = $request->validate([
'uid' => 'required|string', 'uid' => 'required|string',
'name' => 'required|string', 'name' => 'required|string',
'service_name' => 'nullable|string',
'service_url' => 'nullable|string',
'service_photo' => 'nullable|string',
'user_name' => 'nullable|string',
'user_url' => 'nullable|string',
'user_photo' => 'nullable|string',
]); ]);
$syndicationTarget->update($validated); $syndicationTarget->update($validated);

View file

@ -0,0 +1,37 @@
<?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('syndication_targets', function (Blueprint $table) {
$table->string('service_name')->nullable()->change();
$table->string('service_url')->nullable()->change();
$table->string('service_photo')->nullable()->change();
$table->string('user_name')->nullable()->change();
$table->string('user_url')->nullable()->change();
$table->string('user_photo')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('syndication_targets', function (Blueprint $table) {
//
});
}
};