私はLaravelを短期間使用しており、クエリから取得したデータにアクセスするのは混乱しています。私は、変数にデータを保存しようとしているが、次のようになっています:Laravel Select Query返されたデータへのアクセス
Trying to get property of non-object
クエリを試してみました:
$data = DB::table('table_1')->select('user_id', 'email')->where('email', '=', Input::get('email_address'))->get();
// also tried
$data = DB::table('table_1')->where('email', '=', Input::get('email_address'))->pluck('user_id');
// accessing data
$userID = $data->user_id;
の両方が同じを返します。