Completed
Push — master ( 0668ff...240876 )
by Alex
03:13
created

getHistoryOnlyDatesAndValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Chrisbjr\ApiGuard\Http\Controllers\ApiGuardController;
6
use DB;
7
use Illuminate\Http\Request;
8
9
use App\Http\Requests;
10
11
class HistoryApiController extends ApiGuardController
12
{
13
14
    protected $apiMethods = [
15
        'getHistoryWithSymbol' =>[
16
            'keyAuthentication' => true
17
        ],
18
        'getHistoryOnlyDatesAndValues'=>[
19
            'keyAuthentication' => true
20
        ]
21
    ];
22
23
24
    public function getHistoryWithSymbol(Request $request)
25
    {
26
        $symbol=$request->symbol_query;
27
28
        $query = DB::table('exchange_history')
29
            ->where('symbol','=',$symbol)
30
            ->get();
31
32
        return $query;
33
    }
34
35
    public function getHistoryOnlyDatesAndValues(Request $request)
36
    {
37
        $symbol=$request->symbol_query;
38
39
        $query = DB::table('exchange_history')
40
            ->select('symbol','dates','values')
41
            ->where('symbol','=',$symbol)
42
            ->get();
43
44
        return $query;
45
    }
46
47
48
49
}
50