Skip to content

Commit

Permalink
fix user role
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 20, 2023
1 parent 1d5a2e0 commit 843b260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Dashboard/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public function store(Request $request): RedirectResponse
[
'name' => $attributes['name'],
'created_by' => auth()->user()->id,
'role' => UserRole::MANAGER,
]
);

$user->role=UserRole::MANAGER;
$user->organization()
->associate(auth()->user()->organization)
->save();
Expand Down
4 changes: 3 additions & 1 deletion app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,14 @@ public function getEmbeddedVideosAttribute(): array
return $embeddedVideos;
}

public function scopeSearch(Builder $query, ?string $search): Builder {
public function scopeSearch(Builder $query, ?string $search): Builder
{
if (empty($search)) {
return $query;
}
$search = trim($search);
$search = strip_tags($search);

return $query->where('name', 'like', "%{$search}%");
}
}

0 comments on commit 843b260

Please sign in to comment.