question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attribute Casting causes error

See original GitHub issue

Hi, 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:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NenadZivanoviccommented, Oct 16, 2016

I founded solution, I realized that i addField addColumn are different methods. Thank you very much!

0reactions
sayankanatovcommented, Mar 23, 2017

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found