<?php

namespace Modules\Plan7\Traits;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\MorphOne;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\Plan7\Models\ComplexPlan7;
trait Plan7Api
{
    public function getPlan7ApiData()
    {
        if ( $plan7 = ComplexPlan7::where('complex_id', $this->id)->first() ) {
            return $plan7;
        }
        return null;
    }
}


