WowPress-Tailwind/theme/vendor/illuminate/database/LazyLoadingViolationExcepti...

40 lines
771 B
PHP
Raw Permalink Normal View History

2024-04-15 16:00:49 +02:00
<?php
namespace Illuminate\Database;
use RuntimeException;
class LazyLoadingViolationException extends RuntimeException
{
/**
* The name of the affected Eloquent model.
*
* @var string
*/
public $model;
/**
* The name of the relation.
*
* @var string
*/
public $relation;
/**
* Create a new exception instance.
*
* @param object $model
* @param string $relation
* @return static
*/
public function __construct($model, $relation)
{
$class = get_class($model);
parent::__construct("Attempted to lazy load [{$relation}] on model [{$class}] but lazy loading is disabled.");
$this->model = $class;
$this->relation = $relation;
}
}