app/Http/Controllers/Admin/PostController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $posts = Post::where('user_id', Auth::user()->id)->paginate(12);
        return view('admin.posts.index', ['posts' => $posts]);
    }
public function index ( ) { $ posts = Post :: where ( 'user_id' , Auth :: user ( ) -> id ) -> paginate ( 12 ) ; return view ( 'admin.posts.index' , [ 'posts' => $ posts ] ) ; }
Display a listing of the resource.
Display a listing of the resource .
// $posts = Post::paginate(16); // Facciamo in modo che vengano visualizzati in pagina solo i posts dell'utente connesso