lundi 13 mai 2019

query builder with pagination in laravel frame work

i'm new in laravel and i have problem i want to make pagination with this query and at same time i want return data in array no in object can any one help me

this is my helper

public static function allData($Tablename,$Condition="",$data="")
        {


            $stattment = DB::table($Tablename)
                ->whereRaw(''.$Condition.'', $data)
                ->get()->toArray()
                ->paginate(1);



            return $stattment;

}

this is my controller

enter code here
    public function getall()
        {

   $dataView['products']=Helper::allData('products','`status`=? AND `deleted`=?',array(1,1));
            return view('productss.getall',$dataView);
        }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire