I want to order my all products by price. In Product table there is product_options column and inside of that column i have json data, something like this;
{"price":390,"discounted_price":26,"quantity":168}
I tried to orderBy product_options but its returnin by alphabetic so 17 comes after 1000. It looks like i should use collection functions for this but i am really new at that.
$searchData = DB::table('posts')->where('type','=','product')->whereNotNull('product_options')->orderBy('product_options->price')->get();
When i return dd function it looks like that

Can someone please help me?