Ejemplo n.º 1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $snippet = Snippet::where('id', $id)->orWhere('slug', $id)->firstOrFail();
     //fetch all data associated with the snippet
     $data = Data::where('snippetId', $snippet->id)->accepted()->get();
     return view('snippets.show', compact('snippet', 'data'));
 }
Ejemplo n.º 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $course = Course::where('id', $id)->orWhere('slug', $id)->firstOrFail();
     $data = Data::where('courseId', $course->id)->where('extension', '!=', 'mp4')->accepted()->get();
     $videos = Data::where('courseId', $course->id)->Where('extension', 'mp4')->accepted()->get();
     $comments = Comment::where('courseId', $course->id)->get();
     return view('courses.show', compact('course', 'comments', 'data', 'videos'));
 }
Ejemplo n.º 3
0
 public function update($session, array $data)
 {
     $data = Data::where('session', '=', $session)->first();
     if (empty($data)) {
         return false;
     }
     $data->update($data);
     return false;
 }
Ejemplo n.º 4
0
 public function getRecords($fechaini, $fechafin, $fechap)
 {
     $referencia = Data::where($fechap, '>=', $fechaini)->where($fechap, '<=', $fechafin)->get()->take(2);
     if (count($referencia) == 0) {
         return false;
     } else {
         return $referencia;
     }
 }