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
RelationNotFoundException.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Database\Eloquent; |
| 4 | |
| 5 | use RuntimeException; |
| 6 | /** @internal */ |
| 7 | class RelationNotFoundException 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 | * @param string|null $type |
| 27 | * @return static |
| 28 | */ |
| 29 | public static function make($model, $relation, $type = null) |
| 30 | { |
| 31 | $class = \get_class($model); |
| 32 | $instance = new static(\is_null($type) ? "Call to undefined relationship [{$relation}] on model [{$class}]." : "Call to undefined relationship [{$relation}] on model [{$class}] of type [{$type}]."); |
| 33 | $instance->model = $class; |
| 34 | $instance->relation = $relation; |
| 35 | return $instance; |
| 36 | } |
| 37 | } |
| 38 |