Completed
Push — master ( 0d7181...2d779c )
by Anton
23s
created

RequestSummary   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A request() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of Laravel Sense.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Sense\RequestSummary\Models;
15
16
use Cog\Laravel\Sense\Request\Models\Request;
17
use Illuminate\Database\Eloquent\Model;
18
use Illuminate\Database\Eloquent\Relations\BelongsTo;
19
20
class RequestSummary extends Model
21
{
22
    protected $connection = 'sense';
23
24
    protected $table = 'sense_request_summaries';
25
26
    protected $fillable = [
27
        'queries_count',
28
        'time_total',
29
    ];
30
31
    protected $casts = [
32
        'queries_count' => 'int',
33
        'time_total' => 'float',
34
    ];
35
36
    public function request(): BelongsTo
37
    {
38
        return $this->belongsTo(Request::class, 'request_id');
39
    }
40
}
41