title: Error : undefined variable in laravel view
body: <p>I am getting this error: undefined variable. I read a lot of posts about it but, none of them helped with the problem i am facing. (<a href="https://stackoverflow.com/questions/18341009/why-i-get-undefined-variable-in-laravel-view">Why I get &quot;Undefined variable&quot; in Laravel view?</a> )</p>
  
  <p>This is Project_Controller :</p>
  
  <pre><code>class Project_Controller extends Controller
  {
  
  public function create()
  {
  $arrondissement = Arrondissements::pluck('arrondissement', 'id');
  
  return view::make('projets.create', compact('arrondissement'));
  }
  
  public function store(Request $request)
  {
  
      $validator = Validator::make($request-&gt;all(), [
          'intitule' =&gt; 'required|max:255',
          'code' =&gt; 'required|max:255',
          'dateDebut' =&gt; 'required|max:255',
          'dateFin' =&gt; 'required|max:255',
          'estimation' =&gt; 'required|max:255',
          'arrondissement' =&gt; $request-&gt;arrondissement,
      ]);     
  if ($validator-&gt;fails()) {
      return back()
          -&gt;withInput()
          -&gt;with(['arrondissement'=&gt;$arrondissement])
          -&gt;withErrors($validator);
  }               
      $projet = new Projet;
  
      $projet-&gt;intitule = $request-&gt;intitule;
      $projet-&gt;code = $request-&gt;code;
      $projet-&gt;dateDebut = $request-&gt;dateDebut;
      $projet-&gt;dateFin = $request-&gt;dateFin;
      $projet-&gt;estimation = $request-&gt;estimation;
      $projet-&gt;arrondissement = $request-&gt;arrondissement;
  
  
      $projet-&gt;save();
  
       return view('/submit', compact('arrondissement'));     
  }
  }
  </code></pre>
  
  <p>submit.blade.php :</p>
  
  <pre><code>    &lt;select name="arrondissement_id"&gt;
          @if (!empty($arrondissement))                   
              Whoops! Something went wrong                
          @else
              @foreach($arrondissement as $id =&gt; $arrondissement)
                  &lt;option value="{{$id}}"&gt;{{$arrondissement}}&lt;/option&gt;                    
              @endforeach
          @endif
  &lt;/select&gt;
  </code></pre>
  
  <p>and this is routes.php :</p>
  
  <pre><code>Auth::routes();
  
  Route::get('/home', 'HomeController@index');
  
  Route::get('/', function () {
     $projets = \App\Projet::all();
     return view('welcome', compact('projets'));
  });
  
  Route::get('/submit', function () {
  return view('submit');
  });
  
  Route::post('submit/projects', 'Project_Controller@store');
  </code></pre>
  
  <p>I can't see what's causing this error ??</p>
  
  <p>I am using 'arrondissement' as a foreign key of table 'arrondissements'</p>