/**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make(Input::all(), Newtypes::$rules);
     var_dump(Input::all());
     // process the login
     if ($validator->fails()) {
         return Redirect::to('newtypes/create')->withErrors($validator)->withInput(Input::except('password'));
     } else {
         $newtypes = new Newtypes();
         $newtypes->name = Input::get('name');
         $newtypes->save();
         Logfile::addData('thêm', 'Loại tin', $newtypes->id, $newtypes->name);
         // redirect
         Session::flash('message', 'Thêm newtypes mới thành công!');
         return Redirect::to('newtypes');
     }
 }