public function getEdit($id)
 {
     $types = array();
     foreach (CarType::all() as $type) {
         $types[$type->id] = $type->name;
     }
     $transmission = array(1 => 'Automatic', 0 => 'Manual');
     $aircon = array(1 => 'Yes', 0 => 'No');
     $seats = array(2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9);
     $doors = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6);
     return View::make('cars.edit')->with('car', Car::find($id))->with('car_types', $types)->with('transmission', $transmission)->with('aircon', $aircon)->with('seats', $seats)->with('doors', $doors);
 }
 public function __construct()
 {
     $this->beforeFilter(function () {
         View::share('typenav', CarType::all());
     });
 }
 public function getIndex()
 {
     return View::make('car_types.index')->with('car_types', CarType::all());
 }