Exemplo n.º 1
0
 public function run()
 {
     DB::table('xcasts')->truncate();
     $faker = Faker::create();
     foreach (range(1, 64) as $index) {
         Xcast::create(['title' => $faker->sentence, 'author' => $faker->name, 'poster' => 'casts/poster/_default.jpg', 'video' => 'casts/video/_default.mp4', 'duration' => $faker->time, 'description' => $faker->text, 'github' => $faker->url, 'notes' => $faker->text($maxNbChars = 2000), 'rendered_notes' => $faker->text($maxNbChars = 2000)]);
     }
 }
Exemplo n.º 2
0
 /**
  * Store a newly created xcast in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Xcast::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $data['rendered_notes'] = Markdown::string(Input::get('notes'));
     $data['poster'] = 'img/_default.jpg';
     Xcast::create($data);
     return Redirect::route('admin.xcasts.index');
 }