app/Http/Controllers/anggotaadmController.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);
         }
        $anggotaadm= new \App\anggotaadm;
        $anggotaadm->no_anggota=$request->get('no_anggota');
        $anggotaadm->nama=$request->get('nama');
        $anggotaadm->jenis_kelamin=$request->get('jenis_kelamin');
        $anggotaadm->tempat_lhr=$request->get('tempat_lhr');
        $anggotaadm->tanggal_lhr=$request->get('tanggal_lhr');
        $anggotaadm->dusun=$request->get('dusun');
        $anggotaadm->desa=$request->get('desa');
        $anggotaadm->no_regristasi=$request->get('no_regristasi');
        $anggotaadm->wilayah=$request->get('wilayah');
        $anggotaadm->kelompok=$request->get('kelompok');
        $anggotaadm->save();
        return redirect('anggotaadms')->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 ) ; } $ anggotaadm = new \ App \ anggotaadm ; $ anggotaadm -> no_anggota = $ request -> get ( 'no_anggota' ) ; $ anggotaadm -> nama = $ request -> get ( 'nama' ) ; $ anggotaadm -> jenis_kelamin = $ request -> get ( 'jenis_kelamin' ) ; $ anggotaadm -> tempat_lhr = $ request -> get ( 'tempat_lhr' ) ; $ anggotaadm -> tanggal_lhr = $ request -> get ( 'tanggal_lhr' ) ; $ anggotaadm -> dusun = $ request -> get ( 'dusun' ) ; $ anggotaadm -> desa = $ request -> get ( 'desa' ) ; $ anggotaadm -> no_regristasi = $ request -> get ( 'no_regristasi' ) ; $ anggotaadm -> wilayah = $ request -> get ( 'wilayah' ) ; $ anggotaadm -> kelompok = $ request -> get ( 'kelompok' ) ; $ anggotaadm -> save ( ) ; return redirect ( 'anggotaadms' ) -> with ( 'success' , 'Information has been added' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .