YandexError.php 615 Bytes
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;

class YandexError extends Model
{
    use SoftDeletes;

    protected $table = 'yandex_errors';

    protected $fillable = [
        'token_id',
        'cause_type',
        'cause_id',
        'service',
        'method',
        'params',
        'errors',
    ];

    protected $casts = [
      'params' => 'json',
      'errors' => 'array',
    ];

    public function token()
    {
        return $this->belongsTo(Tokens::class, 'token_id');
    }

    public function cause()
    {
        return $this->morphTo('cause');
    }

}