F
Filament2y ago
ghc

Create new Announce Exception

I am getting an error when trying to add an Announce. The error is "Array to string conversion". This error does not occur when I edit an existing Announce. I have attached a file with more information. If you need any further information, please let me know.
11 Replies
ghc
ghcOP2y ago
Resource
ghc
ghcOP2y ago
moudel
ghc
ghcOP2y ago
migrations
ghc
ghcOP2y ago
error
awcodes
awcodes2y ago
Cast banner to an array.
ghc
ghcOP2y ago
Can you show me an example? I don't quite understand.
LeandroFerreira
https://filamentphp.com/docs/3.x/forms/fields/file-upload#uploading-multiple-files
protected $casts = [
'banner' => 'array',
];
protected $casts = [
'banner' => 'array',
];
ghc
ghcOP2y ago
What should I do with my draft (is Boolean)? Should I add it to fillable?
LeandroFerreira
protected $casts = [
'draft' => 'boolean',
'banner' => 'array',
];
protected $casts = [
'draft' => 'boolean',
'banner' => 'array',
];
ghc
ghcOP2y ago
How do I understand $casts? Is it a forced data type conversion?
LeandroFerreira
check the laravel docs please

Did you find this page helpful?