-
| i can create custom cast on Wallet, but not working with Transaction model. When i create custom transcation model like below: it show: and i already change the transaction model in wallet.php config:  | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            jazz7381
          
      
      
        Oct 22, 2022 
      
    
    Replies: 2 comments
-
| nevermind, i extend wrong class in my model | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        jazz7381
-
| You have the wrong base model Transaction. - use Bavix\Wallet\Models\Wallet AS Base;
+ use Bavix\Wallet\Models\Transaction AS Base;PS, I noticed that you are using keys from the wallet table. Most likely you need to do this: <?php
namespace App\Models;
use Bavix\Wallet\Models\Wallet AS Base;
class Wallet extends Base
{
    /**
     * @var array<string, string>
     */
    protected $casts = [
        'decimal_places' => 'int',
        'meta' => 'json',
        'created_at' => 'datetime:Uv',
        'updated_at' => 'datetime:Uv',
    ];
}wallet.php:    ...
    'wallet' => [
        'model' => \App\Models\Wallet::class,
    ... | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
nevermind, i extend wrong class in my model