예제 #1
0
 public function addToHistory(Media $media, $requester_id = null)
 {
     $request = History::create();
     $request->save(array('media_id' => $media->id, 'requester_id' => $requester_id, 'played_at' => (new \DateTime())->format('Y-m-d H:i:s')));
 }
예제 #2
0
파일: Media.php 프로젝트: xorinzor/Shoutzor
 public static function isRecentlyPlayed($id, $canRequestDateTime)
 {
     //Check if the media file has been recently played
     return History::where('media_id = :id AND played_at > :maxTime', ['id' => $id, 'maxTime' => $canRequestDateTime])->count() == 0 ? false : true;
 }