DashboardController::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
nc 1
nop 0
dl 0
loc 5
c 1
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace Wingsline\Blog\Http\Controllers;
4
5
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6
use Illuminate\Foundation\Bus\DispatchesJobs;
7
use Illuminate\Foundation\Validation\ValidatesRequests;
8
use Illuminate\Routing\Controller as BaseController;
9
use Wingsline\Blog\Posts\Post;
10
11
class DashboardController extends BaseController
12
{
13
    use AuthorizesRequests;
14
    use DispatchesJobs;
15
    use ValidatesRequests;
16
17
    /**
18
     * Dashboard.
19
     *
20
     * @return \Illuminate\Http\Response
21
     */
22
    public function __invoke()
23
    {
24
        $latest_posts = Post::orderBy('publish_date', 'desc')->limit(10)->get();
25
26
        return view('blog::dashboard', compact('latest_posts'));
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('blog::dashb...ompact('latest_posts')) returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
27
    }
28
}
29