Add model to store syndication target data

This commit is contained in:
Jonny Barnes 2022-10-22 14:18:21 +01:00
parent 7cd9956b92
commit ea8395a651
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
5 changed files with 154 additions and 9 deletions

View file

@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\SyndicationTarget>
*/
class SyndicationTargetFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
'uid' => $this->faker->url,
'name' => $this->faker->name,
'service_name' => $this->faker->name,
'service_url' => $this->faker->url,
'service_photo' => $this->faker->url,
'user_name' => $this->faker->name,
'user_url' => $this->faker->url,
'user_photo' => $this->faker->url,
];
}
}

View file

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