Skip to content

Feature/lar 6 migrate tailwind 4 #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 24 additions & 29 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
use App\Models\Plan;
use App\Models\Thread;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;

final class HomeController extends Controller
final class HomeController
{
public function __invoke(): View
{
Expand All @@ -21,37 +22,31 @@ public function __invoke(): View
->get();
});

$latestArticles = Cache::remember('latestArticles', now()->addHour(), function () {
return Article::with(['tags', 'user', 'user.transactions'])
->published()
->orderByDesc('sponsored_at')
->orderByDesc('published_at')
->orderByViews()
->trending()
->limit(4)
->get();
});

$latestThreads = Cache::remember('latestThreads', now()->addHour(), function () {
return Thread::with(['user', 'user.transactions'])->whereNull('solution_reply_id')
->whereBetween('threads.created_at', [now()->subMonths(3), now()])
->inRandomOrder()
->limit(4)
->get();
});

$latestDiscussions = Cache::remember('latestDiscussions', now()->addHour(), function () {
return Discussion::with(['user', 'user.transactions'])
->recent()
->orderByViews()
->limit(3)
->get();
});
$latestArticles = Cache::remember('latestArticles', now()->addMinute(), fn (): Collection => Article::with(['tags', 'user', 'user.transactions'])
->published()
->orderByDesc('sponsored_at')
->orderByDesc('published_at')
->orderByViews()
->trending()
->limit(4)
->get());

$latestThreads = Cache::remember('latestThreads', now()->addMinute(), fn (): Collection => Thread::with(['user', 'user.transactions'])->whereNull('solution_reply_id')
->whereBetween('threads.created_at', [now()->subMonths(3), now()])
->inRandomOrder()
->limit(4)
->get());

$latestDiscussions = Cache::remember('latestDiscussions', now()->addMinute(), fn (): Collection => Discussion::with(['user', 'user.transactions'])
->recent()
->orderByViews()
->limit(3)
->get());

// @phpstan-ignore-next-line
seo()
->description('Laravel Cameroun est le portail de la communauté de développeurs PHP & Laravel au Cameroun, On partage, on apprend, on découvre et on construit une grande communauté.')
->twitterDescription('Laravel Cameroun est le portail de la communauté de développeurs PHP & Laravel au Cameroun, On partage, on apprend, on découvre et on construit une grande communauté.')
->description(__('pages/home.description'))
->twitterDescription(__('pages/home.description'))
->image(asset('/images/socialcard.png'))
->twitterSite('laravelcm')
->withUrl();
Expand Down
1 change: 1 addition & 0 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

'links' => [
public_path('storage') => storage_path('app/public'),
public_path('media') => storage_path('app/media'),
],

];
224 changes: 0 additions & 224 deletions config/media-library.php

This file was deleted.

Loading
Loading