Пример #1
0
 /**
  * Store a newly created position in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Position::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $position = Position::create($data);
     return Redirect::route('admin.positions.index')->with("successMessage", "Berhasil menyimpan {$position->nama} ");
 }
Пример #2
0
 function testCreate()
 {
     $x = 53;
     $y = 87;
     $pos = Position::create($x, $y);
     $this->assertEquals($x, $pos->x);
     $this->assertEquals($y, $pos->y);
     $this->assertEquals("({$x}, {$y})", (string) $pos);
 }