app/Http/Controllers/SapiadmController.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)
    {
        if($request->hasfile('filename'))
         {
            $file = $request->file('filename');
            $nama=time().$file->getClientOriginalName();
            $file->move(public_path().'/images/', $nama);
         }
        $sapi= new \App\sapi;
        $sapi->id_anggota=$request->get('id_anggota'); 
        $sapi->tipe_sapi=$request->get('tipe_sapi');
        $sapi->jenis_kelamin=$request->get('jenis_kelamin');
        $sapi->fase=$request->get('fase');
        $sapi->eartag=$request->get('eartag');
        $sapi->status=$request->get('status');
        $sapi->kelompok=$request->get('kelompok');
        $sapi->wilayah=$request->get('wilayah');
        $sapi->save();
        return redirect('sapiadms/'.$sapi->id_anggota)->with('success', 'Information has been added');    }
public function store ( Request $ request ) { if ( $ request -> hasfile ( 'filename' ) ) { $ file = $ request -> file ( 'filename' ) ; $ nama = time ( ) . $ file -> getClientOriginalName ( ) ; $ file -> move ( public_path ( ) . '/images/' , $ nama ) ; } $ sapi = new \ App \ sapi ; $ sapi -> id_anggota = $ request -> get ( 'id_anggota' ) ; $ sapi -> tipe_sapi = $ request -> get ( 'tipe_sapi' ) ; $ sapi -> jenis_kelamin = $ request -> get ( 'jenis_kelamin' ) ; $ sapi -> fase = $ request -> get ( 'fase' ) ; $ sapi -> eartag = $ request -> get ( 'eartag' ) ; $ sapi -> status = $ request -> get ( 'status' ) ; $ sapi -> kelompok = $ request -> get ( 'kelompok' ) ; $ sapi -> wilayah = $ request -> get ( 'wilayah' ) ; $ sapi -> save ( ) ; return redirect ( 'sapiadms/' . $ sapi -> id_anggota ) -> with ( 'success' , 'Information has been added' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .