create(); Session::create([ 'id' => 'foo', 'payload' => 'lorem ipsum', 'user_id' => $user->id, 'last_activity' => Carbon::now(), ]); Session::create([ 'id' => 'bar', 'last_activity' => Carbon::now(), ]); $session = Session::find('foo'); $this->assertNotNull($session); $this->assertEquals('lorem ipsum', $session->payload); $this->assertInstanceOf(User::class, $session->user); $session = Session::find('bar'); $this->assertNull($session->user); } }