Ideenbox-Moderation und Wochenüberblick per E-Mail (0.36.0)
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m39s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m38s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m25s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m39s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m38s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m25s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
11c5ef5baf
commit
f9922f7308
172 changed files with 1524 additions and 363 deletions
|
|
@ -4,6 +4,7 @@ namespace Inhaus\Plugins\News;
|
|||
|
||||
use App\Accessibility\EasyLanguage;
|
||||
use App\Dashboard\Widgets;
|
||||
use App\Digest\Digest;
|
||||
use App\Editorial\Editorial;
|
||||
use App\Media\ImagePaths;
|
||||
use App\Media\MediaUsages;
|
||||
|
|
@ -17,6 +18,7 @@ use App\Profile\ProfilePanels;
|
|||
use App\Search\GlobalSearch;
|
||||
use App\Support\Abilities;
|
||||
use App\Support\Navigation;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
|
@ -46,6 +48,16 @@ class NewsPlugin extends Plugin
|
|||
});
|
||||
NewsPost::deleted(fn (NewsPost $post) => app(EasyLanguage::class)->forget('news', $post->id));
|
||||
|
||||
$this->app->make(Digest::class)->add('news', 'Neuigkeiten', 10, fn (User $user, CarbonImmutable $since) => NewsPost::query()
|
||||
->published()->visibleTo($user)->with('category')->where('published_at', '>=', $since)
|
||||
->latest('published_at')->limit(8)->get()
|
||||
->map(fn (NewsPost $post) => [
|
||||
'title' => $post->title,
|
||||
'url' => route('news.show', $post),
|
||||
'meta' => collect([$post->category?->name, $post->published_at?->timezone(config('app.timezone'))->format('d.m.')])->filter()->implode(' · '),
|
||||
'text' => $post->teaser,
|
||||
])->all());
|
||||
|
||||
$this->app->make(GlobalSearch::class)->add('news', 'Neuigkeiten', 'newspaper', fn (...$args) => app(NewsSearch::class)(...$args), sort: 10);
|
||||
|
||||
$this->app->make(Navigation::class)->add('news', 'Neuigkeiten', '/neuigkeiten', active: ['news.index', 'news.show'], sort: 20);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue