title: Undefined offset: 1 in laravel 8
body: <p>Im currently learning to do sign in and sign up in laravel8 by referring some tutorials. But after sign up im getting this <strong>Undefined offset: 1</strong> message.</p>
  <p>Error line that showing is</p>
  <pre><code>$iteratee = trim($matches[1]);
  </code></pre>
  <p>This is my route file(web.php)</p>
  <pre><code>use Illuminate\Support\Facades\Route;
  use App\Http\Controllers\UserController;
  
  
  Route::get('/signup',[
      'uses' =&gt;'App\Http\Controllers\UserController@getSignup',
      'as'=&gt;'user.signup'
     
  ]);
  
  Route::post('/signup',[
      'uses' =&gt;'App\Http\Controllers\UserController@getSignup',
      'as'=&gt;'user.signup'
     
  ]);
  </code></pre>
  <p>And this is the signup page register part</p>
  <pre><code>  &lt;header class=&quot;masthead&quot;  &gt;
              &lt;div class=&quot;container&quot;&gt;
                  &lt;div class=&quot;masthead-subheading&quot;&gt;&lt;/div&gt;
                  &lt;div class=&quot;masthead-heading text-uppercase&quot;&gt;&lt;/div&gt;
                  &lt;div class=&quot;container&quot;&gt;
  
                      &lt;div class=&quot;card bg-light&quot;&gt;
                          &lt;article class=&quot;card-body mx-auto&quot; style=&quot;max-width: 400px;&quot;&gt;
                              &lt;h4 class=&quot;card-title mt-3 text-center&quot;&gt;Create Account&lt;/h4&gt;
                           
  
                              &lt;p class=&quot;text-center&quot;&gt;Get started with your free account&lt;/p&gt;
                              @if(count($errors) &gt; 0)
                              &lt;div class=&quot;alert alert-danger&quot;&gt;
  
                              @foreach($errors-&gt;all()as $error)
                              &lt;p&gt;{{$error}}&lt;/p&gt;
                              @endforeach
                              &lt;/div&gt;
                              @endif
                            
                              &lt;form  action=&quot;{{ route('user.signup')}}&quot;&gt;
                               
                          
                              &lt;div class=&quot;form-group input-group&quot;&gt;
                                  &lt;div class=&quot;input-group-prepend&quot;&gt;
                                      &lt;span class=&quot;input-group-text&quot;&gt; &lt;i class=&quot;fa fa-envelope&quot;&gt;&lt;/i&gt; &lt;/span&gt;
                                   &lt;/div&gt;
                                  &lt;input name=&quot;email&quot; class=&quot;form-control&quot; placeholder=&quot;Email address&quot; type=&quot;email&quot;&gt;
                              &lt;/div&gt; 
                            
  
                              &lt;div class=&quot;form-group input-group&quot;&gt;
                                  &lt;div class=&quot;input-group-prepend&quot;&gt;
                                      &lt;span class=&quot;input-group-text&quot;&gt; &lt;i class=&quot;fa fa-lock&quot;&gt;&lt;/i&gt; &lt;/span&gt;
                                  &lt;/div&gt;
                                  &lt;input name=&quot;password&quot; placeholder=&quot;Create password&quot; type=&quot;password&quot;&gt;
                              &lt;/div&gt;
                                                            
                              &lt;div class=&quot;form-group&quot;&gt;
                                  &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary btn-block&quot;&gt; Create Account  &lt;/button&gt;
                                  {{csrf_field()}}
                              &lt;/div&gt; &lt;!-- form-group// --&gt;      
                              &lt;p class=&quot;text-center&quot;&gt;Have an account? &lt;a href=&quot;login.html&quot;&gt;Log In&lt;/a&gt; &lt;/p&gt;                                                                 
                          &lt;/form&gt;
                          &lt;/article&gt;
                          &lt;/div&gt; &lt;!-- card.// --&gt;
                          
                          &lt;/div&gt; 
                          &lt;!--container end.//--&gt;
                            
          &lt;/header&gt;
  </code></pre>
  <p>UserController</p>
  <pre><code>class UserController extends Controller
  {
      public function getSignup()
      {
           return view('user.signup');
   
      }
      public function postSignup(Request $request)
      {
           $this-&gt;validate($request,[
   
               'email'=&gt; 'email|required|unique:users',
               'password'=&gt;'required|min:4' 
   
           ]);
   
   
           $user= new User([
   
              'email'=&gt;$request-&gt; input('email'),
              'password'=&gt; bcrypt($request-&gt; input('password'))
   
           ]);
   
           $user--&gt;save();
           return redirect()-&gt;route('shop.index');
   
       }
   
  }
  </code></pre>
  <p>Please teach me a way to solve this.Thank you</p>