public function testDestroyReturnsJsonResponseInstance()
 {
     $users = Factory::times(5)->create('App\\User');
     $currentUser = User::first();
     Auth::login($currentUser);
     $controller = new FriendController($currentUser);
     $request = new Request(['userId' => 2]);
     $response = $controller->destroy($request);
     $this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);
 }
 function testVerify()
 {
     // Given
     $this->startSession();
     $userData = ['name' => 'Some name', 'email' => '*****@*****.**', 'password' => 'strongpassword', 'country_code' => '1', 'phone_number' => '5558180101'];
     $user = new User($userData);
     $user->authy_id = 'authy_id';
     $user->save();
     $this->be($user);
     $mockAuthyApi = Mockery::mock('Authy\\AuthyApi')->makePartial();
     $mockVerification = Mockery::mock();
     $mockTwilioClient = Mockery::mock(\Twilio\Rest\Client::class)->makePartial();
     $mockTwilioClient->messages = Mockery::mock();
     $twilioNumber = config('services.twilio')['number'];
     $mockTwilioClient->messages->shouldReceive('create')->with($user->fullNumber(), ['body' => 'You did it! Signup complete :)', 'from' => $twilioNumber])->once();
     $mockAuthyApi->shouldReceive('verifyToken')->with($user->authy_id, 'authy_token')->once()->andReturn($mockVerification);
     $mockVerification->shouldReceive('ok')->once()->andReturn(true);
     $this->app->instance(\Twilio\Rest\Client::class, $mockTwilioClient);
     $this->app->instance('Authy\\AuthyApi', $mockAuthyApi);
     $modifiedUser = User::first();
     $this->assertFalse($modifiedUser->verified);
     // When
     $response = $this->call('POST', route('user-verify'), ['token' => 'authy_token', '_token' => csrf_token()]);
     // Then
     $modifiedUser = User::first();
     $this->assertRedirectedToRoute('user-index');
     $this->assertTrue($modifiedUser->verified);
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $user = User::first();
     if (!$user) {
         $this->error('No user to import articles to');
         return;
     }
     $archives = PostCategory::where('name', 'archives')->first();
     if (!$archives) {
         $archives = PostCategory::create(['name' => 'archives', 'description' => 'old posts from prev site']);
     }
     $this->archiveId = $archives->id;
     $upperBound = intval($this->ask('What is the upper bound for the article ids?'));
     $articlesToFetch = collect(ImportResult::getMissingIdsUpToLimit($upperBound));
     $articlesToFetch->each(function ($id) use($user) {
         try {
             $reader = $this->articleReader->getPage($id);
             $this->import($reader, $id, $user);
             ImportResult::create(['article_id' => $id, 'imported' => 1]);
         } catch (\Exception $e) {
             $this->error('Failed on article ' . $id . ' : ' . $e->getMessage());
             ImportResult::create(['article_id' => $id, 'imported' => 0]);
         }
     });
 }
Example #4
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     if (Auth::guest()) {
         \Auth::login(User::first());
     }
     $this->currentUser = \Auth::user();
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     //Get the Number of Orders
     $count = Order::todaysOrders();
     JavaScript::put(['foo' => 'bar', 'user' => User::first(), 'age' => 29]);
     return view('pages.index', ['count' => $count]);
 }
Example #6
0
 public function testFetchesInheritedClasses()
 {
     factory(User::class)->create(['type' => Employee::class]);
     $employee = User::first();
     $this->assertEquals(Employee::class, $employee->type);
     $this->assertInstanceOf(Employee::class, $employee);
 }
 public function testGet()
 {
     $users = User::get();
     $this->assertEquals(3, $users->count());
     $users = User::where('id', '>', 1)->get();
     $this->assertEquals(2, $users->count());
     // test chunk
     User::chunk(2, function ($users) {
         foreach ($users as $user) {
             $this->assertInternalType('int', $user->id);
         }
     });
     User::chunk(1, function ($users) {
         $this->assertInstanceOf('Illuminate\\Support\\Collection', $users);
     });
     // test find with query builder
     $user = User::where('id', '>', 1)->find(1);
     $this->assertNull($user);
     $user = User::where('id', '>', 1)->find(2);
     $this->assertEquals(2, $user->id);
     // test first without query builder
     $user = User::first();
     $this->assertInstanceOf('App\\User', $user);
     // test retrieving aggregates
     $max_id = User::max('id');
     $this->assertGreaterThanOrEqual(3, $max_id);
     $count = User::count();
     $this->assertGreaterThanOrEqual(3, $count);
     $sum = User::sum('id');
     $this->assertGreaterThanOrEqual(6, $sum);
 }
