Casts
1 month ago
Concerns
1 month ago
Factories
1 month ago
Relations
1 month ago
BroadcastableModelEventOccurred.php
1 month ago
BroadcastsEvents.php
6 months ago
Builder.php
1 month ago
Collection.php
1 month ago
HigherOrderBuilderProxy.php
2 years ago
InvalidCastException.php
2 years ago
JsonEncodingException.php
2 years ago
MassAssignmentException.php
2 years ago
MassPrunable.php
6 months ago
MissingAttributeException.php
1 month ago
Model.php
1 month ago
ModelNotFoundException.php
1 month ago
PendingHasThroughRelationship.php
1 month ago
Prunable.php
2 years ago
QueueEntityResolver.php
2 years ago
RelationNotFoundException.php
2 years ago
Scope.php
2 years ago
SoftDeletes.php
1 month ago
SoftDeletingScope.php
1 month ago
InvalidCastException.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Database\Eloquent; |
| 4 | |
| 5 | use RuntimeException; |
| 6 | /** @internal */ |
| 7 | class InvalidCastException 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 column. |
| 17 | * |
| 18 | * @var string |
| 19 | */ |
| 20 | public $column; |
| 21 | /** |
| 22 | * The name of the cast type. |
| 23 | * |
| 24 | * @var string |
| 25 | */ |
| 26 | public $castType; |
| 27 | /** |
| 28 | * Create a new exception instance. |
| 29 | * |
| 30 | * @param object $model |
| 31 | * @param string $column |
| 32 | * @param string $castType |
| 33 | * @return static |
| 34 | */ |
| 35 | public function __construct($model, $column, $castType) |
| 36 | { |
| 37 | $class = \get_class($model); |
| 38 | parent::__construct("Call to undefined cast [{$castType}] on column [{$column}] in model [{$class}]."); |
| 39 | $this->model = $class; |
| 40 | $this->column = $column; |
| 41 | $this->castType = $castType; |
| 42 | } |
| 43 | } |
| 44 |