ShopCheckoutController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
c 1
b 0
f 0
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A page() 0 4 1
A saveDetailsInSession() 0 6 1
1
<?php
2
namespace Mongi\Mongicommerce\Http\Controllers\shop;
3
4
use Illuminate\Http\Request;
5
use Illuminate\Support\Facades\Auth;
6
use Mongi\Mongicommerce\Http\Controllers\Controller;
7
8
9
class ShopCheckoutController extends Controller
10
{
11
    public function page(){
12
            $note = session('checkout.note_delivery');
13
            $delivery_where = session('checkout.get_in_shop_checkbox');
14
            return view('mongicommerce.pages.checkout',compact('note','delivery_where'));
15
    }
16
17
    public function saveDetailsInSession(Request $r){
18
        $note_delivery = $r->get('note_delivery');
19
        $get_in_shop_checkbox = $r->get('get_in_shop_checkbox');
20
        session()->put('checkout.note_delivery', $note_delivery);
21
        session()->put('checkout.get_in_shop_checkbox', $get_in_shop_checkbox);
22
        return response()->json(['link' => route('shop.summary')]);
23
    }
24
}
25