-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9667bcb
commit 0bda866
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/Illuminate/Database/Eloquent/JsonEncodingException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Illuminate\Database\Eloquent; | ||
|
||
use RuntimeException; | ||
|
||
class JsonEncodingException extends RuntimeException | ||
{ | ||
/** | ||
* Create a new JSON encoding exception for the model. | ||
* | ||
* @param mixed $model | ||
* @param string $message | ||
* @return static | ||
*/ | ||
public static function forModel($model, $message) | ||
{ | ||
return new static('Error encoding model ['.get_class($model).'] with ID ['.$model->getKey().'] to JSON: '.$message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters