public function testStore() { //TODO: $post_category = new Posts_category(); $post_category->title = 'GGC Test Category!'; $post_category->description = 'This is a fake data blah blah blah'; $post_category->created_at = new DateTime(); $post_category->updated_at = new DateTime(); $post_category->save(); Posts_category::findOrFail($post_category->id); }
/** * Store a newly created category in storage. * * @return Response */ public function store() { //$validator = Validator::make($data = Input::all(), Posts_category::$rules); // // if ($validator->fails()) // { // return Redirect::back()->withErrors($validator)->withInput(); // } // Posts_category::create($data); $category = new Posts_category(); $category->title = Input::get('title'); $category->description = Input::get('description'); $category->save(); return Redirect::action('Posts_CategoryController@index'); }