Changeset cf84baa for app/Http/Controllers/PeopleController.php
- Timestamp:
- 02/08/24 16:15:01 (9 months ago)
- Branches:
- main
- Children:
- 6dec591
- Parents:
- 6b10b67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/PeopleController.php
r6b10b67 rcf84baa 4 4 5 5 use Illuminate\Http\Request; 6 use Illuminate\Support\Facades\DB; 6 7 7 8 class PeopleController extends Controller 8 9 { 9 10 function filter(){ 10 return view('filter'); 11 $peoples = DB::select('select * from people;'); 12 13 return view('filter', [ 14 'peoples' => $peoples 15 ]); 16 } 17 function filter_post(){ 18 $credentials = request()->validate([ 19 'embg' => 'required' 20 ]); 21 $embg = $credentials['embg']; 22 23 $peoples = DB::select('SELECT * FROM people WHERE embg ~ :embg', ['embg' => '^' . $embg]); 24 25 return view('filter', [ 26 'peoples' => $peoples 27 ]); 11 28 } 12 29 }
Note:
See TracChangeset
for help on using the changeset viewer.