app/Http/Controllers/BeritaController.php
/**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Berita  $berita
     * @return \Illuminate\Http\Response
     */
Show the form for editing the specified resource.
Show the form for editing the specified resource .
public function edit(Berita $berita){
      $id = $berita -> user_id;
      $user_id = Auth::id();
      if ( Auth::check() ) {
        if ( $id == $user_id ) {
          $countBerita = Berita::where('status', 2)
                      ->count();
          $countGaleri = Galeri::where('status', 2)
                      ->count();
          $countSantri = Santri::where('status', 2)
                      ->count();
          $countVideo = Video::where('status', 2)
                      ->count();
          return view('content.berita.mine.edit.0index',compact(
                                                                'berita',
                                                                'countBerita',
                                                                'countGaleri',
                                                                'countSantri',
                                                                'countVideo',
                                                                ));
        } else {
          return redirect()->route('mine.berita');
        }
      } else {
        return redirect()->route('login');
      }
    }
public function edit ( Berita $ berita ) { $ id = $ berita -> user_id ; $ user_id = Auth :: id ( ) ; if ( Auth :: check ( ) ) { if ( $ id == $ user_id ) { $ countBerita = Berita :: where ( 'status' , 2 ) -> count ( ) ; $ countGaleri = Galeri :: where ( 'status' , 2 ) -> count ( ) ; $ countSantri = Santri :: where ( 'status' , 2 ) -> count ( ) ; $ countVideo = Video :: where ( 'status' , 2 ) -> count ( ) ; return view ( 'content.berita.mine.edit.0index' , compact ( 'berita' , 'countBerita' , 'countGaleri' , 'countSantri' , 'countVideo' , ) ) ; } else { return redirect ( ) -> route ( 'mine.berita' ) ; } } else { return redirect ( ) -> route ( 'login' ) ; } }
Show the form for editing the specified resource.
Show the form for editing the specified resource .