create table point using one to many

Posted 5 days ago by fauzanrozaq

i want create count point using one to many, desc: tb_user : user_id | name | point tb_customer : id | name | user_id

i want count point from tb_customer with filter by user_id



tb_customer : 

id        | name_t   | user_id
____________________________
1         | tom      | 1 
2         | tam      | 5  
3         | duke     | 5 
4         | law      | 3  
5         | han      | 5  ```



tb_user : 

user_id   | name     | point 
___________________________
1         | john    | 1
2         | jahn    | 0  
3         | doen    | 1 
4         | luke    | 0  
5         | boy     | 3   

// how made it 



#using
$var = DB::where('colum', 'data')->count(); 


#i try
$point = jamaah::where('user_id', $???? )->count(); 

$??? i dont know

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.