May be is simple but I have one table where I want to take value from one column. They are two records and always will be two records and I need value from second id.. Here is visual
id key value
1 key_1 Value_1
2 key_2 value_2
$free = DB::table('settings')->select('value')->where('key', '=', 'free')->get();
return View::make('site.cart.order', [
'cart' => $cart,
'free' => $free
@if( $total < $free['value'] )
Undefined index: value
If I'm right Laravel returns a standard class there and you should access it like this.
But you have to change now it selects the first record
$free = DB::table('settings')->select('value')->where('key', '=', 'free')->first();
Then you can access it like
Or if you don't want to change get() to first() you can access it like this because get() returns an array.