title: Symfony\Component\Debug\Exception\FatalErrorException Trait not found in Laravel project
body: <p>I have create a new trait within my Laravel project, but it doesn't work.</p>
  <p>First I have created a folder called <code>App\Traits</code> and my trait filename is <code>UploadTrait.php</code>.</p>
  <p>Content:</p>
  <pre><code>&lt;?
  
  namespace App\Traits;
  
  use Illuminate\Support\Str;
  use Illuminate\Http\UploadedFile;
  use Illuminate\Support\Facades\Storage;
  
  trait UploadTrait
  {
      public function uploadOne(UploadedFile $uploadedFile, $folder = null, $disk = 'public', $filename = null)
      {
          $name = !is_null($filename) ? $filename : Str::random(25);
  
          $file = $uploadedFile-&gt;storeAs($folder, $name.'.'.$uploadedFile-&gt;getClientOriginalExtension(), $disk);
  
          return $file;
      }
  }
  </code></pre>
  <p>I try to use this trait in my controller as follows:</p>
  <pre><code>use App\Traits\UploadTrait;
  
  class ProfileController extends Controller
  {
      use UploadTrait;
  
      ...
  </code></pre>
  <p>I'm getting the error message:</p>
  <blockquote>
  <p>Symfony\Component\Debug\Exception\FatalErrorException Trait</p>
  <p>'App\Traits\UploadTrait' not found</p>
  </blockquote>
  <p>Can anyone help me to get this solve?</p>