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
pad-upe
Commits
68b6caa0
Commit
68b6caa0
authored
Apr 15, 2023
by
alissonalbuquerque
Browse files
.
parent
239c0ec9
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/ImportUserController.php
View file @
68b6caa0
...
...
@@ -36,12 +36,10 @@ class ImportUserController extends Controller
$with_emails
=
array_filter
(
$lines
,
function
(
$array
)
{
return
$array
[
2
]
!==
'-'
;
});
$less_emails
=
array_filter
(
$lines
,
function
(
$array
)
{
return
$array
[
2
]
===
'-'
;
});
$campus_garanhuns
=
Campus
::
whereId
(
3
)
->
first
();
foreach
(
$with_emails
as
$data
)
{
$user
=
User
::
whereEmail
(
$data
[
2
])
->
first
();
$user
->
campus_id
=
$campus_garanhuns
->
id
;
$user
->
campus_id
=
3
;
if
(
!
$user
->
save
())
{
dd
(
'errors'
);
}
...
...
@@ -49,7 +47,7 @@ class ImportUserController extends Controller
fclose
(
$handle
);
dd
(
$campus_garanhuns
,
$with_emails
,
$less_emails
);
dd
(
3
,
$with_emails
,
$less_emails
);
return
redirect
()
->
route
(
'import_index'
);
}
...
...
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