Aronaman
4 months ago
671
4
Laravel

special character in query builder

Posted 4 months ago by Aronaman

in my database i have 10 bookings row from 10 i have 8 Bookable_type="App\Room", but i get zero, i think this is b/c the special character "/" . how can i solve this problem

         DB::raw("SUM(CASE WHEN bookings.bookable_type ='App\Room' THEN 1 ELSE 0 END) AS countBookedRoomMontly"),

i also try count , but give all not what i nedd

            DB::raw("COUNT(CASE WHEN bookings.bookable_type ='App\Room' THEN 1 ELSE 0 END) AS countBookedRoomMontly"),

Any Help

Please sign in or create an account to participate in this conversation.