This commit is contained in:
frederikpyt 2020-06-30 14:09:19 +02:00
commit c505738592
5 changed files with 66 additions and 3 deletions

View File

@ -38,6 +38,32 @@ class UserController extends Controller
return Response::detect("users.index", [ "users" => $users ]); return Response::detect("users.index", [ "users" => $users ]);
} }
/**
* Display a listing of the resource.
*
* @param Request $request
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function account(Request $request)
{
$users = User::query()->paginate($request->query("page", 20));
return Response::detect("users.account", [ "users" => $users ]);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function accountedit(Request $request)
{
$users = User::query()->paginate($request->query("page", 20));
return Response::detect("users.edit", [ "users" => $users ]);
}
/** /**
* Show the form for creating a new resource. * Show the form for creating a new resource.
* *
@ -236,6 +262,4 @@ class UserController extends Controller
return redirect()->route('users.login'); return redirect()->route('users.login');
} }
} }

View File

@ -45,7 +45,7 @@
<img src="{{URL::asset('/images/icons/Vagttelefon-hvid.svg')}}" alt="Vagttelefon"> <img src="{{URL::asset('/images/icons/Vagttelefon-hvid.svg')}}" alt="Vagttelefon">
Vagttelefon Vagttelefon
</a> </a>
<a href="#"> <a href="{{ route("users.account") }}">
<img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto"> <img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto">
Konto Konto
</a> </a>

View File

@ -0,0 +1,17 @@
@extends("app.layout.base")
@section("title")
Account
@endsection
@section("content")
<main>
<h1 class="text-center sde-blue mt-0">Konto</h1>
<form action="">
<h4 class="mt-0">Navn: {{ Auth::user()->name_first . " " . Auth::user()->name_last }}</h4>
<h4 class="mt-0">Email: {{ Auth::user()->email }}</h4>
<h4 class="mt-0">Telefon Nr.: {{ Auth::user()->phone }}</h4>
<a class="btn text-center btn-sde-blue mt-1" href="{{ route("users.accountedit") }}">Rediger Oplysninger</a>
</form>
</main>
@endsection

View File

@ -0,0 +1,20 @@
@extends("app.layout.base")
@section("title")
Account
@endsection
@section("content")
<main>
<h1 class="text-center sde-blue mt-0">Konto</h1>
<form action="">
<span>Navn:</span>
<input type="text" name="name" id="name" value="{{ Auth::user()->name_first . " " . Auth::user()->name_last }}" disabled>
<span>Email:</span>
<input type="email" name="email" id="email" value="{{ Auth::user()->email }}" required>
<span>Telefon Nr.:</span>
<input type="text" name="phone" id="phone" value="{{ Auth::user()->phone }}" required>
<button type="submit" class="btn text-center btn-sde-blue mt-1" href="tel:+4540886515">Rediger</button>
</form>
</main>
@endsection

View File

@ -25,6 +25,8 @@ Route::post("/login", "UserController@login")->name("users.login");
Route::get("/logout", "UserController@logout")->name("users.logout"); Route::get("/logout", "UserController@logout")->name("users.logout");
Route::get("/forgot", "UserController@showForgot")->name("users.show-forgot"); Route::get("/forgot", "UserController@showForgot")->name("users.show-forgot");
Route::post("/forgot", "UserController@forgot")->name("users.forgot"); Route::post("/forgot", "UserController@forgot")->name("users.forgot");
Route::get("/account", "UserController@account")->name("users.account");
Route::get("/account/edit", "UserController@accountedit")->name("users.accountedit");
Route::get("phones", "PhoneController@index")->name("phones.index"); Route::get("phones", "PhoneController@index")->name("phones.index");