diff --git a/skolehjem/app/Http/Controllers/UserController.php b/skolehjem/app/Http/Controllers/UserController.php index 6a0ce84..1754ecb 100644 --- a/skolehjem/app/Http/Controllers/UserController.php +++ b/skolehjem/app/Http/Controllers/UserController.php @@ -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); + } + } + } + + + } diff --git a/skolehjem/resources/views/admin/users/index.blade.php b/skolehjem/resources/views/admin/users/index.blade.php index ffbbfb6..ade0686 100644 --- a/skolehjem/resources/views/admin/users/index.blade.php +++ b/skolehjem/resources/views/admin/users/index.blade.php @@ -12,6 +12,17 @@ @section("content")
CreateOpret Bruger + + +
+ @csrf + + +
+ + + +