Skip to content

Commit

Permalink
fix register logic and user show tabel
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Feb 14, 2024
1 parent 1124fa2 commit 609bf8e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/Enums/OrganizationStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum OrganizationStatus: string
use Comparable;
use HasLabel;

case draft = 'draft';
case pending = 'pending';
case approved = 'approved';
case rejected = 'rejected';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace App\Filament\Resources\UserResource\RelationManagers;

use Filament\Forms\Components\TextInput;
use Filament\Pages\Actions\ViewAction;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
Expand Down Expand Up @@ -64,7 +63,7 @@ public static function table(Table $table): Table
->headerActions([
])
->actions([
ViewAction::make(),
Tables\Actions\ViewAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function store(RegistrationRequest $request): RedirectResponse
event(new Registered($user));

if ($user->hasRole(UserRole::ADMIN)) {
$attributes['ngo']['status'] = OrganizationStatus::draft;
$attributes['ngo']['status'] = OrganizationStatus::pending;
$attributes['ngo']['slug'] = Str::slug($attributes['ngo']['name']);

$organization = Organization::create($attributes['ngo']);
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function donations(): HasMany

public function projects(): HasMany
{
return $this->organization->projects()->with('organization');
return $this->organization?->projects()->with('organization');
}

public function canAccessFilament(): bool
Expand Down

0 comments on commit 609bf8e

Please sign in to comment.