Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to a member function where() on integer

Tags:

php

laravel

I get this error:

Call to a member function where() on integer

when I run this code:

DB::table('level_one_models')
  ->increment('followers', 1)
  ->where('active', '=', 1);

What am I doing wrong?

like image 564
Justin Avatar asked Dec 18 '25 00:12

Justin


1 Answers

Call where before increment:

DB::table('level_one_models')
  ->where('active', 1)
  ->increment('followers', 1);
like image 136
Joseph Silber Avatar answered Dec 20 '25 12:12

Joseph Silber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!