app/Http/Controllers/commentaire.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(Request $request)
    {
        $commentaire = comme::create([
            'annonce_id'=> 1,
            'typecomment_id'=>$request->input('type'),
            'dateComment'=> now(),
            'content_com'=> $request->input('content_com'),
            'user_id'=>Auth()->user()->id,
            'statut_com'=>0,
        ]);
        return \Redirect::back();
    }
public function store ( Request $ request ) { $ commentaire = comme :: create ( [ 'annonce_id' => 1 , 'typecomment_id' => $ request -> input ( 'type' ) , 'dateComment' => now ( ) , 'content_com' => $ request -> input ( 'content_com' ) , 'user_id' => Auth ( ) -> user ( ) -> id , 'statut_com' => 0 , ] ) ; return \ Redirect :: back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// 'user_id'=>Auth->user()->id, // return redirect()->route('annonces.show', $annonce->id);