In laravel 4 route, i have a database query like this
$data1 = DB::select('SELECT MAX(id) AS mxid FROM table_name', array());
return $data1["mxid"];
But it gives the following error:

Help me. I can't understand why this key is not found . If i write
return $data1;
it gives,
[{"mxid":"0"}]