app/Http/Controllers/User/TabunganController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {
        $santri = Santri::whereCode(request('code'))->first();
        if ($santri->user_id != userId()) {
            return Redirect::route('dashboard');
        }
        return view('main.tabungan.take-save', [
            'santri'       => $santri,
            'plus'      => Tabungan::whereSantri_id($santri->id)->whereStatus(1)->sum('nominal'),
            'minus'     => Tabungan::wheresantri_id($santri->id)->whereStatus(0)->sum('nominal'),
        ]);
    }
public function create ( ) { $ santri = Santri :: whereCode ( request ( 'code' ) ) -> first ( ) ; if ( $ santri -> user_id != userId ( ) ) { return Redirect :: route ( 'dashboard' ) ; } return view ( 'main.tabungan.take-save' , [ 'santri' => $ santri , 'plus' => Tabungan :: whereSantri_id ( $ santri -> id ) -> whereStatus ( 1 ) -> sum ( 'nominal' ) , 'minus' => Tabungan :: wheresantri_id ( $ santri -> id ) -> whereStatus ( 0 ) -> sum ( 'nominal' ) , ] ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
# Chek apakah santri dari admin