diff --git a/app/Console/Commands/Import/ImportCommand.php b/app/Console/Commands/Import/ImportCommand.php index abd384ef..077d0842 100644 --- a/app/Console/Commands/Import/ImportCommand.php +++ b/app/Console/Commands/Import/ImportCommand.php @@ -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'), diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index eb1cd964..456e6817 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -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; @@ -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');