Skip to content

💄 ajout de la landing page #24

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 1 commit into from
Nov 25, 2021
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
25 changes: 24 additions & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,38 @@

namespace App\Http\Controllers;

use App\Models\Article;
use App\Models\Thread;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;

class HomeController extends Controller
{
public function index()
{
return view('home');
$latestArticles = Cache::remember('latestArticles', now()->addHour(), function () {
return Article::with('tags')
->orderByViews()
->published()
->trending()
->limit(3)
->get();
});

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

return view('home', [
'latestArticles' => $latestArticles,
'latestThreads' => $latestThreads,
]);
}

public function slack(Request $request)
Expand Down
3 changes: 3 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use App\View\Composers\ModeratorsComposer;
use App\View\Composers\TopContributorsComposer;
use App\View\Composers\TopMembersComposer;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\View;
Expand All @@ -39,6 +40,8 @@ public function register()
public function boot()
{
date_default_timezone_set('Africa/Douala');
setlocale(LC_TIME, 'fr_FR', 'fr', 'FR', 'French', 'fr_FR.UTF-8');
Carbon::setLocale('fr_FR');

$this->bootMacros();
$this->bootViewsComposer();
Expand Down
9,750 changes: 9,740 additions & 10 deletions public/css/app.css

Large diffs are not rendered by default.

Binary file added public/images/developer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions public/images/illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/images/sponsors/gdg-douala.svg

This file was deleted.

Loading