Attribute Casting causes error
See original GitHub issueHi, I use eloquent attribute casting and I have
protected $casts = [ 'mentions' => 'array', ];
in my model. It causes
ErrorException in 90d0d21803ea756d9c9e49ba82191f0eef2d2e2d.php line 97: strip_tags() expects parameter 1 to be string, array given (View: …\vendor\backpack\crud\src\resources\views\list.blade.php)
error when I hit the admin/somecrudpage .If I remove $casts, there is no problem. So, I think Backpack/Crud needs to support eloquent attribute casting. I will be happy if you help me to makeshift for this issue because I have a project to done. Or I prefer if you commit for solving this problem 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Eloquent attribute type casting doesn't work in some models
I have several models in my application, first model is User , and it works like a charm. 1 is converted into true,...
Read more >DBSequence attribute cast error. - Oracle Communities
Hello Experts,. I created a sequence in database to create ProdId. Then created a trigger on insert in the products table by right...
Read more >Casting and type conversions - C# Programming Guide
Casting is required when information might be lost in the conversion, or when the conversion might not succeed for other reasons.
Read more >TypeScript Casting - W3Schools
A straightforward way to cast a variable is using the as keyword, which will directly change the type of the given variable.
Read more >Fixing the Kotlin Error “Smart cast to 'Type' is impossible”
We've understood the cause of this error is that another thread can modify a mutable class property. Also, we know that all function...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I founded solution, I realized that i addField addColumn are different methods. Thank you very much!
Hello! I have one problem with multiple uploadings, error say strip_tags() expects parameter 1 to be string, array given (View: C:\xampp\htdocs\vendor\backpack\crud\src\resources\views\columns\text.blade.php) Pliz help me< thank u