Example #8
0
 public static function customCreate(CreateConversationRequest $request)
 {
     $conv = new Conversation();
     $conv->Title = $request->Title;
     // if nothing specified in the request
     if (!$request->has('user_id')) {
         // if we are not even logged ( happen while seeding base)
         if (!\Auth::check()) {
             $conv->user_id = User::first()->id;
         } else {
             $conv->user_id = \Auth::id();
         }
     }
     // if Pending status is specified we take it, if not default value will be applied (false)
     if (!$request->has('Pending')) {
         $conv->Pending = $request->Pending;
     }
     $conv->created_at = Carbon::now();
     $conv->save();
     // When conversation is settled the Thread can be created
     $thread = new Thread();
     $thread->user_id = $conv->user_id;
     $thread->Content = $request->Content;
     $thread->conversation_id = $conv->id;
     $thread->created_at = Carbon::now();
     $thread->Pending = $conv->Pending;
     $thread->save();
     return true;
 }
Example #9
0
 /**
  * Display a listing of the resource associated with the tag name.
  *
  * @param Tag $tag
  * @return \Illuminate\Http\Response
  */
 public function tagged(Tag $tag)
 {
     $admin = User::first();
     $tags = Tag::all();
     $articles = $tag->publishedArticles()->get();
     $currentTag = $tag;
     return view($this->theme() . 'home', compact('articles', 'currentTag', 'admin', 'tags'));
 }
Example #10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $payment = User::first()->payments()->create(['completed' => 1, 'money' => 15000]);
     $payment->arrears()->create(['user_id' => 2, 'money' => 5000, 'confirm' => 3]);
     $payment->arrears()->create(['user_id' => 3, 'money' => 10000, 'confirm' => 3]);
     $payment = User::find(4)->payments()->create(['completed' => 0, 'money' => 10000]);
     $payment->arrears()->create(['user_id' => 1, 'money' => 5000, 'confirm' => 3]);
     $payment->arrears()->create(['user_id' => 3, 'money' => 2000, 'confirm' => 1]);
 }
 /**
  *
  */
 public function run()
 {
     Recipe::truncate();
     DB::table('food_recipe')->truncate();
     DB::table('taggables')->truncate();
     $this->user = User::first();
     $this->faker = Faker::create();
     $this->createRecipes();
 }
Example #12
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $firstadmin = 0;
     $check = \App\User::first();
     if ($check === null) {
         $firstadmin = 1;
     }
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'isAdmin' => $firstadmin]);
 }
Example #13
0
 /**
  * @test
  */
 public function a_user_can_post_to_a_category()
 {
     $this->withoutMiddleware();
     $user = User::first();
     $category = factory(PostCategory::class)->create();
     $response = $this->call('POST', '/admin/users/' . $user->id . '/blog/categories/' . $category->id . '/posts', ['title' => 'My First Blog Post']);
     $this->assertEquals(302, $response->status());
     $this->seeInDatabase('posts', ['user_id' => $user->id, 'post_category_id' => $category->id, 'title' => 'My First Blog Post']);
 }
