Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
fd820c2c
Commit
fd820c2c
authored
3 years ago
by
Jose Fernando Mendes da Costa
Browse files
Options
Download
Email Patches
Plain Diff
Cria models para solicitacao de certificado
parent
8060f9e6
master
carl-branch
dependabot/composer/dompdf/dompdf-1.2.2
dependabot/composer/guzzlehttp/guzzle-6.5.8
dependabot/composer/guzzlehttp/psr7-1.8.5
dependabot/composer/symfony/http-kernel-4.4.50
dependabot/npm_and_yarn/decode-uri-component-0.2.2
dependabot/npm_and_yarn/express-4.18.2
dependabot/npm_and_yarn/json5-and-json5-2.2.3
dependabot/npm_and_yarn/loader-utils-and-webpack-cli-1.4.2
dependabot/npm_and_yarn/minimist-and-mkdirp-1.2.8
dependabot/npm_and_yarn/qs-and-express-6.11.0
excluir_projeto_submetido
updates_mar
No related merge requests found
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
app/Notificacao.php
+6
-1
app/Notificacao.php
app/SolicitacaoCertificado.php
+20
-0
app/SolicitacaoCertificado.php
app/SolicitacaoParticipante.php
+24
-0
app/SolicitacaoParticipante.php
app/Trabalho.php
+5
-0
app/Trabalho.php
database/migrations/2022_03_18_083809_create_certificados_table.php
+31
-0
...igrations/2022_03_18_083809_create_certificados_table.php
database/migrations/2022_03_21_122553_create_solicitacao_participantes_table.php
+37
-0
...2_03_21_122553_create_solicitacao_participantes_table.php
database/migrations/2022_03_21_123012_add_solicitacao_certificado_to_notificacaos.php
+34
-0
...21_123012_add_solicitacao_certificado_to_notificacaos.php
with
157 additions
and
1 deletion
+157
-1
app/Notificacao.php
100644 → 100755
View file @
fd820c2c
...
@@ -12,7 +12,7 @@ class Notificacao extends Model
...
@@ -12,7 +12,7 @@ class Notificacao extends Model
* @var array
* @var array
*/
*/
protected
$fillable
=
[
protected
$fillable
=
[
'lido'
,
'tipo'
,
'destinatario_id'
,
'remetente_id'
,
'perfil_id'
,
'trabalho_id'
,
'lido'
,
'tipo'
,
'destinatario_id'
,
'remetente_id'
,
'perfil_id'
,
'trabalho_id'
,
'solicitacao_certificado_id'
,
];
];
public
function
destinatario
(){
public
function
destinatario
(){
...
@@ -26,4 +26,9 @@ class Notificacao extends Model
...
@@ -26,4 +26,9 @@ class Notificacao extends Model
public
function
trabalho
(){
public
function
trabalho
(){
return
$this
->
belongsTo
(
Trabalho
::
class
,
'trabalho_id'
,
'id'
);
return
$this
->
belongsTo
(
Trabalho
::
class
,
'trabalho_id'
,
'id'
);
}
}
public
function
solicitacaoCertificado
()
{
return
$this
->
belongsTo
(
'\App\SolicitacaoCertificado'
,
'solicitacao_certificado_id'
);
}
}
}
This diff is collapsed.
Click to expand it.
app/SolicitacaoCertificado.php
0 → 100755
View file @
fd820c2c
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
SolicitacaoCertificado
extends
Model
{
protected
$table
=
"solicitacoes_certificados"
;
protected
$fillable
=
[
'trabalho_id'
];
public
function
solicitacoesParticipantes
()
{
return
$this
->
hasMany
(
'App\SolicitacaoParticipante'
,
'solicitacao_certificado_id'
);
}
}
This diff is collapsed.
Click to expand it.
app/SolicitacaoParticipante.php
0 → 100644
View file @
fd820c2c
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
SolicitacaoParticipante
extends
Model
{
protected
$table
=
"solicitacoes_participantes"
;
protected
$fillable
=
[
'solicitacao_certificado_id'
,
'user_id'
];
public
function
solicitacaoCertificado
()
{
return
$this
->
belongsTo
(
'App\SolicitacaoCertificado'
,
'solicitacao_certificado_id'
);
}
public
function
user
()
{
return
$this
->
belongsTo
(
'App\User'
,
'user_id'
);
}
}
This diff is collapsed.
Click to expand it.
app/Trabalho.php
View file @
fd820c2c
...
@@ -110,4 +110,9 @@ class Trabalho extends Model
...
@@ -110,4 +110,9 @@ class Trabalho extends Model
public
function
notificacoes
(){
public
function
notificacoes
(){
return
$this
->
hasMany
(
Notificacao
::
class
,
'trabalho_id'
,
'id'
);
return
$this
->
hasMany
(
Notificacao
::
class
,
'trabalho_id'
,
'id'
);
}
}
public
function
solicitacoesCertificados
()
{
return
$this
->
hasMany
(
Certificado
::
class
,
'trabalho_id'
);
}
}
}
This diff is collapsed.
Click to expand it.
database/migrations/2022_03_18_083809_create_certificados_table.php
0 → 100755
View file @
fd820c2c
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateCertificadosTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'solicitacoes_certificados'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'solicitacoes_certificados'
);
}
}
This diff is collapsed.
Click to expand it.
database/migrations/2022_03_21_122553_create_solicitacao_participantes_table.php
0 → 100644
View file @
fd820c2c
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateSolicitacaoParticipantesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'solicitacoes_participantes'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
unsignedBigInteger
(
'user_id'
);
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
$table
->
unsignedBigInteger
(
'solicitacao_certificado_id'
);
$table
->
foreign
(
'solicitacao_certificado_id'
)
->
references
(
'id'
)
->
on
(
'solicitacoes_certificados'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'solicitacoes_participantes'
);
}
}
This diff is collapsed.
Click to expand it.
database/migrations/2022_03_21_123012_add_solicitacao_certificado_to_notificacaos.php
0 → 100644
View file @
fd820c2c
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddSolicitacaoCertificadoToNotificacaos
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'notificacaos'
,
function
(
Blueprint
$table
)
{
$table
->
unsignedBigInteger
(
'solicitacao_certificado_id'
)
->
nullable
();
$table
->
foreign
(
'solicitacao_certificado_id'
)
->
references
(
'id'
)
->
on
(
'solicitacoes_certificados'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'notificacaos'
,
function
(
Blueprint
$table
)
{
$table
->
dropForeign
([
'solicitacao_certificado_id'
]);
$table
->
dropColumn
(
'solicitacao_certificado_id'
);
});
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help