Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anders 2020-08-26 10:49:19 +02:00
commit 7b2d6fcf60
3 changed files with 10 additions and 2 deletions

View File

@ -76,6 +76,7 @@ class UserController extends Controller
"phone" => "required|max:8|min:8", "phone" => "required|max:8|min:8",
]); ]);
$allUsersEmail = User::query()->where('email', '=', $request->email)->get(); $allUsersEmail = User::query()->where('email', '=', $request->email)->get();
$allUsersPhone = User::query()->where('phone', '=', $request->phone)->get(); $allUsersPhone = User::query()->where('phone', '=', $request->phone)->get();
@ -140,6 +141,12 @@ class UserController extends Controller
{ {
$user = User::find($id); $user = User::find($id);
if($request->file("resource")) {
$user->resource_id = ResourceController::store($request)->id;
}
$user->save();
$allUsersEmail = User::query()->where('email', '=', $request->email)->where('id', '!=', $id)->get(); $allUsersEmail = User::query()->where('email', '=', $request->email)->where('id', '!=', $id)->get();
$allUsersPhone = User::query()->where('phone', '=', $request->phone)->where('id', '!=', $id)->get(); $allUsersPhone = User::query()->where('phone', '=', $request->phone)->where('id', '!=', $id)->get();

View File

@ -11,7 +11,7 @@
@section("content") @section("content")
<h1>Rediger Bruger:</h1> <h1>Rediger Bruger:</h1>
<form method="post" action="{{ route("users.update", ['user' => $user]) }}" onsubmit="return checkInputs()"> <form method="post" action="{{ route("users.update", ['user' => $user]) }}" onsubmit="return checkInputs()" enctype="multipart/form-data">
@csrf @csrf
@method("put") @method("put")
<label for="name_first">Fornavn:</label> <label for="name_first">Fornavn:</label>
@ -57,6 +57,8 @@
@endforeach @endforeach
@endif @endif
</select> </select>
<label for="fileuploade">Skift brugerens profile billede:</label>
<input id="fileuploade" type="file" name="resource" accept="image/*">
<input type="submit" class="btn btn-dark text-white" value="Rediger"> <input type="submit" class="btn btn-dark text-white" value="Rediger">
</form> </form>
@endsection @endsection

View File

@ -29,7 +29,6 @@
text-align: center; text-align: center;
border-radius: 6px; border-radius: 6px;
padding: 5px 0; padding: 5px 0;
/* Position the tooltip */
position: absolute; position: absolute;
z-index: 10; z-index: 10;
top: -5px; top: -5px;