app/Http/Controllers/PostsController.php
/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
Display a listing of the resource.
@return Response
Display a listing of the resource . @return Response
public function index()
	{
		$posts = Post::where('publish', Post::PUBLISHED)->orderBy('created_at', 'desc')->get();
		$data = [
			'posts' => $posts
		];
		return view('posts.index')->with($data);
	}
public function index ( ) { $ posts = Post :: where ( 'publish' , Post :: PUBLISHED ) -> orderBy ( 'created_at' , 'desc' ) -> get ( ) ; $ data = [ 'posts' => $ posts ] ; return view ( 'posts.index' ) -> with ( $ data ) ; }
Display a listing of the resource.
Display a listing of the resource .