ShopOrdersController::page()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
namespace Mongi\Mongicommerce\Http\Controllers\shop;
3
use Illuminate\Support\Facades\Auth;
4
use Mongi\Mongicommerce\Http\Controllers\Controller;
5
use Mongi\Mongicommerce\Models\Order;
6
7
class ShopOrdersController extends Controller
8
{
9
    public function page(){
10
        $user = Auth::user();
11
        $orders = Order::where('user_id',$user->id)->get();
0 ignored issues
show
Bug introduced by
Accessing id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
12
        return view('mongicommerce.pages.user_orders',compact('user','orders'));
13
    }
14
}
15