Alimentalos/Backend

View on GitHub
relationships/src/Geofenceable.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Alimentalos\Relationships;

use App\Models\Geofence;
use Illuminate\Database\Eloquent\Relations\MorphToMany;

trait Geofenceable
{
    /**
     * The resource related geofences.
     *
     * @return MorphToMany
     */
    public function geofences()
    {
        return $this->morphToMany(Geofence::class,'geofenceable','geofenceables','geofenceable_id','geofence_uuid','uuid','uuid');
    }
}