<?php
namespace App\Models;
use App\Models\Concerns\BelongsToMerchant;
use Illuminate\Database\Eloquent\Model;
class ApiKey extends Model {
 use BelongsToMerchant; protected $fillable=['merchant_id','key_prefix','public_key_hash','secret_ciphertext','secret_kid','scopes','environment','status','last_used_at']; protected $hidden=['secret_ciphertext']; protected function casts():array{return ['scopes'=>'array','secret_ciphertext'=>\App\Casts\EncryptedEnvelope::class,'last_used_at'=>'datetime'];} public function merchant(){return $this->belongsTo(Merchant::class);} }
