Loading app/Http/Controllers/AdherentController.php +20 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,24 @@ static function addUserToDive($ds_code, $us_id): View } function searchByName(Request $request){ $search = $request['searchbar']; $terms = explode(' ', $search); $results = array(); foreach($terms as $term){ $query = User::selectRaw('*') ->where('US_NAME', '=', $term) ->orwhere('US_FIRST_NAME', $term) ->get(); } } } routes/web.php +2 −0 Original line number Diff line number Diff line Loading @@ -123,3 +123,5 @@ Route::post('/modificationdives/members/{ds_code}/ajoutadherent/{us_id}', function($ds_code, $us_id){ return AdherentController::addUserToDive($ds_code, $us_id); }); Route::get('/modificationdives/members/{ds_code}/ajoutadherent/{level}', [AdherentController::class, 'searchByName']); No newline at end of file Loading
app/Http/Controllers/AdherentController.php +20 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,24 @@ static function addUserToDive($ds_code, $us_id): View } function searchByName(Request $request){ $search = $request['searchbar']; $terms = explode(' ', $search); $results = array(); foreach($terms as $term){ $query = User::selectRaw('*') ->where('US_NAME', '=', $term) ->orwhere('US_FIRST_NAME', $term) ->get(); } } }
routes/web.php +2 −0 Original line number Diff line number Diff line Loading @@ -123,3 +123,5 @@ Route::post('/modificationdives/members/{ds_code}/ajoutadherent/{us_id}', function($ds_code, $us_id){ return AdherentController::addUserToDive($ds_code, $us_id); }); Route::get('/modificationdives/members/{ds_code}/ajoutadherent/{level}', [AdherentController::class, 'searchByName']); No newline at end of file