app/Http/Controllers/Dashboard/PostController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store()
    {
        $post = new post;
        $post->title = request()->input('title');
        $post->description = request()->input('description');
        $post->user_id =  auth()->id();
        $post->save();
        return redirect(route('posts.index'));
    }
public function store ( ) { $ post = new post ; $ post -> title = request ( ) -> input ( 'title' ) ; $ post -> description = request ( ) -> input ( 'description' ) ; $ post -> user_id = auth ( ) -> id ( ) ; $ post -> save ( ) ; return redirect ( route ( 'posts.index' ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .