Completed
Pull Request — master (#34)
by Fèvre
14:51 queued 12:29
created

DiscussController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
namespace Xetaravel\Http\Controllers\Discuss;
3
4
use Illuminate\View\View;
5
use Xetaravel\Models\DiscussConversation;
6
7
class DiscussController extends Controller
8
{
9
    /**
10
     * Display all conversations.
11
     *
12
     * @return \Illuminate\View\View
13
     */
14 View Code Duplication
    public function index(): View
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
    {
16
        $conversations = DiscussConversation::with('User', 'Category', 'FirstPost', 'LastPost')
17
            ->orderBy('is_pinned', 'desc')
18
            ->orderBy('created_at', 'desc')
19
            ->paginate(config('xetaravel.pagination.discuss.conversation_per_page'));
20
21
        $breadcrumbs = $this->breadcrumbs;
22
23
        return view('Discuss::index', compact('breadcrumbs', 'conversations'));
24
    }
25
}
26