app/Http/Controllers/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('active',1)->orderBy('id','desc')->take(10)->get();
        return view('layout.index', compact('posts'));
    }
public function index ( ) { $ posts = Post :: where ( 'active' , 1 ) -> orderBy ( 'id' , 'desc' ) -> take ( 10 ) -> get ( ) ; return view ( 'layout.index' , compact ( 'posts' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .