title: Laravel 5 Class not found error in middleware
body: <p><img src="https://i.stack.imgur.com/llGLt.png" alt="enter image description here">I have created a middleware in laravel 5 called IpHitsCounter which uses a model called DeviceInfo which is inside App\Models\FrontEnd </p>
  
  <pre><code>&lt;?php namespace App\Http\Middleware\FrontEnd;
  
      use Closure;
      use Request;
      use BrowserDetect;
      use App\Models\FrontEnd\DeviceInfo;
      use DB;
  
      class IpHitsCounter {
  
          /**
           * Handle an incoming request.
           *
           * @param  \Illuminate\Http\Request  $request
           * @param  \Closure  $next
           * @return mixed
           */
          public function handle($request, Closure $next)
          {
           DeviceInfo::create(['devices'=&gt;$agentDevice,'deviceFamily'=&gt;$deviceFamily]);
          }
  </code></pre>
  
  <p>My Code for Model is:</p>
  
  <pre><code>&lt;?php namespace App\Models\FrontEnd;
  
  use Illuminate\Database\Eloquent\Model;
  
  class DeviceInfo extends Model {
  
     /**
       * The database table used by the model.
       *
       * @var string
       */
      protected $table = 'client_device_infos';
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = ['devices', 'deviceFamily'];
  
  
  
  }
  </code></pre>
  
  <p>When doing so I am getting the following error: <code>Class 'App\Models\FrontEnd\DeviceInfo' not found</code></p>
  
  <p>although the class exists still I am getting the error.</p>