src/Database/Models.php
public static function isOwnedBy(Model $authority, Model $model)
    {
        $type = get_class($model);

        if (isset(static::$ownership[$type])) {
            $attribute = static::$ownership[$type];
        } elseif (isset(static::$ownership['*'])) {
            $attribute = static::$ownership['*'];
        } else {
            $attribute = strtolower(static::basename($authority)).'_id';
        }

        return static::isOwnedVia($attribute, $authority, $model);
    }
public static function isOwnedBy(Model $authority, Model $model)
    {
        $type = get_class($model);

        if (isset(static::$ownership[$type])) {
            $attribute = static::$ownership[$type];
        } elseif (isset(static::$ownership['*'])) {
            $attribute = static::$ownership['*'];
        } else {
            $attribute = strtolower(static::basename($authority)).'_id';
        }

        return static::isOwnedVia($attribute, $authority, $model);
    }
public static function isOwnedBy ( Model $ authority , Model $ model ) { $ type = get_class ( $ model ) ; if ( isset ( static :: $ ownership [ $ type ] ) ) { $ attribute = static :: $ ownership [ $ type ] ; } elseif ( isset ( static :: $ ownership [ '*' ] ) ) { $ attribute = static :: $ ownership [ '*' ] ; } else { $ attribute = strtolower ( static :: basename ( $ authority ) ) . '_id' ; } return static :: isOwnedVia ( $ attribute , $ authority , $ model ) ; }
Determines whether the given model is owned by the given authority.

@param  \Illuminate\Database\Eloquent\Model  $authority
@param  \Illuminate\Database\Eloquent\Model  $model
@return bool
Determines whether the given model is owned by the given authority .