Lavet controller og et forsøg på GUI

This commit is contained in:
Neerholt 2020-07-01 11:46:29 +02:00
parent 32b7b3c925
commit 4e69768ae8
2 changed files with 27 additions and 0 deletions

View File

@ -253,4 +253,20 @@ class UserController extends Controller
{
return Response::detect("users.editpass");
}
public function liveSearch(Request $request){
if($request->ajax()){
$output="";
$results=DB::table('users')->where('name_first','LIKE','%'.$request->search."%")->get();
if(!$results){
echo "idk kev";
}else{
return Response($output);
}
}
}
}

View File

@ -12,6 +12,17 @@
@section("content")
<div class="row align-items-center">
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('users.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Bruger</a>
<form method="post" action="{{ route("users.store") }}">
@csrf
<input type="text" class="form-controller" id="search" name="search"></input>
<input type="submit" class="btn btn-dark text-white" value="Søg">
</form>
</div>
<table class="tbl mt-2">
<tr>