Merge pull request #496 from jonnybarnes/495-error-saving-syndication-targets

Fix issues saving syndication targets
This commit is contained in:
Jonny Barnes 2022-10-24 17:35:50 +01:00 committed by GitHub
commit d801e6f3db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 0 deletions

View file

@ -45,6 +45,12 @@ class SyndicationTargetsController extends Controller
$validated = $request->validate([
'uid' => '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);
@ -77,6 +83,12 @@ class SyndicationTargetsController extends Controller
$validated = $request->validate([
'uid' => '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);

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) {
//
});
}
};