Q:

Why I get [Laravel - Undefined variable: users (View..] if I tried to use POST and GET on the same view? 

I am trying to make a simple search form using laravel. 
the search page is supposed to be the same for results. 
but I can't make it work, and i'm not sure why
It works on a different Route but can't get it to work on the same route. 
Routes:
Route::get('searchuser',function(){
return view('searchuser');

 })->middleware('auth');

Route::post('searchuser', function(){
$q = Input::get('name');
$users = App\User::where('name_en','like',$q)->get();

return view('searchuser', ['users' => $users]);

 });

Blade:
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="searchuser">
                    {{ csrf_field() }}

                    <div class="form-group{{ $errors->has('name') ? '  has-error' : '' }}">
                        <label for="name" class="col-md-4 control-label">Name</label>

                        <div class="col-md-6">
                            <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" placeholder="Search.." required autofocus>

                            @if ($errors->has('name'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('name') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                Search
                            </button>

                        </div>
                    </div>
                </form>
                <div>
                    @foreach($users as $user)
                        {{$user->name_ar . ' <br />'}}
                    @endforeach
                </div>
            </div>

A:

you are using the same route and the same blade template
within this blade template you are trying to access a variable . 
which is defined in route POST and not defined the other GET
so your issue in your GET route not in your POST route;
to fix this , pass a default value to your GET route as follows :
Route::get('searchuser',function(){
return view('searchuser', ['users' => []]);

 })->middleware('auth');

OR/AND in your blade template do a little confirmation that the users variable isset
@if(isset($users))
    @foreach($users as $user)
        {{$user->name_ar . ' <br />'}}
    @endforeach
@endif

