In MySQL I have several user data, I need to filter the data automatically with the user who logged into the system. Below is a part of the code in the controller:
//executa a query
$lista = Ponto::with('name')->where('name', Auth::name() )
->get();
(MySql) Table ponto / structure:
id
name
cpf
cargo
data_inicial
hora_inicial
ref_hora_inicial
ref_hora_final
data_final
hora_final
created_at
updated_at
28
Arecelino Soares
012.213.564-80
Motorista
2021-11-18
16:22
17:12
17:12
2021-11-30
22:30
2021-11-09 19:23:55
2021-11-16 12:34:30
77
Robison Santos
132.321.432-43
Motorista
2021-11-16
12:57
NULL
NULL
NULL
NULL
2021-11-16 15:55:09
2021-11-16 15:55:09
complement: Table Laravel, Users data
