Skip to content

Commit

Permalink
ajustando la relacion del usuario con el socio
Browse files Browse the repository at this point in the history
  • Loading branch information
juankno committed Jun 17, 2022
1 parent 9f26c24 commit 344644b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function create()
{
$roles = Role::select('name', 'id');
$cities = City::select('name', 'id')->get();
$partners = Partner::select('name', 'id')->get();
$partners = Partner::select('PartnerName', 'id')->get();
return view('users.create', compact('roles', 'cities', 'partners'));
}

Expand Down Expand Up @@ -63,8 +63,8 @@ public function store(StoreUserRequest $request)
public function edit(User $user)
{
$user->load('partner', 'role', 'city.department.country');
$cities = City::all();
$partners = Partner::all();
$cities = City::select('name', 'id')->get();
$partners = Partner::select('PartnerName', 'id')->get();

return view('users.edit', compact('user', 'cities', 'partners'));
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/users/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<label>{{ __('Company') }}</label>
<select type="text" class="form-control" name="partner_id" style="background-color: #2b3553;" title="{{ __('City') }}">
@foreach ($partners as $partner)
<option value="{{ $partner->id }}">{{ $partner->name }}</option>
<option value="{{ $partner->id }}">{{ $partner->PartnerName }}</option>
@endforeach
</select>
@include('alerts.feedback', ['field' => 'partner_id'])
Expand Down
2 changes: 1 addition & 1 deletion resources/views/users/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<label>{{ __('Company') }}</label>
<select class="form-control" name="partner_id" style="background-color: #2b3553;" title="{{ __('Partner') }}">
@foreach ($partners as $partner)
<option value="{{ $partner->id }}" {{ $partner->id == $user->partner_id ? 'selected' : ''}}>{{ $partner->name }}</option>
<option value="{{ $partner->id }}" {{ $partner->id == $user->partner_id ? 'selected' : ''}}>{{ $partner->PartnerName }}</option>
@endforeach
</select>
@include('alerts.feedback', ['field' => 'partner_id'])
Expand Down
2 changes: 1 addition & 1 deletion resources/views/users/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<td>{{ $user->UserName }}</td>
<td>{{ $user->UserContactNumber }}</td>
<td>{{ optional($user->role)->name }}</td>
<td>{{ optional($user->partner)->name }}</td>
<td>{{ optional($user->partner)->PartnerName }}</td>
<td>
@if ($user->UserStatus == 1)
<span class="badge badge-success">Activo</span>
Expand Down

0 comments on commit 344644b

Please sign in to comment.