public function index() { try { $dados['videos'] = Video::all(); return view('admin/videos/videos', $dados); } catch (\Exception $e) { LogR::exception('index videos', $e); session()->flash('flash_message', 'Ops!! Ocorreu algum problema!. ' . $e->getMessage()); return Redirect::back(); } }
/** * Run the database seeds. * * @return void */ public function run() { // $videos = Video::all()->all(); $users = User::all()->all(); $faker = Faker\Factory::create(); foreach ($videos as $video) { $loops = rand(1, 20); for ($i = 0; $i < $loops; $i++) { try { $user = $faker->randomElement($users); $user->favorites()->attach($video); } catch (PDOException $e) { #pass } } } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $dados['dados'] = Video::all(); return view('videos', $dados); }
/** * Display a listing of the Video. * * @param Request $request * @return Response */ public function index(Request $request) { $videos = Video::all(); return view('videos.index')->with('videos', $videos); }
public function index() { $vids = Video::all(); return view('admin.videos')->with('videos', $vids); }
public function show() { $videos = Video::all(); return view('video.import', ['videos' => $videos]); }
/** * Show the application welcome screen to the user. * * @return Response */ public function index() { $videos = \App\Models\Video::all(); $selected_category = false; return view('partials.videos', compact('videos', 'selected_category')); }
public function getVideosByType($type, $created_at = null, $updated_at = null) { $str = 'vid_status = ?'; $str = !empty($created_at) ? sprintf('%s AND created_at < DATE_SUB(NOW(), INTERVAL %s)', $str, $created_at) : $str; $str = !empty($updated_at) ? sprintf('%s AND updated_at < DATE_SUB(NOW(), INTERVAL %s)', $str, $updated_at) : $str; return Video::all(['conditions' => [$str, $type]]); }