????

Your IP : 3.17.110.120


Current Path : /home/thenclexdoctor.com/public_html/app/Models/Api/
Upload File :
Current File : /home/thenclexdoctor.com/public_html/app/Models/Api/Bundle.php

<?php

namespace App\Models\Api;

use App\Models\Api\Traits\CheckForSaleTrait;
use App\Models\Favorite;
use App\Models\Bundle as Model;

class Bundle extends Model
{
    use CheckForSaleTrait;

    public function getIsFavoriteAttribute()
    {
        if (!apiAuth()) {
            return null;
        }
        return (bool)Favorite::where('bundle_id', $this->id)
            ->where('user_id', apiAuth()->id)
            ->first();
    }

    public function badges()
    {
        return $this->hasMany('App\Models\Api\ProductBadgeContent', 'targetable_id', 'id');
    }
    public function bundleWebinars()
    {
        return $this->hasMany('App\Models\Api\BundleWebinar', 'bundle_id', 'id');
    }

    public function webinars()
    {
        //  return $this->hasManyThrough('App\Models\Webinar', 'App\Models\BundleWebinar', 'bundle_id', 'id');
    }
    public function teacher()
    {
        return $this->belongsTo('App\Models\Api\User', 'teacher_id', 'id');
    }

    public function tickets()
    {
        return $this->hasMany('App\Models\Api\Ticket', 'bundle_id', 'id');
    }

}

Page not found | The NCLEX Doctor

Page not found!

Sorry, this page is not available...