$this->mock(RestApi::class, function (MockInterface $mock) use ($user) {
$mock->shouldReceive('login')
->with($user->phone, $user->pass)
->andReturn([
'result' => ApiStatus::OK,
]);
});
Schema::table('devices', function (Blueprint $table) {
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->foreignId('car_id')->nullable()->constrained()->onDelete('set null');
});