Capsule
2 years ago
Concerns
2 weeks ago
Connectors
2 weeks ago
Console
2 weeks ago
DBAL
2 weeks ago
Eloquent
2 weeks ago
Events
2 weeks ago
Migrations
2 weeks ago
PDO
2 weeks ago
Query
2 weeks ago
Schema
2 weeks ago
ClassMorphViolationException.php
2 years ago
ConfigurationUrlParser.php
2 years ago
Connection.php
2 weeks ago
ConnectionInterface.php
2 years ago
ConnectionResolver.php
2 weeks ago
ConnectionResolverInterface.php
2 years ago
DatabaseManager.php
2 weeks ago
DatabaseServiceProvider.php
2 weeks ago
DatabaseTransactionRecord.php
2 weeks ago
DatabaseTransactionsManager.php
2 weeks ago
DeadlockException.php
2 weeks ago
DetectsConcurrencyErrors.php
2 years ago
DetectsLostConnections.php
2 weeks ago
Grammar.php
2 weeks ago
LazyLoadingViolationException.php
2 years ago
LostConnectionException.php
2 weeks ago
MigrationServiceProvider.php
2 weeks ago
MultipleColumnsSelectedException.php
2 weeks ago
MultipleRecordsFoundException.php
2 weeks ago
MySqlConnection.php
2 weeks ago
PostgresConnection.php
2 weeks ago
QueryException.php
2 years ago
RecordsNotFoundException.php
2 years ago
SQLiteConnection.php
2 weeks ago
SQLiteDatabaseDoesNotExistException.php
2 weeks ago
Seeder.php
2 weeks ago
SqlServerConnection.php
2 weeks ago
LazyLoadingViolationException.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Database; |
| 4 | |
| 5 | use RuntimeException; |
| 6 | /** @internal */ |
| 7 | class LazyLoadingViolationException extends RuntimeException |
| 8 | { |
| 9 | /** |
| 10 | * The name of the affected Eloquent model. |
| 11 | * |
| 12 | * @var string |
| 13 | */ |
| 14 | public $model; |
| 15 | /** |
| 16 | * The name of the relation. |
| 17 | * |
| 18 | * @var string |
| 19 | */ |
| 20 | public $relation; |
| 21 | /** |
| 22 | * Create a new exception instance. |
| 23 | * |
| 24 | * @param object $model |
| 25 | * @param string $relation |
| 26 | * @return static |
| 27 | */ |
| 28 | public function __construct($model, $relation) |
| 29 | { |
| 30 | $class = \get_class($model); |
| 31 | parent::__construct("Attempted to lazy load [{$relation}] on model [{$class}] but lazy loading is disabled."); |
| 32 | $this->model = $class; |
| 33 | $this->relation = $relation; |
| 34 | } |
| 35 | } |
| 36 |