コード例 #1
0
 public function testJsonProperties()
 {
     $pair = new KeyPair();
     $pair->public_id = 'wowowowow';
     $pair->secret_key = 'omgomgomgomgomg';
     $pair->type = 'testing';
     $pair->data = ['name' => 'dolan'];
     $pair->save();
     $pair2 = KeyPair::query()->where('public_id', 'wowowowow')->firstOrFail();
     $this->assertEquals(['name' => 'dolan'], $pair2->data);
 }
コード例 #2
0
 /**
  * Find a key pair by its public id.
  *
  * @param string $publicId
  * @param string $type
  *
  * @return KeyPair
  */
 public function byPublicId($publicId, $type)
 {
     return KeyPair::query()->where('public_id', $publicId)->where('type', $type)->firstOrFail();
 }