Posts

Showing posts from December, 2022

laravel - order query

    $data = Order :: query ()             -> where ( 'employeeid' , 'LIKE' , "%{ $employeeid }%" )               -> orderBy ( 'id' , 'DESC' )             -> paginate ( 25 );

laravel where and orwhere query with pagination

    public function SupplierProductReturnSearch ( Request $request ){         // Get the search value from the request         $search = $request -> input ( 'search' );                   // Search in the title and body columns from the posts table         $listings = MainProduct :: query ()             -> where ( 'name' , 'LIKE' , "%{ $search }%" )                       -> orWhere ( 'product_id' , 'LIKE' , "%{ $search }%" )                       -> paginate ( 25 );             // Return the search view with the resluts compacted         return view ( 'front.manager.return-supplier-product' , compact ( 'listings' ));     }

other table connect

        // Load database   $db2 = $this -> load -> database ( 'database2' , TRUE );   // Select records from 2nd database   $db2 -> select ( '*' );   $db2 -> where ( 'id' , $business_id ); $query = $db2 -> get ( 'cld_businesses' );   $bussinessData = $query -> first_row ();