app/Http/Controllers/PostController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {
        $categories = Category::pluck('title','id');
        return view('posts.create')->with('categories', $categories);
    }
public function create ( ) { $ categories = Category :: pluck ( 'title' , 'id' ) ; return view ( 'posts.create' ) -> with ( 'categories' , $ categories ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
//$categories = Category::all('id','title');