Form submission and receipt on the same page (Laravel, php, blade)

I don’t understand why this doesn’t work. Help!!!
I need the entered value to be displayed in input after sending.


class TestController extends Controller {

public function form(Request $request) {
    if ($request->isMethod('get')) {
        echo 'REQUEST GET';                      
        return view('test');  
    if ($request->isMethod('post')) {
        $text = $request->input('text');
        echo 'REQUEST POST';
        echo '<br>';
        echo $text;  
        return view('test', ('text', $text));



<div class="container">
<div class="col-sm-offset-0 col-sm-12 {{ $CONTAINER_SETTINGS->OFFSET_MD }} {{ $CONTAINER_SETTINGS->WIDTH_MD }}">
    <div class="panel panel-default">
        <div id="header" class="panel-heading">
            <h4><i class="fa fa-btn fa-users"></i>Test</h4>

        <div class="panel-body">

            <form action="{{ url('test') }}" method="POST">
                {{ csrf_field() }}
                <input type="text" name="text" value="{{ $text }}">                                      
                <input type="text" name="text" >                                      
                <input type="submit">

web.php (routes)

Route::get('test', 'TestController@form');
Route::post('test', 'TestController@form');

enter image description here

enter image description here