Skip to content

Commit 6cc258c

Browse files
committed
♻️ formatage du code des controllers
1 parent 6f4a0d9 commit 6cc258c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/Http/Controllers/ArticlesController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Controllers;
44

55
use App\Models\Article;
6+
use App\Models\User;
67
use App\Policies\ArticlePolicy;
78
use Illuminate\Support\Facades\Auth;
89
use Illuminate\Support\Facades\Cache;
@@ -21,6 +22,7 @@ public function index()
2122

2223
public function show(Article $article)
2324
{
25+
/** @var User $user */
2426
$user = Auth::user();
2527

2628
views($article)->record();

app/Http/Controllers/User/DashboardController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public function dashboard()
1313
return view('user.dashboard', [
1414
'user' => $user = User::scopes('withCounts')->find(Auth::id()),
1515
'articles' => $user->articles()
16-
->orderByDesc('submitted_at')
1716
->orderByDesc('created_at')
17+
->orderBy('submitted_at')
1818
->paginate(5),
1919
]);
2020
}

app/Http/Middleware/HttpsProtocol.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class HttpsProtocol
99
{
1010
public function handle(Request $request, Closure $next)
1111
{
12-
if (! $request->isSecure() && app()->environment('production')) {
12+
if (app()->environment('production') && ! $request->isSecure()) {
1313
return redirect()->secure($request->getRequestUri());
1414
}
1515

0 commit comments

Comments
 (0)