Upgrade to Laravel 10

This commit is contained in:
Jonny Barnes 2023-02-18 09:34:57 +00:00
commit 16b120bc73
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
60 changed files with 1676 additions and 2019 deletions

View file

@ -6,6 +6,9 @@ use App\Models\Article;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Article>
*/
class ArticleFactory extends Factory
{
/**
@ -18,9 +21,9 @@ class ArticleFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'titleurl' => $this->faker->slug(3),

View file

@ -6,6 +6,9 @@ use App\Models\Bookmark;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Bookmark>
*/
class BookmarkFactory extends Factory
{
/**
@ -18,9 +21,9 @@ class BookmarkFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
$now = Carbon::now()->subDays(rand(5, 15));

View file

@ -6,6 +6,9 @@ use App\Models\Contact;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Contact>
*/
class ContactFactory extends Factory
{
/**
@ -18,9 +21,9 @@ class ContactFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'nick' => mb_strtolower($this->faker->firstName),

View file

@ -6,6 +6,9 @@ use App\Models\Like;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Like>
*/
class LikeFactory extends Factory
{
/**
@ -18,9 +21,9 @@ class LikeFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
$now = Carbon::now()->subDays(rand(5, 15));

View file

@ -6,6 +6,9 @@ use App\Models\Media;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Media>
*/
class MediaFactory extends Factory
{
/**
@ -18,9 +21,9 @@ class MediaFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'path' => 'media/' . $this->faker->uuid . '.jpg',

View file

@ -5,6 +5,9 @@ namespace Database\Factories;
use App\Models\MicropubClient;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\MicropubClient>
*/
class MicropubClientFactory extends Factory
{
/**
@ -17,9 +20,9 @@ class MicropubClientFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'client_url' => $this->faker->url,

View file

@ -7,6 +7,9 @@ use Exception;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Note>
*/
class NoteFactory extends Factory
{
/**
@ -19,11 +22,11 @@ class NoteFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*
* @throws Exception
*/
public function definition()
public function definition(): array
{
$now = Carbon::now()->subDays(random_int(5, 15));

View file

@ -5,6 +5,9 @@ namespace Database\Factories;
use App\Models\Place;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Place>
*/
class PlaceFactory extends Factory
{
/**
@ -17,9 +20,9 @@ class PlaceFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->company,

View file

@ -14,7 +14,7 @@ class SyndicationTargetFactory extends Factory
*
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'uid' => $this->faker->url,

View file

@ -5,6 +5,9 @@ namespace Database\Factories;
use App\Models\Tag;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Tag>
*/
class TagFactory extends Factory
{
/**
@ -17,9 +20,9 @@ class TagFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'tag' => $this->faker->word,

View file

@ -6,6 +6,9 @@ use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
@ -18,9 +21,9 @@ class UserFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->name,

View file

@ -5,6 +5,9 @@ namespace Database\Factories;
use App\Models\WebMention;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\WebMention>
*/
class WebMentionFactory extends Factory
{
/**
@ -17,9 +20,9 @@ class WebMentionFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
public function definition(): array
{
return [
'source' => $this->faker->url,

View file

@ -1,38 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateArticlesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (! Schema::hasTable('articles')) {
Schema::create('articles', function (Blueprint $table) {
$table->increments('id');
$table->string('titleurl', 50)->unique();
$table->string('url', 120)->nullable();
$table->string('title');
$table->longText('main');
$table->tinyInteger('published')->default(0);
$table->timestamps();
$table->softDeletes();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('articles');
}
}

View file

@ -1,40 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateNotesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (! Schema::hasTable('notes')) {
Schema::create('notes', function (Blueprint $table) {
$table->increments('id');
$table->text('note');
$table->string('in_reply_to')->nullable();
$table->string('shorturl', 20)->nullable();
$table->string('location')->nullable();
$table->tinyInteger('photo')->nullable();
$table->string('tweet_id')->nullable();
$table->string('client_id')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('notes');
}
}

View file

@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tags', function (Blueprint $table) {
$table->increments('id');
$table->string('tag');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tags');
}
}

View file

@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateNoteTagTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('note_tag', function (Blueprint $table) {
$table->increments('id');
$table->integer('note_id')->unsigned();
$table->integer('tag_id')->unsigned();
$table->foreign('note_id')->references('id')->on('notes');
$table->foreign('tag_id')->references('id')->on('tags');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('note_tag');
}
}

View file

@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('contacts', function (Blueprint $table) {
$table->increments('id');
$table->string('nick');
$table->string('name');
$table->string('homepage')->nullable();
$table->string('twitter')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('contacts');
}
}

View file

@ -1,38 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateWebMentionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('webmentions', function (Blueprint $table) {
$table->increments('id');
$table->string('source');
$table->string('target');
$table->integer('commentable_id')->nullable();
$table->string('commentable_type')->nullable();
$table->string('type')->nullable();
$table->text('content')->nullable();
$table->tinyInteger('verified')->default(1);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('webmentions');
}
}

View file

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateClientsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clients', function (Blueprint $table) {
$table->increments('id');
$table->string('client_url');
$table->string('client_name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('clients');
}
}

View file

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMediaTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('media', function (Blueprint $table) {
$table->increments('id');
$table->morphs('model');
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('disk');
$table->unsignedInteger('size');
$table->text('manipulations');
$table->text('custom_properties');
$table->unsignedInteger('order_column')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('media');
}
}

Some files were not shown because too many files have changed in this diff Show more