Example #14
0
 public function run()
 {
     $faker = Faker::create();
     $types = ['post', 'page', 'post'];
     $user = User::first();
     foreach (range(1, 10) as $index) {
         DB::table('exp_categories')->insert(['title' => $faker->name, 'description' => $faker->paragraph(5), 'created_by' => $user->id, 'type' => $types[array_rand($types)], 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // Rules
     $role = new Role();
     $roleAdmin = $role->create(['name' => 'Administrador', 'slug' => 'administrator', 'description' => 'Administrador geral do sistema']);
     $user = User::first();
     if ($user) {
         $user->assignRole($roleAdmin);
     }
 }
Example #16
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Category::truncate();
     $categoryNames = ['coding', 'social', 'faith', 'health', 'minimalism'];
     foreach ($categoryNames as $name) {
         $category = new Category(['name' => $name]);
         $category->user()->associate(User::first());
         $category->save();
     }
 }
Example #17
0
 /**
  * A basic functional test example.
  *
  * @return void
  */
 public function testUserEdit()
 {
     $UserAdmin = \App\User::whereHas('role', function ($q) {
         $q->where('admin', true);
     })->first();
     $this->be($UserAdmin);
     $User = \App\User::first();
     $response = $this->call('GET', route('admin.users.edit', $User));
     $this->assertResponseOk();
 }
Example #18
0
 public function run()
 {
     DB::table('empresas')->delete();
     $empresa = Empresa::create(["nombre" => 'Condominium']);
     $this->command->info('Se crearon empresas en la db.');
     $usuario = User::first();
     $usuario->empresa()->associate($empresa);
     $usuario->save();
     $this->command->info('Se asignaron usuarios a la primer empresa.');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $user = User::first();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 100; $i++) {
         $name = $faker->name;
         $posts = ['name' => $name, 'slug' => Str::slug($name), 'content' => $faker->paragraph(rand(1, 9)), 'user_id' => $user->id, 'category_id' => rand(1, 9), 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')];
         DB::table('posts')->insert($posts);
     }
 }
 /**
  * A functional test example.
  *
  * @return void
  */
 public function testReceiptCategoryAssign()
 {
     $receipt = Factory::create('App\\Receipt');
     $categories = Factory::times(3)->create('App\\Category');
     $owner = ['user_id' => \App\User::first()->id];
     $receipt->categories()->attach($categories->lists('id'), $owner);
     foreach ($categories as $category) {
         $this->assertTrue($receipt->hasCategory($category));
     }
 }
 public function declineJob(Request $request)
 {
     $user = Auth::user();
     //employer
     $job = Jobs::find($request->input("job_id"));
     $employee = User::first($request->input("employee_id"));
     $job->users()->sync([$user->id => ['status' => "decline"]]);
     $mailing = new Mailing();
     $mailing->sendApprovedOrDenied($employee, $user, $job, 'Approved');
     return redirect('/applicants');
 }
Example #22
0
 /**
  * Fills teams table
  *
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         $t = Team::create(['name' => $faker->name(), 'abbreviation' => $faker->realText(11), 'description' => $faker->realText(150)]);
         $t->captain()->associate(User::first());
         $t->members()->attach(User::first());
         //set captain of all teams to first user
         $t->save();
     }
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next, $plan = NULL)
 {
     //dd(User::first());
     $user = User::first();
     //        $user = $request->user();
     if ($user && $user->subscribed($plan)) {
         //if($user && $user->subscribed($plan)){
         return $next($request);
     }
     return redirect('/');
 }
Example #24
0
 protected function tearDown()
 {
     if (is_null($this->uid)) {
         $user = User::first();
         if (!is_null($user)) {
             $user->delete();
         }
     } else {
         User::where('uid', '>', $this->uid)->delete();
     }
 }
Example #25
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $firstadmin = 0;
     $check = \App\User::first();
     if ($check === null) {
         $firstadmin = 1;
     }
     //Vulnerability #1 password stored in plaintext
     //Vulnerability #3 SQL injection
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => $data['password'], 'isAdmin' => $firstadmin]);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('auctions')->delete();
     $owner = User::first();
     $style_first = AuctionStyle::first();
     $style_random = AuctionStyle::orderByRaw("RAND()")->first();
     Auction::create(['owner_id' => $owner->id, 'auction_style_id' => $style_first->id, 'title' => 'La trahison des images - René Magritte', 'year' => 1928, 'width' => '63.5', 'height' => '93.98', 'depth' => null, 'description' => 'The Treachery of Images (sometimes translated as The Treason of Images) is a painting by the Belgian surrealist painter René Magritte.', 'condition' => 'Great', 'origin' => 'Belgium', 'img_artwork' => '/img/uploads/magritte_1.jpg', 'img_signature' => '/img/uploads/magritte_2.png', 'img_optional' => null, 'min_price' => '20000', 'max_price' => '1000000', 'buyout_price' => '1000000', 'enddate' => Carbon::parse('last wednesday')->format('Y-m-d')]);
     Auction::create(['owner_id' => $owner->id, 'auction_style_id' => $style_random->id, 'title' => 'Skrik - Edvard Munch', 'year' => 1893, 'width' => '91', 'height' => '73.5', 'depth' => null, 'description' => 'The Scream (Norwegian: Skrik) is the popular name given to each of four versions of a composition, created as both paintings and pastels, by the Expressionist artist Edvard Munch between 1893 and 1910. The Greman title Munch gave these works is Der Schrei der Natur (The Scream of Nature). The works show a figure with an agonized expression against a landscape with a tumultuous orange sky. Arthur Lubow has described The Scream as "an icon of modern art, a Mona Lisa for our time."', 'condition' => 'Okay', 'origin' => 'Oslo', 'img_artwork' => '/img/uploads/scream_1.jpg', 'img_signature' => '/img/uploads/scream_2.jpg', 'img_optional' => '/img/uploads/scream_3.jpg', 'min_price' => '7500', 'max_price' => '1355000', 'buyout_price' => '1000000', 'enddate' => Carbon::parse('next saturday')->format('Y-m-d')]);
     for ($i = 0; $i < 50; $i++) {
         Auction::create(['owner_id' => $owner->id, 'auction_style_id' => $style_random->id, 'title' => 'FILLER ' . $i, 'year' => rand(1000, 2000), 'width' => rand(10, 100), 'height' => rand(10, 100), 'depth' => null, 'description' => "FILLER DESCRIPTION Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", 'condition' => 'Fine', 'origin' => 'World', 'img_artwork' => '/img/uploads/filler_' . rand(1, 8) . '.jpg', 'img_signature' => '/img/uploads/filler_' . rand(1, 8) . '.jpg', 'img_optional' => null, 'min_price' => rand(100, 1000), 'max_price' => rand(2000, 20000), 'buyout_price' => 20000, 'enddate' => Carbon::parse('next thursday')->format('Y-m-d')]);
     }
 }
 /**
  * Permet de créer un nouvel User dans la base de données, après que la validation s'est bien passée
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     // Si l'utilisateura rentré un numéro de téléphone du genre "01.12-23.12.54"
     $data['phone'] = str_replace(['.', ' ', '-'], '', $data['phone']);
     $data['phone'] = preg_replace('/\\+[0-9]{2}(.+)/', '0$1', $data['phone']);
     // Si on n'a pas encore d'utilisateurs, alors ce nouvel utilisateur est Admin, sinon il est Particulier
     $data['user_type_id'] = User::first() === null ? 1 : 2;
     // Génération d'un pseudo unique, puisque les comptes peuvent être supprimé
     $data['pseudo'] = strtolower(substr($data['last_name'], 0, 1) . substr($data['first_name'], 0, 2) . '.' . substr($data['email'], 0, 3) . '.' . str_random(9));
     // Création de l'utilisateur dans la base de données
     return User::create(['first_name' => $data['first_name'], 'last_name' => $data['last_name'], 'email' => $data['email'], 'pseudo' => $data['pseudo'], 'phone' => $data['phone'], 'user_type_id' => $data['user_type_id'], 'address' => $data['address'], 'password' => bcrypt($data['password'])]);
 }
 public function postlogin(Request $request)
 {
     $nrp = $request->input('nrp');
     $pass = $request->input('password');
     $admin = User::first();
     if ($admin->where('nrp', $nrp)->count() > 0) {
         if (Hash::check($pass, $admin->password)) {
             $request->session()->put('admin', $request->input('nrp'));
             return redirect()->action('AdminController@dashboard');
         } else {
             return redirect()->action('LoginAdminController@getlogin');
         }
     } else {
         return redirect()->action('LoginAdminController@getlogin');
     }
 }
Example #29
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $user = User::first();
     Event::create(['title' => 'Northern Soul: The Film', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'CoderDojo at The Sharp Project', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Design How Talks', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Loz’s Birthday Party', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Introduction to Arduino', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Made You Look Documentary a Film About the Digital Age', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'CoderDojo at The Sharp Project Hackday', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Film How - Northern Soul / Factory', 'time_start' => '2016-10-30-19-00-00', 'time_end' => '2016-10-30-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Manchester Moleskine® Talks, Exhibition', 'time_start' => '2016-11-01-19-00-00', 'time_end' => '2016-11-01-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Manchester Worker Bee Exhibition', 'time_start' => '2016-11-03-19-00-00', 'time_end' => '2016-11-03-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Festival of the Spoken Nerd: Just for Graphs Comedy', 'time_start' => '2016-11-08-19-00-00', 'time_end' => '2016-11-08-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Back to the Future at Manchester Cathederal Film', 'time_start' => '2016-12-02-19-00-00', 'time_end' => '2016-12-02-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Biospheric Studio presents Urban Naturalist Workshop', 'time_start' => '2016-12-09-19-00-00', 'time_end' => '2016-12-09-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'The Hitchhiker’s Guide to the Solar System Exhibition', 'time_start' => '2016-12-12-19-00-00', 'time_end' => '2016-12-12-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Homeless Film festival - Waste Land Film', 'time_start' => '2016-12-19-19-00-00', 'time_end' => '2016-12-19-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Both sides now: It was the best of times, it was the worst of times? Exhibition', 'time_start' => '2016-05-04-19-00-00', 'time_end' => '2016-05-04-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
     Event::create(['title' => 'Places', 'time_start' => '2016-05-06-19-00-00', 'time_end' => '2016-05-07-22-30-00', 'content' => 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum link style auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget Link style sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.', 'venue' => '70 Oxford Street, M1 5NH', 'user_id' => User::orderByRaw("RAND()")->first()->id, 'category_id' => rand(1, 5), 'color_scheme_id' => rand(1, 18)]);
 }
Example #30
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::table('users')->delete();
     DB::table('user_location')->delete();
     DB::table('venue')->delete();
     DB::table('stage')->delete();
     DB::table('transactions')->delete();
     DB::table('tracks')->delete();
     DB::table('users')->insert(['name' => 'Testy Test', 'email' => '*****@*****.**', 'username' => 'test_account', 'password' => Hash::make('Test!234'), 'meta' => '{"points": 5000, "maxRooms": 3, "maxTracks": 3}']);
     DB::table('user_location')->insert(['user_id' => User::first()->id, 'venue_id' => 0]);
     DB::table('venue')->insert(['name' => 'Rock Out', 'capacity' => 10, 'user_id' => 0]);
     DB::table('stage')->insert(['venue_id' => Venue::where('name', '=', 'Rock Out')->get()[0]->id]);
     DB::table('venue')->insert(['name' => 'The Country Club', 'capacity' => 15, 'user_id' => 0]);
     DB::table('stage')->insert(['venue_id' => Venue::where('name', '=', 'The Country Club')->get()[0]->id]);
     DB::table('venue')->insert(['name' => 'EDM', 'capacity' => 25, 'user_id' => 0]);
     DB::table('stage')->insert(['venue_id' => Venue::where('name', '=', 'EDM')->get()[0]->id]);
     DB::table('venue')->insert(['name' => 'Perosnal Venue', 'capacity' => 15, 'user_id' => User::first()->id]);
     DB::table('stage')->insert(['venue_id' => Venue::where('name', '=', 'Perosnal Venue')->get()[0]->id]);
     DB::table('transactions')->insert(['user_id' => User::first()->id, 'desc' => "Created room 'Personal Venue' for 750 points"]);
     DB::table('tracks')->insert(['user_id' => User::first()->id, 'name' => 'Bumpin', 'sequence' => '[["","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","hipHopTwo_beatz00","","","","",""],["","","hipHopOne_beatz01","","hipHopOne_beatz01","hipHopOne_beatz01","hipHopOne_beatz01","hipHopOne_beatz01","hipHopOne_beatz01","hipHopOne_beatz01","hipHopOne_beatz01","hipHopOne_beatz01","hipHopOne_beatz01","",""],["shared_triangle00","shared_triangle00","shared_triangle00","shared_triangle00","shared_triangle00","shared_triangle00","","shared_triangle00","","shared_triangle00","","shared_triangle00","","shared_triangle00","shared_triangle00"],["","","","","","","misc_effect00","","","misc_effect00","","","misc_effect00","","","","misc_effect00","","misc_effect00","","","misc_effect00","","","","misc_effect00","","","misc_effect00",""],["","","","","","hipHopOne_kbd00","","hipHopOne_kbd00","","","","hipHopOne_kbd00","","hipHopOne_kbd00",""],["","","","","","","","","","","","","hipHopOne_bass00","hipHopOne_bass00","","hipHopOne_bass00","hipHopOne_bass00","","hipHopOne_bass00","hipHopOne_bass00","","hipHopOne_bass00","hipHopOne_bass00","","hipHopOne_bass00","hipHopOne_bass00","","","hipHopOne_bass00",""]]']);
     Model::reguard();
 }