* fix css focuses * #90 - wip * #90 - fix to generate PDF * #90 - wip * #90 - wip * #90 - wip * #90 - wip * #90 - fix to calendar * #90 - wip * #90 - fix * #90 - fix lint * #90 - fix * Apply suggestions from code review Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com> * #90 - cr fixes * #90 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Infrastructure\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Toby\Eloquent\Models\User;
|
||||
|
||||
class MoveUserDataToProfile extends Command
|
||||
{
|
||||
protected $signature = "toby:move-user-data-to-profile";
|
||||
protected $description = "Move user data to their profiles";
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$users = User::all();
|
||||
|
||||
foreach ($users as $user) {
|
||||
$user->profile()->updateOrCreate(["user_id" => $user->id], [
|
||||
"first_name" => $user->first_name,
|
||||
"last_name" => $user->last_name,
|
||||
"position" => $user->position,
|
||||
"employment_form" => $user->employment_form,
|
||||
"employment_date" => $user->employment_date,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user