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

DiscussController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 11 1
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
    public function index(): View
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