예제 #1
0
 public function storepost(PostFormRequest $request)
 {
     $post = new Post();
     $post->title = $request->get('title');
     $post->url = $request->get('url');
     $post->sub_id = Sub::where('name', $request->get('sub'))->first()->id;
     $post->user_id = \Auth::id();
     $post->save();
     return \Redirect::to('/');
 }
예제 #2
0
 public function frontpage()
 {
     return view('sub')->with('title', 'Front Page')->with('posts', Post::paginate(15));
 }