Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
tipuloidea
/
back
/
vendor
/
spatie
/
laravel-data
/
src
/
Exceptions
:
CannotCastData.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace Spatie\LaravelData\Exceptions; use Exception; class CannotCastData extends Exception { public static function shouldBeArray(string $modelClass, string $attribute): self { return new self("Attribute `{$attribute}` of model `{$modelClass}` should be an array"); } public static function shouldBeData(string $modelClass, string $attribute): self { return new self("Attribute `{$attribute}` of model `{$modelClass}` should be a Data object"); } public static function shouldBeTransformableData(string $modelClass, string $attribute): self { return new self("Attribute `{$attribute}` of model `{$modelClass}` should be a transformable Data object"); } public static function dataCollectionTypeRequired(): self { return new self('When casting a Data Collection the type of Data should be provided as an argument'); } }