Exemplo n.º 1
0
 public static function collection($workingAreaId)
 {
     $leads = Lead::with('gcf')->where('working_area_id', $workingAreaId)->orderBy('updated_at', 'created_at')->get();
     return $leads->each(function ($item, $key) {
         $play = Play::with('gcf')->find($item->play_id);
         $item->play_name = createPlayName($play->gcf->res_litho, $play->gcf->res_formation, $play->gcf->res_formation_level, $play->gcf->res_age_period, $play->gcf->res_age_epoch, $play->gcf->res_dep_env, $play->gcf->trp_type);
     });
 }
Exemplo n.º 2
0
 /**
  * AJAX call, delete play_id yang sesuai.
  *
  * return string
  */
 public function destroy()
 {
     $play = Play::findOrFail(request('id'));
     if (Gate::denies('access-play', $play)) {
         abort(404);
     }
     DB::transaction(function () use($play) {
         $play->delete_reason = request('reason');
         $play->timestamps = false;
         $play->save();
         $play->delete();
     });
     session()->flash('success', 'Play successfully deleted, thank you!');
     return 'destroyed';
 }
Exemplo n.º 3
0
 public function listing()
 {
     // $plays=Play::paginate(10);
     //return view('articles.listing')->withArticles($articles);
     return view('plays.listing')->withPlays(Play::take('all')->orderBy('created_at', 'desc')->paginate(5));
 }
Exemplo n.º 4
0
 /**
  * Mencari detail untuk satu Play beserta data GCF.
  *
  * @param  int @playId
  * @return \Illuminate\Support\Collection
  */
 public static function detail($playId)
 {
     return Play::with('gcf')->findOrFail($playId);
 }