app/Http/Controllers/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()
    {
        $campos = request()->validate([
            "titulo" => "required",
            "categoria" => "required",
            "contenido" => "required",
            "fecha_de_creacion" => "required|date"
        ]);
        Post::create($campos);
        return $this->index();
    }
public function store ( ) { $ campos = request ( ) -> validate ( [ " titulo " => " required " , " categoria " => " required " , " contenido " => " required " , " fecha_de_creacion " => " required|date " ] ) ; Post :: create ( $ campos ) ; return $ this -> index ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .