title: Error "Call to undefined method" when attempting hasFile() function
body: <p>I'm taking my first steps in Laravel 5.8. Starting from the Laracast tutorials, I'm using the standard Laravel app project and user authentication out of the box, so nothing fancy here. After a user logs on, he can access a dashboard and change some of his own user information which is stored in the Users table in MySQL. </p>
  
  <p>Everything works fine except for a file upload via the variable <code>mediator_cert</code>. When checking whether the user has added a file to be uploaded (i.e. <code>mediator_cert</code> should not be null), I get the error <code>Call to undefined method konsens24\User::hasFile()</code>, i.e. it seems that Laravel is expecting the method to be defined in the user.php file which is not contained in there (I would be surprised if it had to be explicitly included in there?). </p>
  
  <p>I've looked at various problem descriptions online, particularly in terms of what to include via the "use" command, but unfortunately to no avail.</p>
  
  <p>User.php file:</p>
  
  <pre><code>&lt;?php
  
  namespace konsens24;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Contracts\Auth\MustVerifyEmail;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  
  class User extends Authenticatable
  {
      use Notifiable;
  
  
      protected $fillable = [
      'first_name', 'last_name','name', 'email', 'password', 'street', 'postal', 'city', 'state', 'country', 'phone', 'mediator', 'mediator_cert'
      ];
  
  
  protected $hidden = [
      'password', 'remember_token',
  ];
  
  
  protected $casts = [
      'email_verified_at' =&gt; 'datetime',
  ];
  
  public function projects()
  {
    return $this-&gt;hasMany(Project::class, 'owner_id');
  }
  }
  </code></pre>
  
  <p>ProfileController.php file:</p>
  
  <pre><code>&lt;?php
  
  namespace konsens24\Http\Controllers;
  
  use Illuminate\Http\Request;
  use konsens24\User;
  
  
  class ProfileController extends Controller
  {
    public function __construct()
    {
      $this-&gt;middleware('auth');
  
    }
  
  
    public function show(User $user)
    {
  
        $user = auth()-&gt;user();
  
        return view('profile.edit', compact('user'));
    }
  
  
    public function update(User $user)
    {
  
      abort_if($user-&gt;id !== auth()-&gt;id(), 403);
  
      //Handle File Upload
        if($user-&gt;hasFile('mediator_cert')){
         //Get filename with the extension
         $filenameWithExt = $user-&gt;file('mediator_cert')-&gt;getClientOriginalName();
  
          //Get just filename
          $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
  
          //Get just ext
          $extension = $user-&gt;file('mediator_cert')-&gt;guessClientExtension();
          //FileName to store
          $fileNameToStore = $filename.'_'.time().'.'.$extension;
  
          //Upload Image
           $path = $user-&gt;file('mediator_cert')-&gt;storeAs('public/certs/', $fileNameToStore);
        }
  
      $user-&gt;update($this-&gt;validateUser());
  
      return view('profile.edit', compact('user'));
  
    }
  
  
    protected function validateUser()
    {
      return request()-&gt;validate([
        'street' =&gt; ['required', 'min:3', 'max:30'],
        'postal' =&gt; ['required', 'min:3', 'max:7'],
        'city' =&gt; ['required', 'min:3', 'max:30'],
        'state' =&gt; ['max:30'],
        'country' =&gt; ['required', 'min:1', 'max:30'],
        'phone' =&gt; ['required', 'min:9', 'max:30'],
        'mediator' =&gt; ['boolean'],
        'mediator_cert' =&gt; ['nullable']
      ]);
    }
  }
  </code></pre>
  
  <p>edit.blade.php file:</p>
  
  <pre><code>@extends('layouts.app')
  
  @section('content')
    &lt;h1 class="title"&gt;Profile Settings&lt;/h1&gt;
  
    &lt;p&gt;Please complete your profile by adding the following information:&lt;/p&gt;
  
    &lt;form method="post" action="/profile/{{ $user-&gt;id }}" enctype="multipart/form-data"&gt;
      @method('PATCH')
      @csrf
  
      ...
  
      &lt;div class="field"&gt;
        &lt;label class="label" for="mediator_cert"&gt;Certification (upload as PDF, Word Document DOCX, or JPG)&lt;/label&gt;
        &lt;div class="control"&gt;
          &lt;input type="file" name="mediator_cert"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;br&gt;
  
      &lt;div class="field"&gt;
          &lt;div class="control"&gt;
          &lt;button type="submit" class="button"&gt;Update Profile&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      @include('errors')
  
    &lt;/form&gt;
  
  
  @endsection
  </code></pre>
  
  <p>The expected result should be that the hasFile() method can be executed.
  Thanks a lot for helping me out on this one!</p>