File tree Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ class Usuario extends Authenticatable
34
34
'password ' ,
35
35
'remember_token ' ,
36
36
];
37
+
38
+ protected $ appends = [
39
+ 'quantidade_total_requisicoes ' ,
40
+ ];
37
41
38
42
/**
39
43
* Get the attributes that should be cast.
@@ -46,7 +50,7 @@ protected function casts(): array
46
50
'email_verified_at ' => 'datetime ' ,
47
51
'password ' => 'hashed ' ,
48
52
];
49
- }
53
+ }
50
54
51
55
public function tipo (){
52
56
return $ this ->belongsTo (Tipo::class);
@@ -63,4 +67,10 @@ public function hasPermission(string $permission): bool {
63
67
64
68
}
65
69
70
+ // Quantidade total de requisições
71
+ public function getQuantidadeTotalRequisicoesAttribute (){
72
+ $ quantidade = LogConsulta::where ('usuario_id ' , $ this ->id )->count ();
73
+ return $ quantidade ;
74
+ }
75
+
66
76
}
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ const deletarUsuario = (produto_id) => {
43
43
<th scope =" col" class =" px-6 py-3" >Nome</th >
44
44
<th scope =" col" class =" px-6 py-3" >E-mail</th >
45
45
<th scope =" col" class =" px-6 py-3" >Tipo de usuário</th >
46
+ <th scope =" col" class =" px-6 py-3" >Nº total Requisições</th >
46
47
<th scope =" col" class =" px-6 py-3" >Ações</th >
47
48
</tr >
48
49
</thead >
@@ -63,6 +64,9 @@ const deletarUsuario = (produto_id) => {
63
64
{{ usuario.tipo.descricao }}
64
65
</p >
65
66
</td >
67
+ <td class =" px-6 py-4" >
68
+ {{ usuario.quantidade_total_requisicoes }}
69
+ </td >
66
70
<td class =" px-6 py-4 flex inline-flex space-x-2" >
67
71
<Link
68
72
:href =" route('usuario.editar', { id: usuario.id })"
Original file line number Diff line number Diff line change 9
9
<!-- Fonts -->
10
10
<link rel =" preconnect" href =" https://fonts.bunny.net" >
11
11
<link href =" https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel =" stylesheet" />
12
+ <link rel =" Nova Era Placas" type =" image/png" href =" /favicon_normal.png" />
12
13
13
14
<!-- Scripts -->
14
15
@routes
You can’t perform that action at this time.
0 commit comments