app/Http/Controllers/Admin/VisiMisiController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $oldPict = $request->input('oldPict');
        $title = $request->input('title');
        $desc = $request->input('desc');
        $pict = $request->file('pict');
        if ($logo === null && $pict === null) {
            VisiMisi::find($id)->update([
                'visimisi_title' => $title,
                'visimisi_description' => $desc,
                'visimisi_picture' => $oldPict,
            ]);
            return redirect()->to("adminpages/visimisi");
        }
        VisiMisi::find($id)->update([
            'visimisi_title' => $title,
            'visimisi_description' => $desc,
            'visimisi_picture' => $pict,
        ]);
        return redirect()->to("adminpages/visimisi");
    }
public function update ( Request $ request , $ id ) { $ oldPict = $ request -> input ( 'oldPict' ) ; $ title = $ request -> input ( 'title' ) ; $ desc = $ request -> input ( 'desc' ) ; $ pict = $ request -> file ( 'pict' ) ; if ( $ logo === null && $ pict === null ) { VisiMisi :: find ( $ id ) -> update ( [ 'visimisi_title' => $ title , 'visimisi_description' => $ desc , 'visimisi_picture' => $ oldPict , ] ) ; return redirect ( ) -> to ( " adminpages/visimisi " ) ; } VisiMisi :: find ( $ id ) -> update ( [ 'visimisi_title' => $ title , 'visimisi_description' => $ desc , 'visimisi_picture' => $ pict , ] ) ; return redirect ( ) -> to ( " adminpages/visimisi " ) ; }
Update the specified resource in storage.
Update the specified resource in storage .