diff --git a/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php b/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php index e1b6fac6..ab266e82 100644 --- a/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php +++ b/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php @@ -22,7 +22,7 @@ public function handle() if ($query->get()->isNotEmpty()) { foreach ($query->get() as $user) { - $user->notify((new SendEMailToDeletedUser())->delay(now()->addMinute(5))); + $user->notify((new SendEMailToDeletedUser())->delay(now()->addMinutes(5))); } } diff --git a/app/Console/Commands/PublishArticles.php b/app/Console/Commands/PublishArticles.php new file mode 100644 index 00000000..be922c7c --- /dev/null +++ b/app/Console/Commands/PublishArticles.php @@ -0,0 +1,31 @@ +info('Published all submitted articles...'); + + $articles = Article::submitted()->approved()->whereNull('published_at')->get(); + + foreach ($articles as $article) { + $article->published_at = $article->submitted_at; + $article->save(); + } + + $count = $articles->count(); + + $this->comment("Published {$count} articles."); + + $this->info('All done!'); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 0691f4ac..632d95af 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -24,7 +24,7 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - $schedule->command('media-library:delete-old-temporary-uploads')->daily(); + // $schedule->command('media-library:delete-old-temporary-uploads')->daily(); $schedule->command('lcm:delete-old-unverified-users')->daily(); $schedule->command('lcm:post-article-to-twitter')->twiceDaily(12, 16); $schedule->command('lcm:post-article-to-telegram')->everyFourHours(); diff --git a/app/Http/Livewire/Articles/Create.php b/app/Http/Livewire/Articles/Create.php index b7ad45f2..70cb0455 100644 --- a/app/Http/Livewire/Articles/Create.php +++ b/app/Http/Livewire/Articles/Create.php @@ -52,6 +52,7 @@ public function store() 'title' => $this->title, 'slug' => $this->slug, 'body' => $this->body, + 'published_at' => $this->published_at, 'submitted_at' => $this->submitted_at, 'approved_at' => $this->approved_at, 'show_toc' => $this->show_toc, diff --git a/app/Http/Livewire/Articles/Edit.php b/app/Http/Livewire/Articles/Edit.php index 70dabe4d..8fdfe491 100644 --- a/app/Http/Livewire/Articles/Edit.php +++ b/app/Http/Livewire/Articles/Edit.php @@ -30,6 +30,7 @@ public function mount(Article $article) $this->slug = $article->slug; $this->show_toc = $article->show_toc; $this->submitted_at = $article->submitted_at; + $this->published_at = $article->published_at ? $article->publishedAt()->format('Y-m-d') : null; $this->canonical_url = $article->originalUrl(); $this->preview = $article->getFirstMediaUrl('media'); $this->associateTags = $this->tags_selected = old('tags', $article->tags()->pluck('id')->toArray()); @@ -66,6 +67,7 @@ public function save() 'show_toc' => $this->show_toc, 'canonical_url' => $this->canonical_url, 'submitted_at' => $this->submitted_at, + 'published_at' => $this->published_at, ]); $this->article->syncTags($this->associateTags); diff --git a/app/Models/Article.php b/app/Models/Article.php index 07e4d399..4b29bd34 100644 --- a/app/Models/Article.php +++ b/app/Models/Article.php @@ -49,6 +49,7 @@ class Article extends Model implements ReactableInterface, HasMedia, Viewable 'declined_at', 'shared_at', 'sponsored_at', + 'published_at', ]; /** @@ -62,6 +63,7 @@ class Article extends Model implements ReactableInterface, HasMedia, Viewable 'declined_at' => 'datetime', 'shared_at' => 'datetime', 'sponsored_at' => 'datetime', + 'published_at' => 'datetime', 'show_toc' => 'boolean', 'is_pinned' => 'boolean', ]; @@ -150,6 +152,11 @@ public function sponsoredAt(): ?Carbon return $this->sponsored_at; } + public function publishedAt(): ?Carbon + { + return $this->published_at; + } + public function isSubmitted(): bool { return ! $this->isNotSubmitted(); @@ -192,12 +199,12 @@ public function isNotDeclined(): bool public function isPublished(): bool { - return ! $this->isNotPublished(); + return ! $this->isNotPublished() && ($this->publishedAt() && $this->publishedAt()->lessThanOrEqualTo(now())); } public function isNotPublished(): bool { - return $this->isNotSubmitted() || $this->isNotApproved(); + return ($this->isNotSubmitted() || $this->isNotApproved()) && $this->published_at === null; } public function isPinned(): bool @@ -249,7 +256,8 @@ public function scopeAwaitingApproval(Builder $query): Builder public function scopePublished(Builder $query): Builder { - return $query->submitted() + return $query->whereDate('published_at', '<=', now()) + ->submitted() ->approved(); } @@ -258,6 +266,7 @@ public function scopeNotPublished(Builder $query): Builder return $query->where(function ($query) { $query->whereNull('submitted_at') ->orWhereNull('approved_at') + ->orWhereNull('published_at') ->orWhereNotNull('declined_at'); }); } @@ -300,14 +309,14 @@ public function scopeNotDeclined(Builder $query): Builder public function scopeRecent(Builder $query): Builder { return $query->orderBy('is_pinned', 'desc') - ->orderBy('submitted_at', 'desc'); + ->orderBy('published_at', 'desc'); } public function scopePopular(Builder $query): Builder { return $query->withCount('reactions') ->orderBy('reactions_count', 'desc') - ->orderBy('submitted_at', 'desc'); + ->orderBy('published_at', 'desc'); } public function scopeTrending(Builder $query): Builder @@ -316,7 +325,7 @@ public function scopeTrending(Builder $query): Builder $query->where('created_at', '>=', now()->subWeek()); }]) ->orderBy('reactions_count', 'desc') - ->orderBy('submitted_at', 'desc'); + ->orderBy('published_at', 'desc'); } public function markAsShared() @@ -328,7 +337,7 @@ public static function nextForSharing(): ?self { return self::notShared() ->published() - ->orderBy('submitted_at', 'asc') + ->orderBy('published_at', 'asc') ->first(); } @@ -336,7 +345,7 @@ public static function nexForSharingToTelegram(): ?self { return self::published() ->whereNull('tweet_id') - ->orderBy('submitted_at', 'asc') + ->orderBy('published_at', 'asc') ->first(); } diff --git a/app/Models/User.php b/app/Models/User.php index 6939ec21..fdea6a4f 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -49,6 +49,7 @@ class User extends Authenticatable implements MustVerifyEmail, HasMedia 'last_login_at', 'last_login_ip', 'email_verified_at', + 'published_at', 'opt_in', ]; @@ -295,7 +296,7 @@ public function delete() parent::delete(); } - public function scopeHasActivity(Builder $query) + public function scopeHasActivity(Builder $query): Builder { return $query->where(function ($query) { $query->has('threads') diff --git a/app/Traits/WithArticleAttributes.php b/app/Traits/WithArticleAttributes.php index 3ef1d3f5..91a48de2 100644 --- a/app/Traits/WithArticleAttributes.php +++ b/app/Traits/WithArticleAttributes.php @@ -13,6 +13,7 @@ trait WithArticleAttributes public bool $show_toc = false; public ?string $submitted_at = null; public ?string $approved_at = null; + public ?string $published_at = null; public $file; protected $rules = [ @@ -23,7 +24,7 @@ trait WithArticleAttributes 'file' => 'nullable|image|max:2048', // 1MB Max ]; - public function removeImage() + public function removeImage(): void { $this->file = null; } @@ -38,7 +39,7 @@ public function messages(): array ]; } - public function updatedTitle(string $value) + public function updatedTitle(string $value): void { $this->slug = Str::slug($value); } diff --git a/composer.json b/composer.json index a37a1904..ae7b34be 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "torchlight/torchlight-commonmark": "^0.5.5", "wire-elements/modal": "^1.0", "wire-elements/spotlight": "^1.0", - "wireui/wireui": "^1.1.3", + "wireui/wireui": "^1.6.0", "yarri/link-finder": "^2.7" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 69b0cde0..f624cad7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "66925396852f11976874cfdfb0d63598", + "content-hash": "b3a409f3816b6eb02c1280180801dedd", "packages": [ { "name": "abraham/twitteroauth", @@ -1856,16 +1856,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.3", + "version": "7.4.4", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8", + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8", "shasum": "" }, "require": { @@ -1960,7 +1960,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.3" + "source": "https://github.com/guzzle/guzzle/tree/7.4.4" }, "funding": [ { @@ -1976,7 +1976,7 @@ "type": "tidelift" } ], - "time": "2022-05-25T13:24:33+00:00" + "time": "2022-06-09T21:39:15+00:00" }, { "name": "guzzlehttp/promises", @@ -2064,16 +2064,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.2.1", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/83260bb50b8fc753c72d14dc1621a2dac31877ee", + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee", "shasum": "" }, "require": { @@ -2097,7 +2097,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -2159,7 +2159,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.2.1" + "source": "https://github.com/guzzle/psr7/tree/2.3.0" }, "funding": [ { @@ -2175,7 +2175,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:55:58+00:00" + "time": "2022-06-09T08:26:02+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -3439,16 +3439,16 @@ }, { "name": "league/flysystem", - "version": "3.0.20", + "version": "3.0.21", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "42a2f47dcf39944e2aee1b660ee55ab6ef69b535" + "reference": "8f1fcf9d2304ff77a006aa36dd2cb5f236999b12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/42a2f47dcf39944e2aee1b660ee55ab6ef69b535", - "reference": "42a2f47dcf39944e2aee1b660ee55ab6ef69b535", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8f1fcf9d2304ff77a006aa36dd2cb5f236999b12", + "reference": "8f1fcf9d2304ff77a006aa36dd2cb5f236999b12", "shasum": "" }, "require": { @@ -3509,7 +3509,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.0.20" + "source": "https://github.com/thephpleague/flysystem/tree/3.0.21" }, "funding": [ { @@ -3525,7 +3525,7 @@ "type": "tidelift" } ], - "time": "2022-05-25T19:18:39+00:00" + "time": "2022-06-12T17:54:28+00:00" }, { "name": "league/glide", @@ -4044,16 +4044,16 @@ }, { "name": "monolog/monolog", - "version": "2.6.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "247918972acd74356b0a91dfaa5adcaec069b6c0" + "reference": "5579edf28aee1190a798bfa5be8bc16c563bd524" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/247918972acd74356b0a91dfaa5adcaec069b6c0", - "reference": "247918972acd74356b0a91dfaa5adcaec069b6c0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5579edf28aee1190a798bfa5be8bc16c563bd524", + "reference": "5579edf28aee1190a798bfa5be8bc16c563bd524", "shasum": "" }, "require": { @@ -4132,7 +4132,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.6.0" + "source": "https://github.com/Seldaek/monolog/tree/2.7.0" }, "funding": [ { @@ -4144,7 +4144,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T09:36:00+00:00" + "time": "2022-06-09T08:59:12+00:00" }, { "name": "myclabs/php-enum", @@ -4631,16 +4631,16 @@ }, { "name": "paragonie/constant_time_encoding", - "version": "v2.5.0", + "version": "v2.6.3", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "9229e15f2e6ba772f0c55dd6986c563b937170a8" + "reference": "58c3f47f650c94ec05a151692652a868995d2938" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/9229e15f2e6ba772f0c55dd6986c563b937170a8", - "reference": "9229e15f2e6ba772f0c55dd6986c563b937170a8", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", + "reference": "58c3f47f650c94ec05a151692652a868995d2938", "shasum": "" }, "require": { @@ -4694,7 +4694,7 @@ "issues": "https://github.com/paragonie/constant_time_encoding/issues", "source": "https://github.com/paragonie/constant_time_encoding" }, - "time": "2022-01-17T05:32:27+00:00" + "time": "2022-06-14T06:56:20+00:00" }, { "name": "php-http/client-common", @@ -5158,16 +5158,16 @@ }, { "name": "pragmarx/google2fa", - "version": "8.0.0", + "version": "v8.0.1", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa.git", - "reference": "26c4c5cf30a2844ba121760fd7301f8ad240100b" + "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/26c4c5cf30a2844ba121760fd7301f8ad240100b", - "reference": "26c4c5cf30a2844ba121760fd7301f8ad240100b", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/80c3d801b31fe165f8fe99ea085e0a37834e1be3", + "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3", "shasum": "" }, "require": { @@ -5204,9 +5204,9 @@ ], "support": { "issues": "https://github.com/antonioribeiro/google2fa/issues", - "source": "https://github.com/antonioribeiro/google2fa/tree/8.0.0" + "source": "https://github.com/antonioribeiro/google2fa/tree/v8.0.1" }, - "time": "2020-04-05T10:47:18+00:00" + "time": "2022-06-13T21:57:56+00:00" }, { "name": "psr/cache", @@ -6041,16 +6041,16 @@ }, { "name": "sentry/sentry", - "version": "3.5.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "5b611e3f09035f5ad5edf494443e3236bd5ea482" + "reference": "6d1a6ee29c558be373bfe08d454a3c116c02dd0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/5b611e3f09035f5ad5edf494443e3236bd5ea482", - "reference": "5b611e3f09035f5ad5edf494443e3236bd5ea482", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/6d1a6ee29c558be373bfe08d454a3c116c02dd0d", + "reference": "6d1a6ee29c558be373bfe08d454a3c116c02dd0d", "shasum": "" }, "require": { @@ -6079,7 +6079,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.19|3.4.*", "http-interop/http-factory-guzzle": "^1.0", - "monolog/monolog": "^1.3|^2.0", + "monolog/monolog": "^1.6|^2.0|^3.0", "nikic/php-parser": "^4.10.3", "php-http/mock-client": "^1.3", "phpbench/phpbench": "^1.0", @@ -6096,7 +6096,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.5.x-dev" + "dev-master": "3.6.x-dev" } }, "autoload": { @@ -6130,7 +6130,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.5.0" + "source": "https://github.com/getsentry/sentry-php/tree/3.6.0" }, "funding": [ { @@ -6142,7 +6142,7 @@ "type": "custom" } ], - "time": "2022-05-19T07:14:12+00:00" + "time": "2022-06-09T20:33:39+00:00" }, { "name": "sentry/sentry-laravel", @@ -6352,16 +6352,16 @@ }, { "name": "spatie/browsershot", - "version": "3.54.0", + "version": "3.55.0", "source": { "type": "git", "url": "https://github.com/spatie/browsershot.git", - "reference": "038cfecb095c74b80a64c8daa9d2194f680c99c1" + "reference": "305adf5860427b206509366bdebcd1b4307cac9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/browsershot/zipball/038cfecb095c74b80a64c8daa9d2194f680c99c1", - "reference": "038cfecb095c74b80a64c8daa9d2194f680c99c1", + "url": "https://api.github.com/repos/spatie/browsershot/zipball/305adf5860427b206509366bdebcd1b4307cac9f", + "reference": "305adf5860427b206509366bdebcd1b4307cac9f", "shasum": "" }, "require": { @@ -6406,7 +6406,7 @@ ], "support": { "issues": "https://github.com/spatie/browsershot/issues", - "source": "https://github.com/spatie/browsershot/tree/3.54.0" + "source": "https://github.com/spatie/browsershot/tree/3.55.0" }, "funding": [ { @@ -6414,7 +6414,7 @@ "type": "github" } ], - "time": "2022-05-19T13:37:26+00:00" + "time": "2022-06-13T08:38:15+00:00" }, { "name": "spatie/crawler", @@ -6950,16 +6950,16 @@ }, { "name": "spatie/laravel-sitemap", - "version": "6.1.1", + "version": "6.2.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-sitemap.git", - "reference": "2c84ae2eb7f65021136a07d6a1bc261873ceecf2" + "reference": "0da6e85eda6e044ed67132d3232c9bbf2f2eb73d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-sitemap/zipball/2c84ae2eb7f65021136a07d6a1bc261873ceecf2", - "reference": "2c84ae2eb7f65021136a07d6a1bc261873ceecf2", + "url": "https://api.github.com/repos/spatie/laravel-sitemap/zipball/0da6e85eda6e044ed67132d3232c9bbf2f2eb73d", + "reference": "0da6e85eda6e044ed67132d3232c9bbf2f2eb73d", "shasum": "" }, "require": { @@ -7011,7 +7011,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-sitemap/issues", - "source": "https://github.com/spatie/laravel-sitemap/tree/6.1.1" + "source": "https://github.com/spatie/laravel-sitemap/tree/6.2.0" }, "funding": [ { @@ -7019,7 +7019,7 @@ "type": "custom" } ], - "time": "2022-06-06T00:02:30+00:00" + "time": "2022-06-13T09:54:14+00:00" }, { "name": "spatie/robots-txt", @@ -10356,20 +10356,20 @@ }, { "name": "wireui/wireui", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/wireui/wireui.git", - "reference": "2469a922db5d2e21d6c84d3c04a70162df20a6c8" + "reference": "e59d4bd6aae7372ab5c499ab8a4e292525f2d933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wireui/wireui/zipball/2469a922db5d2e21d6c84d3c04a70162df20a6c8", - "reference": "2469a922db5d2e21d6c84d3c04a70162df20a6c8", + "url": "https://api.github.com/repos/wireui/wireui/zipball/e59d4bd6aae7372ab5c499ab8a4e292525f2d933", + "reference": "e59d4bd6aae7372ab5c499ab8a4e292525f2d933", "shasum": "" }, "require": { - "laravel/framework": "^8.80|^9.0", + "laravel/framework": "^8.83|^9.16", "livewire/livewire": "^2.10", "php": "^8.0|8.1" }, @@ -10418,9 +10418,15 @@ ], "support": { "issues": "https://github.com/wireui/wireui/issues", - "source": "https://github.com/wireui/wireui/tree/v1.5.0" + "source": "https://github.com/wireui/wireui/tree/v1.6.0" }, - "time": "2022-05-31T05:10:14+00:00" + "funding": [ + { + "url": "https://github.com/PH7-Jack", + "type": "github" + } + ], + "time": "2022-06-15T22:47:48+00:00" }, { "name": "yarri/link-finder", @@ -11343,16 +11349,16 @@ }, { "name": "laravel/sail", - "version": "v1.14.9", + "version": "v1.14.10", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "8435763e7735f6eff15b03df014cea1217fc826e" + "reference": "0ea5d683af4d189071efcdb9e83946c10dab82c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/8435763e7735f6eff15b03df014cea1217fc826e", - "reference": "8435763e7735f6eff15b03df014cea1217fc826e", + "url": "https://api.github.com/repos/laravel/sail/zipball/0ea5d683af4d189071efcdb9e83946c10dab82c3", + "reference": "0ea5d683af4d189071efcdb9e83946c10dab82c3", "shasum": "" }, "require": { @@ -11399,7 +11405,7 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2022-06-06T14:28:04+00:00" + "time": "2022-06-09T07:10:28+00:00" }, { "name": "maximebf/debugbar", @@ -13994,16 +14000,16 @@ }, { "name": "spatie/laravel-ignition", - "version": "1.2.3", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "51e5daaa7e43c154fe57f1ddfbba862f9fe57646" + "reference": "fe37a0eafe6ea040804255c70e9808af13314f87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/51e5daaa7e43c154fe57f1ddfbba862f9fe57646", - "reference": "51e5daaa7e43c154fe57f1ddfbba862f9fe57646", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/fe37a0eafe6ea040804255c70e9808af13314f87", + "reference": "fe37a0eafe6ea040804255c70e9808af13314f87", "shasum": "" }, "require": { @@ -14080,7 +14086,7 @@ "type": "github" } ], - "time": "2022-05-05T15:53:24+00:00" + "time": "2022-06-17T06:28:57+00:00" }, { "name": "spatie/test-time", @@ -14405,5 +14411,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.1.0" } diff --git a/database/migrations/2022_06_17_065116_add_published_at_columns_on_posts_table.php b/database/migrations/2022_06_17_065116_add_published_at_columns_on_posts_table.php new file mode 100644 index 00000000..c2f1545d --- /dev/null +++ b/database/migrations/2022_06_17_065116_add_published_at_columns_on_posts_table.php @@ -0,0 +1,33 @@ +after('user_id', function ($table) { + $table->timestamp('published_at')->nullable(); + }); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('articles', function (Blueprint $table) { + $table->removeColumn('published_at'); + }); + } +}; diff --git a/resources/views/livewire/articles/_form.blade.php b/resources/views/livewire/articles/_form.blade.php index d60125eb..c65a23ae 100644 --- a/resources/views/livewire/articles/_form.blade.php +++ b/resources/views/livewire/articles/_form.blade.php @@ -77,7 +77,16 @@ class="origin-top-right absolute right-0 mt-2 -mr-1 w-56 rounded-md shadow-lg bg