title: How to assign role while registration in laravel
body: <p>I'm working in laravel and using spatie laravel-permission. So i want to assign some role while registration and user can choose it via radio-button. I've tried some solutions from similar topic <a href="https://stackoverflow.com/questions/51617190/assigning-the-role-while-user-registration">Assigning the role while user registration</a>
  But it return an error. Code and error text you can find down. Sorry for stupid question and grammar mistakies-i'm newbie in programminпg and english isn't my native language.</p>
  <p>RegisterController (other code is default)</p>
  <pre><code>protected function create(array $data, Request $request )
  {
      return $user=User::create([
          'name' =&gt; $data['name'],
          'patro' =&gt; $data['patro'],
          'surname' =&gt; $data['surname'],
          'email' =&gt; $data['email'],
          'password' =&gt; Hash::make($data['password']),
                  ]);
      $user-&gt;assignRole($request-&gt;input('role'));return $user;
  }
  </code></pre>
  <p>register.blade.php
  (other code is default)</p>
  <pre><code>&lt;select&gt;
  &lt;option name=&quot;role&quot;&gt;Teacher&lt;/option&gt;
  &lt;option name=&quot;role&quot;&gt;Student&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  <p>error</p>
  <pre><code>Too few arguments to function App\Http\Controllers\Auth\RegisterController::create(), 1 passed in C:\OpenServer\domains\uni\vendor\laravel\ui\auth-backend\RegistersUsers.php on line 34 and exactly 2 expected
  </code></pre>