title: Namespace declaration statement has to be the very first statement in the script in Laravel-5
body: <p>In laravel I make the TrainingRequest File for validation using</p>
  
  <pre><code>php artisan make:request TrainingRequest
  
  FatalErrorException in TrainingRequest.php line 3: 
  
  Namespace declaration statement has to be the very first   statement  in the script 
  </code></pre>
  
  <p>And I make the validation in that created file as below:-</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Requests; &lt;!--This is line number 3 --&gt;
  
  use App\Http\Requests\Request;
  
  class TrainingRequest extends Request
  {
      /**
       * Determine if the user is authorized to make this request.
       *
       * @return bool
       */
      public function authorize()
      {
          return true;
      }
  
      /**
       * Get the validation rules that apply to the request.
       *
       * @return array
       */
      public function rules()
      {
  
               return [
                  'topic' =&gt;  'required|min:3',
                  'sub_topic'  =&gt;  'required',
                  'category'  =&gt;  'required', 
              ];
  
      }
  }
  </code></pre>
  
  <p>After I make the validation using that class by making object in controller and my controller is as below:-</p>
  
  <pre><code>&lt;?php
  
   namespace App\Http\Controllers;
  
   use App\Training;
   use App\User;
   use App\Http\Requests;
   use App\Http\Controllers\Controller;
   use App\Http\Requests\TrainingRequest;
   use Request;
  
  
   class TrainingController extends Controller
  {
  public function store(TrainingRequest $request)
  {
      //store Training
  
      //$training=Request::all();
      Training::create($request-&gt;all());
      return redirect('training');
  }
  </code></pre>