app/Http/Controllers/PostsController.php
/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
Store a newly created resource in storage.
@return Response
Store a newly created resource in storage . @return Response
public function store(Request $request)
	{
		$input = Request::all();
		$post = new Post;
		$post->user_id = Auth::id();
		$post->title = $input['title'];
		$post->body = $input['body'];
		$post->publish = $input['publish'];
		$post->save();
		Session::flash('success', "New post: '$post->title' created!");
		return redirect("posts/$post->id");
	}
public function store ( Request $ request ) { $ input = Request :: all ( ) ; $ post = new Post ; $ post -> user_id = Auth :: id ( ) ; $ post -> title = $ input [ 'title' ] ; $ post -> body = $ input [ 'body' ] ; $ post -> publish = $ input [ 'publish' ] ; $ post -> save ( ) ; Session :: flash ( 'success' , " New post: ' $ post -> title ' created! " ) ; return redirect ( " posts/ $ post -> id " ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .