Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created June 12, 2019 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/51d2855281f69c34649097b001a1d7ce to your computer and use it in GitHub Desktop.
Save uno-de-piera/51d2855281f69c34649097b001a1d7ce to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use App\Models\Post;
class PostController extends Controller
{
public function index () {
$posts = Post::with('user')->paginate(config('constants.pagination.per_page');
return view('posts', compact('posts'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment