$peoples ]); } function filter_post(){ $credentials = request()->validate([ 'embg' => 'required' ]); $embg = $credentials['embg']; $peoples = DB::select('SELECT * FROM people WHERE embg ~ :embg', ['embg' => '^' . $embg]); return view('filter', [ 'peoples' => $peoples ]); } }