Esempio n. 1
0
 public function getIndex()
 {
     $mp3s = MP3::remember(120)->latest()->published()->take(3)->get();
     $mp4s = MP4::remember(120)->latest()->take(3)->get();
     $data = ['mp3s', 'mp4s'];
     return View::make('home', compact($data));
 }
 public function get_mp4()
 {
     $mp4 = MP4::remember(120)->latest()->paginate(30);
     $mp4_count = MP3::remember(120)->count();
     $title = 'Administrayon Videyo (' . $mp4_count . ')';
     return View::make('admin.mp4.index')->withTitle($title)->withMp4s($mp4)->withmp4Count($mp4_count);
 }
Esempio n. 3
0
 private function searchMP4($query)
 {
     $mp4results = MP4::search($query)->orderBy('play', 'desc')->orderBy('download', 'desc')->take(20)->get(['id', 'views', 'name', 'download']);
     $mp4results->each(function ($mp4) {
         $mp4->icon = 'video-camera';
         $mp4->type = 'mp4';
     });
     return $mp4results;
 }
 public function searchMP4($query)
 {
     $mp4s = MP4::where('name', 'like', '%' . $query . '%')->paginate(20, ['id', 'name', 'download', 'image']);
     $mp4s->each(function ($mp4) {
         $mp4->icon = 'facetime-video';
         $mp4->type = 'mp4';
     });
     $data = ['mp4s' => $mp4s, 'query' => $query, 'title' => $query];
     return View::make('search.mp4')->with($data);
 }
Esempio n. 5
0
 private function getRSS($type)
 {
     $key = $type . '_rss_feed_';
     if (Cache::has($key)) {
         return Cache::get($key);
     }
     if ($type == 'mp3') {
         $objs = MP3::published()->latest()->take(10)->get();
         $hash = 'Mizik';
     } elseif ($type == 'mp4') {
         $objs = MP4::latest()->take(10)->get();
         $hash = 'Videyo';
     }
     $rss = $this->buildRssData($objs, $type, $hash);
     $rss = Response::make($rss)->header('Content-type', 'application/rss+xml');
     Cache::put($key, $rss, 30);
     return $rss;
 }
Esempio n. 6
0
							</a>
						</strong>

						@endforeach
					</ul>
				@endif
			</div>
		</div>

		<div class="col-sm-4">
			<div class="list-group">
			  	<a href="/mp4" class="list-group-item active">
			    	<h4>Latest Videos</h4>
			  	</a>
			  	<?php 
$mp3s = MP4::orderBy('id', 'desc')->take(5)->get();
?>

				@if ( $mp3s && count( $mp3s ) > 0 )
					<ul class="list-unstyled">

						@foreach( $mp3s as $mp3 )
						
						<strong>
							<a class="list-group-item" href="/mp3/{{ $mp3->id }}">
								{{ $mp3->name }}
							</a>
						</strong>

						@endforeach
					</ul>
Esempio n. 7
0
 public function getMP4($id)
 {
     $mp4 = MP4::find($id);
     $mp4->download += 1;
     $mp4->save();
     if ($mp4) {
         $youtube_url = 'http://savefrom.net/#url=' . urlencode('https://www.youtube.com/watch?v=' . $mp4->youtube_id);
         return Redirect::to($youtube_url);
     } else {
         return Redirect::to('/mp4')->withMessage('Nou regrèt, men ou pa ka telechaje videyo ou vle a.');
     }
 }
 public function index()
 {
     return MP4::take(3)->get();
 }