HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers84/zuiderbos.nl/app/Komma/PhotoAlbums/Models/PhotoAlbumTranslation.php
<?php

namespace Komma\PhotoAlbums\Models;

class PhotoAlbumTranslation extends \Komma\Kms\PhotoAlbums\Models\PhotoAlbumTranslation
{

    public $kmsClass = 'Komma\\Kms\\PhotoAlbums\\Models\\PhotoAlbumTranslation';


    /**
     * Get the route from the current translation
     *
     * @return Collection
     */
    public function route()
    {
        /**
         * On the Route model is an MorphTo relation
         * By using a hasOne relation:
         * where the routable_type is filled in with the KmsClass
         * And the routable_id is set as the foreign_id,
         * we can collect the route of the given model directly.
         *
         */
        return $this->hasOne('Komma\Routes\Models\Route', 'routable_id')
            ->where('routable_type', '=', $this->kmsClass);
    }

}