Passed
Push — fix/eager-loading-fail ( cb978b...578913 )
by Bas
03:30
created

InteractsWithDatabase::assertDatabaseMissing()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\Aranguent\Testing\Concerns;
6
7
use Illuminate\Support\Facades\DB;
8
9
trait InteractsWithDatabase
10
{
11
    /**
12
     * Cast a JSON string to a database compatible type.
13
     * Supported for backwards compatibility in existing projects.
14
     * No cast is necessary as json is a first class citizen in ArangoDB.
15
     *
16
     * @param  array<mixed>|object|string  $value
17
     * @return \Illuminate\Contracts\Database\Query\Expression
18
     */
19 1
    public function castAsJson($value)
20
    {
21 1
        return DB::raw($value);
22
    }
23
}
24