Skip to content
GitLab
Menu
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
7b8cce78
Commit
7b8cce78
authored
May 17, 2023
by
luiz-davi
Browse files
fix usuários duplicados
parent
9b7944b5
Changes
2
Show whitespace changes
Inline
Side-by-side
database/seeders/ParticipanteSeeder.php
View file @
7b8cce78
...
@@ -11,11 +11,10 @@ class ParticipanteSeeder extends Seeder
...
@@ -11,11 +11,10 @@ class ParticipanteSeeder extends Seeder
*/
*/
public
function
run
()
public
function
run
()
{
{
$user_id
=
DB
::
table
(
'users'
)
->
where
(
'name'
,
'Participante1'
)
->
pluck
(
'id'
);
$user_id
=
DB
::
table
(
'users'
)
->
where
(
'name'
,
'Participante1'
)
->
pluck
(
'id'
);
DB
::
table
(
'participantes'
)
->
insert
([
DB
::
table
(
'participantes'
)
->
insert
([
'user_id'
=>
$user_id
[
0
],
'user_id'
=>
$user_id
[
0
],
]);
]);
// $participante = App\Participante::find(1);
// $participante = App\Participante::find(1);
...
@@ -24,11 +23,10 @@ class ParticipanteSeeder extends Seeder
...
@@ -24,11 +23,10 @@ class ParticipanteSeeder extends Seeder
// $user->save();
// $user->save();
$user_id
=
DB
::
table
(
'users'
)
->
where
(
'name'
,
'Participante2'
)
->
pluck
(
'id'
);
// $user_id = DB::table('users')->where('name', 'Participante2')->pluck('id');
//
DB
::
table
(
'participantes'
)
->
insert
([
// DB::table('participantes')->insert([
'user_id'
=>
$user_id
[
0
],
// 'user_id' => $user_id[0],
// ]);
]);
}
}
}
}
database/seeders/UsuarioSeeder.php
View file @
7b8cce78
...
@@ -76,14 +76,6 @@ class UsuarioSeeder extends Seeder
...
@@ -76,14 +76,6 @@ class UsuarioSeeder extends Seeder
'email_verified_at'
=>
'2020-01-01'
'email_verified_at'
=>
'2020-01-01'
]);
]);
DB
::
table
(
'users'
)
->
insert
([
'name'
=>
'Participante1'
,
'email'
=>
'part1@ufrpe.br'
,
'password'
=>
Hash
::
make
(
'12345678'
),
'tipo'
=>
'participante'
,
'email_verified_at'
=>
'2020-01-01'
]);
DB
::
table
(
'users'
)
->
insert
([
DB
::
table
(
'users'
)
->
insert
([
'name'
=>
'Avaliador1'
,
'name'
=>
'Avaliador1'
,
'email'
=>
'aval1@ufrpe.br'
,
'email'
=>
'aval1@ufrpe.br'
,
...
...
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