public function removeContestantImage($id)
 {
     $cg = ContestantGallery::find($id);
     if ($cg != null && count($cg) > 0) {
         $contestant = Contestant::find($cg->contestant_id);
         // Delete a single file
         $admin_galley_path = config('app.contestant_image_galley');
         $front_galley_path = config('app.contestant_front_image_galley');
         $destinationPath = $admin_galley_path;
         $filename = $destinationPath . $cg->gallery_path;
         $filename2 = $front_galley_path . $cg->gallery_path;
         $cg->delete();
         File::delete($filename);
         File::delete($filename2);
         return view('contestants.listimages', compact('contestant'));
     }
 }
Exemplo n.º 2
0
                    </section>
                </div>
            </div>
            <!--state overview end-->
       <div class="row">
           <div class="col-lg-8">
               <div class="row">
                   <div class="col-lg-12">
                   <!--latest product info start-->
                   <section class="panel post-wrap pro-box">
                       <aside>
                           <div class="post-info">
                               <span class="arrow-pro right"></span>
                               <div class="panel-body">
                                   <?php 
$contest = \App\Contestant::orderBy('hints', 'Desc')->first();
?>
                                   <h1><strong>popular</strong> <br> Contestant of this week</h1>
                                   <div class="desk yellow">
                                       @if(count($contest)> 0 && $contest !=null)
                                       <h3>{{$contest->full_name}}</h3>
                                       <p>{{substr(strip_tags($contest->profile_note),0,60)}}..</p>
                                           @endif
                                   </div>
                               </div>
                           </div>
                       </aside>
                       <aside class="post-highlight yellow v-align">
                           <div class="panel-body text-center">
                               <div class="pro-thumb">
                                   @if(count($contest)> 0 && $contest !=null)