source: app/Http/Controllers/PeopleController.php@ cf84baa

main
Last change on this file since cf84baa was cf84baa, checked in by bube-ristovska <ristovska725@…>, 11 months ago

Added querries half done

  • Property mode set to 100644
File size: 657 bytes
RevLine 
[75151c6]1<?php
2
3namespace App\Http\Controllers;
4
5use Illuminate\Http\Request;
[cf84baa]6use Illuminate\Support\Facades\DB;
[75151c6]7
8class PeopleController extends Controller
9{
10 function filter(){
[cf84baa]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 ]);
[75151c6]28 }
29}
Note: See TracBrowser for help on using the repository browser.