Skip to content

Commit

Permalink
fix registration
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Dec 5, 2023
1 parent 1b6926c commit 66b8b52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/Import/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public function handle(): int
'--force' => $this->option('force'),
]);

// $this->call(ImportDonationsCommand::class, [
// '--force' => $this->option('force'),
// ]);
$this->call(ImportDonationsCommand::class, [
'--force' => $this->option('force'),
]);

$this->call(ImportArticlesCommand::class, [
'--skip-files' => $this->option('skip-files'),
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Enums\UserRole;
use App\Http\Controllers\Controller;
use App\Http\Requests\RegistrationRequest;
use App\Models\Organization;
use App\Models\User;
use App\Services\NewsletterService;
use Illuminate\Auth\Events\Registered;
Expand Down Expand Up @@ -53,8 +54,9 @@ public function store(RegistrationRequest $request): RedirectResponse
if ($user->hasRole(UserRole::ADMIN)) {
$attributes['ngo']['status'] = OrganizationStatus::draft;
$attributes['ngo']['slug'] = Str::slug($attributes['ngo']['name']);
$attributes['ngo']['user_id'] = $user->id;

$organization = $user->organization()->create($attributes['ngo']);
$organization = Organization::create($attributes['ngo']);

$organization->addMediaFromRequest('ngo.logo')->toMediaCollection('logo');
$organization->addMediaFromRequest('ngo.statute')->toMediaCollection('statute');
Expand Down

0 comments on commit 66b8b52

Please sign in to comment.