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::all();
        if ($categories->count() == 0) {
            Session::flash('info','You must some categories before attempting to create a post.');
            return redirect() ->route('category.create');
        }
        $user = Auth::user();
        $tag = Tag::all();
        return view('admin.posts.create')->with('user',$user)
                                         ->with('categories',Category::all())
                                         ->with('tags',$tag);
    }
public function create ( ) { $ categories = Category :: all ( ) ; if ( $ categories -> count ( ) == 0 ) { Session :: flash ( 'info' , 'You must some categories before attempting to create a post.' ) ; return redirect ( ) -> route ( 'category.create' ) ; } $ user = Auth :: user ( ) ; $ tag = Tag :: all ( ) ; return view ( 'admin.posts.create' ) -> with ( 'user' , $ user ) -> with ( 'categories' , Category :: all ( ) ) -> with ( 'tags' , $ tag ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .