Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

in your database is active a boolean, tinyint(1) or a string?

what do you see in your database for this column?

Also a similar issue like this was posted here few months back.. i wish i could remember what the resolution was

Last updated 8 years ago.
0

I have tinyint(1) but if to change for int or varchar, the result is identical. However such request works always correctly: \DB:: table ('price_lists')->where ('category', $section)->where ('active', '=', 1)->get ();

Last updated 8 years ago.
0

can you maybe try casting it as a boolean in your MODEL.. and see if that fixes it? worth a shot..

0

shez1983 said:

can you maybe try casting it as a boolean in your MODEL.. and see if that fixes it? worth a shot..

If you mean the migration, the changes do not lead to error correction. The model itself is only indicated field:      protected $ table = 'price_lists';

     protected $ fillable = ['name', 'type', 'category', 'active'];

     protected $ dates = ['created_at', 'updated_at'];

0

Sign in to participate in this thread!

Eventy

Your banner here too?

wosheg wosheg Joined 13 Oct 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.