How to write a database query to fetch all records whose column value is 1 in laravel-8?

I am developing one API which is responsible for fetching the (records)data whose cart(column) value is equal to 1 , How to acheive this thing please help me

This is how i am getting error

IlluminateDatabaseQueryException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from `books` group by `cart` having `cart` > 0) in file C:xampphtdocslaravel-bookstorevendorlaravelframeworksrcIlluminateDatabaseConnection.php 


 public function cartItem(){
            // $users=DB::table('books')->whereIn('cart',[1])->get();
            return response()->json(['books'=>$users],200);



use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;

class CreateBooksTable extends Migration
     * Run the migrations.
     * @return void
    public function up()
        Schema::create('books', function (Blueprint $table) {
            $table->enum('cart', [0, 1])->default(0);


Try this one

    $books_record = DB::table('books')->where(['cart', '=', '1'])->get();