/home/kueuepay/public_html/app/Models/MerchantApiKey.php
<?php

namespace App\Models;

use Laravel\Passport\HasApiTokens;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class MerchantApiKey extends Model
{
    use HasApiTokens,HasFactory;

    protected $guarded = ['id'];

    protected $casts    = [
        'id'            => 'integer',
        'user_id'       => 'integer',
        'env'           => 'string',
        'client_id'     => 'string',
        'secret_id'     => 'string'
    ];

    public function scopeAuth($query){
        return $query->where('user_id',auth()->user()->id);
    }

    public function user(){
        return $this->belongsTo(User::class);
    }


}
Best Practice

Best Practices

To ensure a smooth integration process and optimal performance, follow these best practices:

  1. Use secure HTTPS connections for all API requests.
  2. Implement robust error handling to handle potential issues gracefully.
  3. Regularly update your integration to stay current with any API changes or enhancements.