Tuesday, April 11, 2017

how can i use convert array to string and converse in controller of laravel

How can the array controller in the field and vice versa Laravel I implement? It all went wrong I use this method, but I can not output. I want to know whether the logic of the code that I wrote three or Not? please guide me

 $one=DB::table('restaurant_menus')->where('restaurant_menus.restaurant_id',"=",$id)->get(['menu_id']);
    foreach($one as $i){
        $ii=json_encode($i);
        $two=DB::table('menus')->where('menus.id',"=",$ii)->get(['FoodItem']);
        $iii=json_encode($two);
        dd($iii);
    }



via daniel

Advertisement