title: Undefined property: App\Http\Controllers\ProfessionalsController::$user
body: <p>I want to add the user while adding a vendor, but it shows me error. I have created the object of class User. This is my code:</p>
  
  <pre><code>    &lt;?php
  
          namespace App\Http\Controllers;
  
          use Session;
          use App\Vendors;
          use App\User;
          use App\Category;
          use App\Location;
          use Illuminate\Http\Request;
  
          class VendorsController extends Controller
          { 
              public function store(Request $request)
              {
  
                   $this-&gt;validate($request, [
                      'name' =&gt; 'required|min:2|max:20',
                      'email' =&gt; 'required|email|unique:users,email'
                  ]);
  
                  $data = array(
                      'name' =&gt; $request-&gt;name,
                      'email' =&gt; $request-&gt;email,
                      'role' =&gt; 'Vendor'
                  );
  
                  $this-&gt;user-&gt;fill($data);
                  $this-&gt;user-&gt;save(); 
  
  $professional = Professional::create([
              'user_id' =&gt; $this-&gt;user,
              'contact_number' =&gt; $request-&gt;contact_number,
              'address' =&gt; $request-&gt;address,
              'about_us' =&gt; $request-&gt;about_us,
              'category_id' =&gt; $request-&gt;category_id
          ]);
  
                  return redirect()-&gt;back();
              }
          }
  </code></pre>
  
  <p>But I am getting this error:</p>
  
  <blockquote>
    <p>Undefined property: App\Http\Controllers\ProfessionalsController::$user</p>
  </blockquote>
  
  <p>Any help will be appreciated.</p>