@Tray2 Hello there.
But this is the only query im using in my Latest/Revamp Project.
$data = EncodedDatas::select(
'encoded_datas.id as dataId',
'encoded_datas.data_employee_no',
'encoded_datas.data_user_firstname',
'encoded_datas.data_user_middlename',
'encoded_datas.data_user_lastname',
'encoded_datas.data_encoded_by',
'encoded_datas.data_user_referred_by',
'encoded_datas.created_at',
'encoded_datas.data_user_lagunanay',
'encoded_datas.data_user_lagunanay_id',
'encoded_datas.data_voter_status',
'encoded_datas.data_user_image',
'barangay_list.id as barangayId',
'barangay_list.name as barangayName'
)
->leftJoin('barangay_list', 'barangay_list.id', '=', 'encoded_datas.data_user_barangay')
->orderBy('encoded_datas.created_at', 'DESC')
->get();
and this one is from the old project:
$data = EncodedDatas::join('barangay_list', 'barangay_list.brgy_id', '=', 'encoded_datas.data_user_barangay')
->join('barangay_position', 'barangay_position.pos_id', '=', 'encoded_datas.data_user_brgy_position')
->join('team_groups', 'team_groups.group_id', '=', 'encoded_datas.data_user_teamgroup')
->join('precint_list', 'precint_list.precint_id', '=', 'encoded_datas.data_user_precintno')
->join('cluster_list', 'cluster_list.cluster_id', '=', 'encoded_datas.data_user_clusterno')
->join('wave_list', 'wave_list.wave_id', '=', 'encoded_datas.data_user_wave')
->join('users', 'users.id', '=', 'encoded_datas.data_encoded_by')
->select(
'encoded_datas.data_id',
'encoded_datas.data_employee_no',
'encoded_datas.data_user_firstname',
'encoded_datas.data_user_lastname',
'encoded_datas.data_user_middlename',
'encoded_datas.data_user_barangay',
'encoded_datas.data_user_clusterno',
'encoded_datas.data_user_precintno',
'encoded_datas.data_user_brgy_position',
'encoded_datas.data_user_teamgroup',
'encoded_datas.data_user_referred_by',
'encoded_datas.data_encoded_by',
'encoded_datas.data_created',
'encoded_datas.data_voter_status',
'encoded_datas.data_user_asterisk',
'encoded_datas.data_user_raffle',
'barangay_list.brgy_id',
'barangay_list.brgy_name',
'barangay_position.pos_id',
'barangay_position.pos_name',
'team_groups.group_id',
'team_groups.group_name',
'users.id',
'users.fullname',
'precint_list.precint_id',
'precint_list.precint_number',
'cluster_list.cluster_id',
'cluster_list.cluster_number',
'wave_list.*'
)
->orderBy('encoded_datas.data_created', 'desc');