title: Error when using Spate Media Library: "BadMethodCallException Call to undefined method Illuminate\Foundation\Auth\User::addMediaFromRequest()"
body: <p>This is my User Model
   
  
  <pre><code>    namespace App;
      use Illuminate\Database\Eloquent\Model;
      use Spatie\MediaLibrary\HasMedia\HasMedia;
      use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
      use Spatie\MediaLibrary\File;
      use Illuminate\Notifications\Notifiable;
      use Illuminate\Contracts\Auth\MustVerifyEmail;
      use Illuminate\Foundation\Auth\User as Authenticatable;
  
      class User extends Authenticatable  implements HasMedia
  
      {
  
          use HasMediaTrait;
          use Notifiable;
  
          protected $fillable = [
              'name', 'email', 'password',
          ];
  
          protected $hidden = [
              'password', 'remember_token',
          ];
  
          protected $casts = [
              'email_verified_at' =&gt; 'datetime',
          ];
  
          public function role(){
              return $this-&gt;belongsToMany('App/Role');
          }
  
  
      }
  </code></pre>
  
  <p>This is my UserController </p>
  
  <p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use Illuminate\Foundation\Auth\User;
  use Illuminate\Http\Request;
  
  class UserController extends Controller
  {
  public function store(Request $request)
      {
          $user=new User;
          $user-&gt;name=($request['name']);
          $user-&gt;email=($request['email']);
          $password=bcrypt($request['password']);
          $user-&gt;password=$password;
  
          $user_photo=$request['photo'];
  
          $user-&gt;addMediaFromRequest('photo')-&gt;toMediaCollection('images');
  
  
          $user-&gt;save();
          return redirect('/admin');
  
      }
  }
  </code></pre>
  
  <p>I want to use <em>Spatie</em> Media Library and upload a photo for each user but I get this error related to <em>Spatie</em> Library:</p>
  
  <blockquote>
    <p>"Call to undefined method
    Illuminate\Foundation\Auth\User::addMediaFromRequest()".</p>
  </blockquote>
  
  <p>I have read some related posts but I don't understand how to fix this.
  Thank you.</p>