コード例 #1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $island_options = Island::lists('island', 'id');
     return View::make('provinces.create', compact('island_options'));
 }
コード例 #2
0
 public function port()
 {
     if (Input::hasFile('excel')) {
         $file = Input::file('excel');
         $r_xls = Excel::load($file->getRealPath(), true)->select(array('island'))->toArray();
         for ($i = 0; $i < count($r_xls); $i++) {
             $obj_island = new Island();
             $obj_island->island = $r_xls[$i]['island'];
             $obj_island->save();
         }
         return Redirect::route('islands.index');
     }
     return Redirect::route('islands.index');
 }