main
Last change
on this file since cf84baa was cf84baa, checked in by bube-ristovska <ristovska725@…>, 9 months ago |
Added querries half done
|
-
Property mode
set to
100644
|
File size:
657 bytes
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | namespace App\Http\Controllers;
|
---|
4 |
|
---|
5 | use Illuminate\Http\Request;
|
---|
6 | use Illuminate\Support\Facades\DB;
|
---|
7 |
|
---|
8 | class PeopleController extends Controller
|
---|
9 | {
|
---|
10 | function 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 | ]);
|
---|
28 | }
|
---|
29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.